From f55da77e46540f61051ac85f681ffeac4f2ed02a Mon Sep 17 00:00:00 2001 From: Jordi Enric Date: Wed, 1 Apr 2026 22:59:32 +0200 Subject: [PATCH 1/2] style: polish auth provider controls --- .../src/components/auth/GoogleAuthButton.tsx | 51 +++++++++++++++++++ apps/web/src/pages/sign-in.tsx | 25 ++++----- apps/web/src/pages/sign-up.tsx | 23 +++++---- 3 files changed, 76 insertions(+), 23 deletions(-) create mode 100644 apps/web/src/components/auth/GoogleAuthButton.tsx diff --git a/apps/web/src/components/auth/GoogleAuthButton.tsx b/apps/web/src/components/auth/GoogleAuthButton.tsx new file mode 100644 index 0000000..f48ecea --- /dev/null +++ b/apps/web/src/components/auth/GoogleAuthButton.tsx @@ -0,0 +1,51 @@ +import { Button } from "@/components/ui/button"; + +type Props = { + children?: React.ReactNode; + onClick: () => void; +}; + +function GoogleIcon() { + return ( + + ); +} + +export function GoogleAuthButton({ children = "Continue with Google", onClick }: Props) { + return ( + + ); +} diff --git a/apps/web/src/pages/sign-in.tsx b/apps/web/src/pages/sign-in.tsx index b88a3f0..04eb2e3 100644 --- a/apps/web/src/pages/sign-in.tsx +++ b/apps/web/src/pages/sign-in.tsx @@ -1,3 +1,4 @@ +import { GoogleAuthButton } from "@/components/auth/GoogleAuthButton"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; @@ -106,7 +107,7 @@ export default function SignIn() { -
+

Sign in

Don't have an account?{" "} @@ -115,11 +116,9 @@ export default function SignIn() {

{isGoogleSignInEnabled ? ( -
- -

+

+ +

Or use email

@@ -141,12 +140,14 @@ export default function SignIn() {
{isTurnstileEnabled ? ( - setCaptchaToken(null)} - /> +
+ setCaptchaToken(null)} + /> +
) : null}
diff --git a/apps/web/src/pages/sign-up.tsx b/apps/web/src/pages/sign-up.tsx index d0d1af8..35ad0da 100644 --- a/apps/web/src/pages/sign-up.tsx +++ b/apps/web/src/pages/sign-up.tsx @@ -1,3 +1,4 @@ +import { GoogleAuthButton } from "@/components/auth/GoogleAuthButton"; import Spinner from "@/components/Spinner"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; @@ -120,11 +121,9 @@ export default function SignIn() {

Create your account

{isGoogleSignInEnabled ? ( -
- -

+

+ +

Or create an account with email

@@ -138,12 +137,14 @@ export default function SignIn() {
{isTurnstileEnabled ? ( - setCaptchaToken(null)} - /> +
+ setCaptchaToken(null)} + /> +
) : null} {loading ? ( From abffc6873e725e891bf264a8af36e38890a255c1 Mon Sep 17 00:00:00 2001 From: Jordi Enric Date: Wed, 1 Apr 2026 23:04:32 +0200 Subject: [PATCH 2/2] feat: always show google sign-in --- apps/web/src/pages/sign-in.tsx | 18 ++++++------------ apps/web/src/pages/sign-up.tsx | 18 ++++++------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/apps/web/src/pages/sign-in.tsx b/apps/web/src/pages/sign-in.tsx index 04eb2e3..5268827 100644 --- a/apps/web/src/pages/sign-in.tsx +++ b/apps/web/src/pages/sign-in.tsx @@ -20,14 +20,10 @@ export default function SignIn() { const supabase = createSupabaseBrowserClient(); const user = useUser(); const router = useRouter(); - const [isGoogleSignInEnabled, setIsGoogleSignInEnabled] = useState(false); const [isTurnstileEnabled, setIsTurnstileEnabled] = useState(false); useEffect(() => { setIsTurnstileEnabled(isProductionDeployment()); - setIsGoogleSignInEnabled( - window.localStorage.getItem("google-signin") === "true" - ); if (user) { router.push("/blogs"); @@ -115,14 +111,12 @@ export default function SignIn() { Sign up

- {isGoogleSignInEnabled ? ( -
- -

- Or use email -

-
- ) : null} +
+ +

+ Or use email +

+
diff --git a/apps/web/src/pages/sign-up.tsx b/apps/web/src/pages/sign-up.tsx index 35ad0da..01edbf2 100644 --- a/apps/web/src/pages/sign-up.tsx +++ b/apps/web/src/pages/sign-up.tsx @@ -20,14 +20,10 @@ export default function SignIn() { const turnstileRef = useRef(null); const supabase = createSupabaseBrowserClient(); const router = useRouter(); - const [isGoogleSignInEnabled, setIsGoogleSignInEnabled] = useState(false); const [isTurnstileEnabled, setIsTurnstileEnabled] = useState(false); useEffect(() => { setIsTurnstileEnabled(isProductionDeployment()); - setIsGoogleSignInEnabled( - window.localStorage.getItem("google-signin") === "true" - ); supabase.auth.getSession().then((res) => { if (res.data.session?.user) { @@ -120,14 +116,12 @@ export default function SignIn() {

Create your account

- {isGoogleSignInEnabled ? ( -
- -

- Or create an account with email -

-
- ) : null} +
+ +

+ Or create an account with email +

+