From aafec288858b2cc9e11fd0b2470891083e8344df Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Sat, 5 Jul 2025 21:32:54 +0200 Subject: [PATCH] Improve flow of joining a tablo --- ui/src/App.tsx | 27 +++++++++++++------ .../BrandButtons/LoginWithGoogle.test.tsx | 4 +-- .../BrandButtons/LoginWithGoogle.tsx | 8 ++++-- ui/src/components/ProtectedRoute.tsx | 20 +++++++++++--- ui/src/hooks/auth.ts | 27 ++++++++++++++++--- ui/src/pages/join.tsx | 15 +++++++++++ ui/src/pages/login.tsx | 9 ++++--- ui/src/pages/oauth-signin.tsx | 10 +++++-- ui/src/pages/signup.tsx | 6 +++-- 9 files changed, 99 insertions(+), 27 deletions(-) diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 610cca6..1b121e7 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -45,14 +45,7 @@ export const App = () => { } /> - - - - } - /> + { } /> + + + } + > + + + + } + /> + } /> } /> }> diff --git a/ui/src/components/BrandButtons/LoginWithGoogle.test.tsx b/ui/src/components/BrandButtons/LoginWithGoogle.test.tsx index 3174855..78dfd38 100644 --- a/ui/src/components/BrandButtons/LoginWithGoogle.test.tsx +++ b/ui/src/components/BrandButtons/LoginWithGoogle.test.tsx @@ -14,7 +14,7 @@ describe("LoginWithGoogle", () => { loginWithGoogle: mockLoginWithGoogle, }); - render(); + render(); const button = screen.getByRole("button", { name: /Continuer avec Google/i, @@ -28,7 +28,7 @@ describe("LoginWithGoogle", () => { loginWithGoogle: mockLoginWithGoogle, }); - render(); + render(); const button = screen.getByRole("button", { name: /Continuer avec Google/i, diff --git a/ui/src/components/BrandButtons/LoginWithGoogle.tsx b/ui/src/components/BrandButtons/LoginWithGoogle.tsx index 0dedcd0..7417dee 100644 --- a/ui/src/components/BrandButtons/LoginWithGoogle.tsx +++ b/ui/src/components/BrandButtons/LoginWithGoogle.tsx @@ -1,8 +1,12 @@ import "./login-with-google.css"; import { useLoginGoogle } from "../../hooks/auth"; -export function LoginWithGoogle() { - const { loginWithGoogle } = useLoginGoogle(); +export function LoginWithGoogle({ + redirectUrl, +}: { + redirectUrl: string | null; +}) { + const { loginWithGoogle } = useLoginGoogle({ redirectUrl }); return (