-
-
Notifications
You must be signed in to change notification settings - Fork 29
Featurepanel: Make the entire heading visible on the mobile drawer #555
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const { feature } = useFeatureContext(); | ||
const label = getLabel(feature); | ||
|
||
// thw pwa needs space at the bottom | ||
const isStandalone = useMediaQuery('(display-mode: standalone)'); |
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.
@jvaclavik - did you already tried to use that media-query? I think you already tried to accomodate for iPhone menu handle in the bottom, but I believe you removed it after some time. Do you remember what was the issue?
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.
Impressed again, very good solution to a hard problem. It looks much prettier. 👍
Some performance changes though:
42c886d
to
bb75028
Compare
@zbycz is this fine now? |
@@ -29,7 +28,7 @@ const Flex = styled.div` | |||
flex: 1; | |||
`; | |||
|
|||
export const FeaturePanel = () => { | |||
export const FeaturePanel = forwardRef<HTMLDivElement>((_, ref) => { |
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.
Can you please use headingRef
prop instead?
forwardRef
is meant to be used for "the main ref of a component", eg. for FeaturePanel
it would be some div for the whole panel. I may be mistaken, feel free to look it up. 🙂
@Dlurak - after you fix reviews requesting changes, you should be able to dismiss my review by this button. Then you can merge. |
@@ -109,7 +110,8 @@ const IndexWithProviders = ({ climbingAreas }: IndexWithProvidersProps) => { | |||
<Loading /> | |||
{!directions && <SearchBox />} | |||
{directions && <DirectionsBox />} | |||
{featureShown && !isMobileMode && <FeaturePanelOnSide />} | |||
{featureShown && !isMobileMode && isMounted && <FeaturePanelOnSide />} |
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.
FYI - this isMounted breaks the server-side-rendering for featurepanel (#623)
I reverted it here:
I understand you wanted to remove the Panel while loading on the mobile, but this is not a good way to do it 🙂 some CSS media queries is the way.
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.
I am not sure anymore but I think I added it to resolve a hydration error
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.
I've referenced this in a new issue #690
Description
Checklist