Skip to content

Commit

Permalink
Use /locations/:locationId/edit for the form
Browse files Browse the repository at this point in the history
  • Loading branch information
wbazant committed Jan 28, 2025
1 parent 048295a commit f77ae1d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/desktop/SidePane.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const SidePane = () => {
<BackButton
onClick={() =>
history.push(
`/locations/${match.params.locationId}/edit/details`,
`/locations/${match.params.locationId}/edit`,
)
}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/entry/EntryMobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const TopRibbonButtons = ({ hasImages, drawerDisabled, onBackButtonClick }) => {
<EntryButton
onClick={(event) => {
event.stopPropagation()
history.push(`/locations/${locationId}/edit/details`)
history.push(`/locations/${locationId}/edit`)
}}
icon={<PencilIcon />}
label="edit-button"
Expand Down
4 changes: 2 additions & 2 deletions src/components/form/formRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const EditReview = ({ NavComponent }) => {
}

export const formRoutesMobile = [
<Route key="edit-location" path="/locations/:locationId/edit/details">
<Route key="edit-location" path="/locations/:locationId/edit">
<EditLocation NavComponent={MobileNav} />
</Route>,
<Route key="add-location" path="/locations/new">
Expand All @@ -147,7 +147,7 @@ export const formRoutesMobile = [
]

export const formRoutesDesktop = [
<Route key="edit-location" path="/locations/:locationId/edit/details">
<Route key="edit-location" path="/locations/:locationId/edit">
<EditLocation NavComponent={DesktopNav} />
</Route>,
<Route key="add-location" path="/locations/new">
Expand Down
11 changes: 4 additions & 7 deletions src/components/mobile/EditLocationPositionNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,18 @@ const EditLocationPositionNav = () => {

if (distanceMeters > 1) {
// Wait half a second to let the user observe the edited position being undone
setTimeout(
() => history.push(`/locations/${locationId}/edit/details`),
500,
)
setTimeout(() => history.push(`/locations/${locationId}/edit`), 500)
} else {
history.push(`/locations/${locationId}/edit/details`)
history.push(`/locations/${locationId}/edit`)
}
} else {
history.push(`/locations/${locationId}/edit/details`)
history.push(`/locations/${locationId}/edit`)
}
}

const handleConfirm = () => {
dispatch(updatePosition(googleMap?.getCenter().toJSON()))
history.push(`/locations/${locationId}/edit/details`)
history.push(`/locations/${locationId}/edit`)
}

return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/mobile/MobileLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ const MobileLayout = () => {
path={[
'/reviews/:reviewId/edit',
'/locations/:locationId/review',
'/locations/:locationId/edit/details',
'/locations/new',
]}
/>
Expand All @@ -108,6 +107,7 @@ const MobileLayout = () => {
<EditLocationPositionNav />
</TopBar>
</Route>
<Route path="/locations/:locationId/edit" />
<Route
path={['/map', '/list', '/locations/:locationId']}
component={SearchAndFilterTopBar}
Expand All @@ -121,7 +121,7 @@ const MobileLayout = () => {
<Route path={['/map', '/locations', '/list', '/settings']}>
<Switch>
<Route path="/locations/init" />
<Route path="/locations/:locationId/edit/position" />
<Route path="/locations/:locationId/edit" />
<Route path="/locations/:locationId">
{!streetView && <EntryMobile />}
</Route>
Expand Down

0 comments on commit f77ae1d

Please sign in to comment.