-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[docs] Home: fix layout on mobile with slow connection #19283
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing this. I tried to reproduce this bug, but was not able to. To test this branch, I:
- Cloned your branch
- Made a production build and ran it
- Throttled my network to Slow 3G
- Then navigated from the website to the docs
The result looked fine, so I am happy with shipping this. Just left one code style comment that I would like to fix, but functionality looks good to me.
const CustomCol = ({ children, sm, md, lg, xl, xxl }: PropsWithChildren<ColProps>) => ( | ||
<> | ||
<Col css={cellWrapperStyle} sm={sm} md={md} lg={lg} xl={xl} xxl={xxl}> | ||
{children} | ||
</Col> | ||
<div css={mobileCellWrapperStyle}>{children}</div> | ||
</> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should put this in its own file (one file = one component)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file includes all variation of Cells (multiple components) already, and CustomCol
is not exported - it has been only used by those cell components, so I think that moving it to it's own file isn't a great idea in this particular case.
Why
Hopefully fixes https://twitter.com/tejas89_patel/status/1574819679947829248
How
The grid component that we are using relay on the JS to inject the correct breakpoint styles, which on slow connection on mobile can lead to the broken layout when loading.
We can alter the default initial screen size setting, but this would lead to the issues with slow connection on desktop.
An alternate solution to that is to switch to the static containers on mobile, utilizing media queries.
Test Plan
The docs apps has been build and served locally, then I have attempted to load it in browser with Throttle settings set to "Slow 3G".
Preview
Locally served docs
https://docs.expo.dev/
Checklist
expo prebuild
& EAS Build (eg: updated a module plugin).