-
Notifications
You must be signed in to change notification settings - Fork 59
Move map expansion button to itinerary header #1502
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
base: dev
Are you sure you want to change the base?
Conversation
|
@amy-corson-ibigroup I prevented scrolling in the collapsed header area and updated to use the chevron icon! Currently looking into the animation to see if I can clean it up a bit but wanted to get the other fixes over to you for review. |
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 we move the zoom buttons to the left hand side? We're still getting some button overlap on smaller screen sizes: !

- Something about the button isn't quite right to me, especially when it's collapsed... wondering how we feel about a) making the chevron icon a little wider, and/or b) when the itinerary results are collapsed, making the button the base branding color, so it matches the mobile header? idk, just a couple of ideas, I'm not married to either of them but curious what you and a second reviewer might think!
| @@ -1,5 +1,7 @@ | |||
| /* eslint-disable complexity */ | |||
| import { ArrowLeft } from '@styled-icons/fa-solid/ArrowLeft' | |||
| import { ChevronDown } from '@styled-icons/fa-solid/ChevronDown' | |||
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.
Probably easier to just import one icon and rotate
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.
Well, actually I guess we import both in app-menu-items so I'll leave that to the second reviewer
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.
Yeah, I found these via their usage in another component and figured I'd keep the same pattern here. Happy to go with a rotate strategy if you or others feel strongly, though!
Oh, I'm seeing now we have it changed for one environment in the configuration, but I think this needs to be the new default! |
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 like the unicode chevron! thank you for the changes and for your patience! Sorry for taking a few days to review:
- if you look at this on taller devices, the duration button is peeking out. I think we'll need a solution where the duration button is conditionally rendered?
- The sort results button is blue now?
Good catch on the vertical spacing! I dug into it and realized that we need to be a bit more adaptive in our sizing of the button. I ended up using the viewport height ( Regarding the blue sort button, I believe that problem is fixed with the updated configuration styling! Let me know if it persists even with the updated config though. |
amy-corson-ibigroup
left a comment
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.
| {typeof getCustomMapOverlays === 'function' && | ||
| getCustomMapOverlays(!itinerary && !pending)} | ||
| <NavigationControl | ||
| position={navigationControlPosition || 'bottom-right'} |
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'll leave this to second reviewer to decide but the positioning on desktop here is looking weird to me, it's just so different from every other desktop map application. Wondering if we should follow what others apps do, take these buttons out on mobile and leave them alone on desktop.
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.
How about we only move them on mobile? Check out this commit and let me know what you think
amy-corson-ibigroup
left a comment
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.
| position={ | ||
| overrideNavigationControlPosition || | ||
| navigationControlPosition || | ||
| 'bottom-right' | ||
| } |
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.
Wait would this be easier? Rather than the additional prop:
position = { navigationControlPosition || (mobile ? 'top-left' : 'bottom-right') }
Let me know, maybe you already tried this
| const mapExpansionText = useMemo(() => { | ||
| return mapExpanded | ||
| ? intl.formatMessage({ | ||
| id: 'components.BatchResultsScreen.showResults' | ||
| }) | ||
| : intl.formatMessage({ | ||
| id: 'components.BatchResultsScreen.expandMap' | ||
| }) | ||
| }, [intl, mapExpanded]) | ||
|
|
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.
Interesting, I think generally we would just create two strings and conditionally render them based on mapExpanded below, but this might be more efficient? I'll let the second reviewer decide
| alignItems: 'center', | ||
| display: 'flex', | ||
| height: `${TOGGLE_MAP_BUTTON_HEIGHT}vh`, | ||
| justifyContent: 'center', | ||
| margin: '-10px 0', |
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 is a lot of inline CSS, could be good at this point to create a styled component











Description:
This update moves the "Expand map"/"Show results" button from the map to the itinerary header component, preventing overlap issues with the map attribution on smaller screen sizes in mobile view.
PR Checklist: