Skip to content

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

Merged
merged 6 commits into from
Sep 21, 2024

Conversation

Dlurak
Copy link
Collaborator

@Dlurak Dlurak commented Sep 18, 2024

Description

  1. Fix a hydration error when opening a node/way/relation url on mobile
  2. Make the entire heading visible in the collapsed mobile drawer
  3. Give a bit of extra space to the heading in standalone mode
    • it kind of collided with the os native swipe navigation
Old New
old_brandenburger_tor new_brandenburger_tor
old_max_liebermann_haus new_max_liebermann_haus
old_long new_long

Checklist

  • checked dark mode / light mode
  • checked mobile / desktop
  • checked server-side-rendering (SSR)
  • code style is consistent with the rest of the project
  • new dependencies are reasoned about in PR comments

Copy link

vercel bot commented Sep 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
osmapp ✅ Ready (Inspect) Visit Preview Sep 21, 2024 6:13am

const { feature } = useFeatureContext();
const label = getLabel(feature);

// thw pwa needs space at the bottom
const isStandalone = useMediaQuery('(display-mode: standalone)');
Copy link
Owner

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?

Copy link
Owner

@zbycz zbycz left a 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:

@Dlurak
Copy link
Collaborator Author

Dlurak commented Sep 20, 2024

@zbycz is this fine now?
It seems like I can't merge it myself until you allow it.

zbycz
zbycz previously requested changes Sep 21, 2024
@@ -29,7 +28,7 @@ const Flex = styled.div`
flex: 1;
`;

export const FeaturePanel = () => {
export const FeaturePanel = forwardRef<HTMLDivElement>((_, ref) => {
Copy link
Owner

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. 🙂

@zbycz
Copy link
Owner

zbycz commented Sep 21, 2024

@Dlurak - after you fix reviews requesting changes, you should be able to dismiss my review by this button. Then you can merge.

image

@Dlurak Dlurak enabled auto-merge (squash) September 21, 2024 06:11
@Dlurak Dlurak merged commit 3295501 into zbycz:master Sep 21, 2024
2 checks passed
@Dlurak Dlurak deleted the featurepanel-drawer branch September 30, 2024 22:37
@@ -109,7 +110,8 @@ const IndexWithProviders = ({ climbingAreas }: IndexWithProvidersProps) => {
<Loading />
{!directions && <SearchBox />}
{directions && <DirectionsBox />}
{featureShown && !isMobileMode && <FeaturePanelOnSide />}
{featureShown && !isMobileMode && isMounted && <FeaturePanelOnSide />}
Copy link
Owner

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.

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

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.

2 participants