From 3db2819a6326fa3d4e132eaad93ff6f09279e4c4 Mon Sep 17 00:00:00 2001 From: count0 Date: Fri, 17 Oct 2025 22:18:29 +0200 Subject: [PATCH] add google auth and improve look of new page --- src/pages/LoginProvidersPage.jsx | 91 +++++++++++++++++++++++++++----- 1 file changed, 78 insertions(+), 13 deletions(-) diff --git a/src/pages/LoginProvidersPage.jsx b/src/pages/LoginProvidersPage.jsx index ceab54e..4ff8aa2 100644 --- a/src/pages/LoginProvidersPage.jsx +++ b/src/pages/LoginProvidersPage.jsx @@ -1,17 +1,32 @@ + import React from 'react'; import { useNavigate } from 'react-router-dom'; import { supabase, isSupabaseConfigured } from '../lib/supabase'; import { Button } from '../components/ui/button'; +import { motion, AnimatePresence } from 'framer-motion'; const PROVIDERS = [ { id: 'github', label: 'GitHub' }, { id: 'discord', label: 'Discord' }, + { id: 'google', label: 'Google' }, // Add more providers here if needed ]; + const LoginProvidersPage = () => { const navigate = useNavigate(); + // Ensure theme is correct on mount + React.useEffect(() => { + const theme = localStorage.getItem('theme'); + document.documentElement.classList.remove('light', 'dark'); + if (theme === 'dark') { + document.documentElement.classList.add('dark'); + } else { + document.documentElement.classList.add('light'); + } + }, []); + const handleLogin = async (provider) => { if (!isSupabaseConfigured()) return alert('Supabase not configured. Set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY'); const { error } = await supabase.auth.signInWithOAuth({ provider }); @@ -19,20 +34,70 @@ const LoginProvidersPage = () => { }; return ( -
-
-

Choose Login Provider

-
- {PROVIDERS.map(p => ( - +
+ + +

Sync Your Habits

+

+ Log in to securely sync your habits across all your devices. Choose your preferred provider below.
+ (No posts or data will be shared without your consent.) +

+
+ + {PROVIDERS.map((p, i) => ( + + + ))} -
- -
+ + + + + {/* Decorative animated background shapes */} + + +
); };