-
Notifications
You must be signed in to change notification settings - Fork 13
SENDLINKRETRY #1358
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
SENDLINKRETRY #1358
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| 'use client' | ||
|
|
||
| import { Button } from '@/components/0_Bruddle' | ||
| import { useSupportModalContext } from '@/context/SupportModalContext' | ||
| import Image from 'next/image' | ||
| import Link from 'next/link' | ||
| import PEANUTMAN_CRY from '@/animations/GIF_ALPHA_BACKGORUND/512X512_ALPHA_GIF_konradurban_05.gif' | ||
|
|
||
| type ClaimErrorViewProps = { | ||
| title: string | ||
| message: string | ||
| primaryButtonText: string | ||
| onPrimaryClick: () => void | ||
| } | ||
|
|
||
| export const ClaimErrorView = ({ title, message, primaryButtonText, onPrimaryClick }: ClaimErrorViewProps) => { | ||
| const { openSupportWithMessage } = useSupportModalContext() | ||
|
|
||
| return ( | ||
| <div className="flex flex-col items-center justify-center space-y-4 rounded-lg text-center"> | ||
| <Image src={PEANUTMAN_CRY.src} alt="Sad peanut 😢" width={96} height={96} /> | ||
| <div className="space-y-2"> | ||
| <h1 className="text-lg font-semibold">{title}</h1> | ||
| <p className="text-sm font-normal md:max-w-xs">{message}</p> | ||
| </div> | ||
| <div className="flex w-full flex-col gap-2"> | ||
| <Button onClick={onPrimaryClick} size="medium" shadowSize="4" variant="purple" className="w-full"> | ||
| {primaryButtonText} | ||
| </Button> | ||
| <Button | ||
| onClick={() => { | ||
| openSupportWithMessage(`I clicked on this link but got an error: ${window.location.href}`) | ||
| }} | ||
| size="medium" | ||
| shadowSize="4" | ||
| variant="stroke" | ||
| className="w-full" | ||
| > | ||
| Talk to support | ||
| </Button> | ||
| <Link href="/home" className="mt-2 cursor-pointer text-sm text-grey-1 underline underline-offset-2"> | ||
| Go back to home | ||
| </Link> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
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 |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export * from './NotFound.view' | ||
| export * from './WrongPassword.view' | ||
| export * from './Claimed.view' | ||
| export * from './ClaimError.view' |
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
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.
Guard
windowaccess for SSR safety.Direct access to
window.location.hrefcan throw during server-side rendering or initial hydration in Next.js, even in client components.Apply this diff to safely access the window object:
<Button onClick={() => { - openSupportWithMessage(`I clicked on this link but got an error: ${window.location.href}`) + openSupportWithMessage(`I clicked on this link but got an error: ${typeof window !== 'undefined' ? window.location.href : ''}`) }} size="medium" shadowSize="4" variant="stroke" className="w-full" >📝 Committable suggestion
🤖 Prompt for AI Agents