Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(datatrakWeb): RN-1448: Responsive styling for landing page #5938

Open
wants to merge 28 commits into
base: dev
Choose a base branch
from

Conversation

alexd-bes
Copy link
Contributor

@alexd-bes alexd-bes commented Oct 2, 2024

Issue RN-1448: Responsive styling for landing page

Changes:

  • Responsive styling for landing page

Screenshots:

Screenshot 2024-10-03 at 4 33 19 PM
Screenshot 2024-10-03 at 4 34 08 PM
Screenshot 2024-10-03 at 4 35 29 PM
Screenshot 2024-10-03 at 4 36 16 PM

Copy link
Contributor

@jaskfla jaskfla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to admit I’ve mostly reviewed for readability; haven’t had the chance to pull the code and run it because I’m a bit time-constrained this week (and been a while since I last ran Tupaia)

Looks really great overall! A flurry of suggestions for possible minor improvements from me—the biggest one being how to handle components that have a mobile and desktop version. Otherwise mostly trivial details, so pre-approving 🍾

const ButtonContent = styled.div`
display: flex;
flex-direction: column;
width: 100%;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Far from critical, there are a couple places in this file where logical properties would be more appropriate

Suggested change
width: 100%;
inline-size: 100%;

Comment on lines +45 to +49
tbody tr:last-child {
td {
padding-block-end: 0.5rem;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tbody tr:last-child {
td {
padding-block-end: 0.5rem;
}
}
tbody tr:last-child td {
padding-block-end: 0.5rem;
}

export const DesktopHeaderLeft = ({ onClickLogo }) => {
return (
<Logo component={RouterLink} onClick={onClickLogo} to="/" title="Home">
<img src="/datatrak-logo-black.svg" alt="Tupaia Datatrak logo" width="100%" height="100%" />
Copy link
Contributor

@jaskfla jaskfla Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth inlining this SVG to save an HTTP request?

(I could easily be convinced “no”. I do personally like the readability of this, but inlining is an easy performance win 🤷)

Comment on lines +15 to +16
top: 0;
left: 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
top: 0;
left: 0;
inset-block-start: 0;
inset-inline-start: 0;

<Wrapper>
<ActivityFeedList items={firstPageItems} />
{hasNextPage && (
<ViewMoreButton onClick={() => setExpanded(true)}>View activity feed...</ViewMoreButton>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<ViewMoreButton onClick={() => setExpanded(true)}>View activity feed...</ViewMoreButton>
<ViewMoreButton onClick={() => setExpanded(true)}>View activity feed</ViewMoreButton>

Comment on lines +92 to +96
> section {
&:not(:last-child) {
margin-bottom: 0;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> section {
&:not(:last-child) {
margin-bottom: 0;
}
}
> section &:not(:last-child) {
margin-bottom: 0;
}

export const ResponsiveScrollBody = styled.div`
display: grid;
overflow-x: auto;
grid-template-columns: repeat(auto-fill, minmax(12rem, 18rem));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
grid-template-columns: repeat(auto-fill, minmax(12rem, 18rem));
grid-template-columns: repeat(auto-fill, minmax(max(100%, 12rem), 18rem));

View more
</DesktopButton>
<MobileButton component={Link} to={ROUTES.TASKS}>
View more...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
View more...
View more

@@ -107,9 +144,9 @@ export const TasksSection = () => {
<FlexSpaceBetween>
<SectionHeading>My tasks</SectionHeading>
{hasTasks && (
<ViewMoreButton component={Link} to={ROUTES.TASKS} display={{ xs: 'none', sm: 'block' }}>
<TopViewMoreButton component={Link} to={ROUTES.TASKS}>
View more...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
View more...
View more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants