-
Notifications
You must be signed in to change notification settings - Fork 0
fix: update authentication modal styles and improve success handling #20
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,20 +42,21 @@ export default function AuthenticationModal() { | |
| variant: "destructive", | ||
| }); | ||
| throw new Error(error); | ||
| } | ||
|
|
||
| toast({ | ||
| title: "Success", | ||
| description: "Signed in successfully", | ||
| variant: "success", | ||
| }); | ||
| if (redirect) { | ||
| router.push(redirect); | ||
| } else { | ||
| toast({ | ||
| title: "Success", | ||
| description: "Signed in successfully", | ||
| variant: "success", | ||
| }); | ||
| if (redirect) { | ||
| router.push(redirect); | ||
| } else { | ||
| router.push("/"); | ||
| } | ||
| router.push("/"); | ||
|
Comment on lines
+52
to
+55
|
||
| } | ||
| }, | ||
| }); | ||
| // biome-ignore lint/suspicious/noExplicitAny: <explanation> | ||
| } catch (error: any) { | ||
| toast({ | ||
|
Comment on lines
+59
to
61
|
||
| title: "Error", | ||
|
|
@@ -66,11 +67,11 @@ export default function AuthenticationModal() { | |
| }; | ||
|
|
||
| return ( | ||
| <div className="w-auto mx-auto p-4 h-full flex items-center justify-center"> | ||
| <div className="w-full h-full flex items-center justify-center p-4"> | ||
| <div className="md:block hidden"> | ||
| <DesktopAuthModal sdk={sdk} connect={connect} /> | ||
| </div> | ||
| <div className="md:hidden block"> | ||
| <div className="md:hidden block w-full"> | ||
| <MobileAuthModal sdk={sdk} connect={connect} /> | ||
| </div> | ||
| </div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ export function MobileAuthModal({ sdk, connect }: Props) { | |
| }} | ||
| className="w-full" | ||
| > | ||
| <Card className="w-full min-h-[500px] !shadow-none rounded-3xl overflow-hidden border-t border-l border-r md:border-0 mt-96"> | ||
| <Card className="w-full h-[600px] !shadow-none rounded-3xl overflow-hidden border-t border-l border-r md:border-0 p-0"> | ||
|
||
| <div className="flex flex-col w-full h-full"> | ||
| {/* Top Panel */} | ||
| <motion.div | ||
|
|
||
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.
In the
errorbranch you toast an error and thenthrow new Error(error), but the outercatchalso toasts, which will likely result in duplicate error toasts for the same failure. Prefer a single error-reporting path (e.g., throw and let thecatchtoast, or toast andreturnwithout throwing).