diff --git a/src/views/LandingPage.jsx b/src/views/LandingPage.jsx index 2d633f2..407c1fe 100644 --- a/src/views/LandingPage.jsx +++ b/src/views/LandingPage.jsx @@ -2,13 +2,13 @@ import logo from '../assets/logo.png'; export function LandingPage() { return ( -
+
Ready to start your journey? Click the sign-in button below to begin planning your grocery runs with CollabShop today.
diff --git a/src/views/Layout.jsx b/src/views/Layout.jsx index 5fafc1c..3d82726 100644 --- a/src/views/Layout.jsx +++ b/src/views/Layout.jsx @@ -5,11 +5,14 @@ import { FaSignOutAlt, FaInfoCircle, FaCartPlus, + FaMoon, + FaSun, } from 'react-icons/fa'; import { IconButton } from '../components/IconButton'; import { useAuth, SignOutButton, SignInButton } from '../api/useAuth.jsx'; import { auth } from '../api/config.js'; import logo from '../assets/logo.png'; +import { useEffect } from 'react'; //import './Layout.css'; /** @@ -22,21 +25,52 @@ import logo from '../assets/logo.png'; export function Layout() { const { user } = useAuth(); + + //Toggle dark/light mode + const toggleTheme = () => { + const currentTheme = localStorage.getItem('theme') || 'light'; + const newTheme = currentTheme === 'dark' ? 'light' : 'dark'; + + //Toggle the dark class on the html element + document.documentElement.classList.toggle('dark', newTheme === 'dark'); + localStorage.setItem('theme', newTheme); + }; + + // Set the theme on initial load + useEffect(() => { + const savedTheme = localStorage.getItem('theme') || 'light'; + document.documentElement.classList.toggle('dark', savedTheme === 'dark'); + }, []); return ( <>