Skip to content

Commit

Permalink
Fix display of add-location form (#395)
Browse files Browse the repository at this point in the history
Prevents the map from showing behind the add-location form.
  • Loading branch information
wbazant authored Jun 9, 2024
1 parent 9b8c365 commit 090daae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/mobile/MobileLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ const shouldDisplayMapPage = (pathname) => {
exact: false,
strict: false,
})
const isAddingLocation = match?.params.entryId === 'new'
const isPlacingNewLocationMarker =
match?.params.entryId === 'new' && match?.params.nextSegment !== 'details'

const entryId = match?.params.entryId && parseInt(match.params.entryId)
// distinguish viewing a location from having it displayed during e.g. editing or review
const isViewingLocation =
entryId && match.params.nextSegment?.indexOf('@') === 0
return isAddingLocation || isViewingLocation
return isPlacingNewLocationMarker || isViewingLocation
}
const MobileLayout = () => {
const history = useAppHistory()
Expand Down

0 comments on commit 090daae

Please sign in to comment.