-
Notifications
You must be signed in to change notification settings - Fork 3
Add retry page for locations and location details page #619
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
Open
shakilhossain1
wants to merge
2
commits into
main
Choose a base branch
from
feature/add-retry-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| "use client"; | ||
|
|
||
| import { useRouter } from "next/navigation"; | ||
| import { useTransition } from "react"; | ||
| import { Button } from "./ui/button"; | ||
|
|
||
| export default function SidePanelErrorState() { | ||
| const router = useRouter(); | ||
| const [isPending, startTransition] = useTransition(); | ||
|
|
||
| return ( | ||
| <div | ||
| className="w-full h-full flex items-center justify-center p-6" | ||
| id="side_panel_error_state" | ||
| > | ||
| <div className="max-w-sm text-center space-y-3"> | ||
| <h2 className="text-lg font-semibold text-black"> | ||
| Unable to load locations | ||
| </h2> | ||
| <p className="text-sm text-grey-900"> | ||
| We couldn't load the locations right now. Please try again. | ||
| </p> | ||
| <Button | ||
| className="rounded-full" | ||
| onClick={() => startTransition(() => router.refresh())} | ||
| type="button" | ||
| disabled={isPending} | ||
| aria-busy={isPending} | ||
| > | ||
| {isPending ? ( | ||
| <span className="inline-flex items-center gap-2"> | ||
| <svg | ||
| className="h-4 w-4 animate-spin" | ||
| viewBox="0 0 24 24" | ||
| aria-hidden="true" | ||
| > | ||
| <circle | ||
| className="opacity-25" | ||
| cx="12" | ||
| cy="12" | ||
| r="10" | ||
| stroke="currentColor" | ||
| strokeWidth="4" | ||
| fill="none" | ||
| /> | ||
| <path | ||
| className="opacity-90" | ||
| fill="currentColor" | ||
| d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" | ||
| /> | ||
| </svg> | ||
| <span>Retrying...</span> | ||
| </span> | ||
| ) : ( | ||
| "Retry" | ||
| )} | ||
| </Button> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
redirectIfNearbyAndIfLatitudeAndLongitudeIsNotSetcalls Next.jsredirect(...), which signals redirects by throwing a control-flow error; this catch now treats any non-Error404Responseas a recoverable failure and renders an empty map instead. In thesortBy=nearby+ missing lat/long cookie flow, users will no longer be redirected to the non-nearby URL and will land on the error/empty state, which is a regression in navigation behavior.Useful? React with 👍 / 👎.