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 ( -
+
CollabShop Logo, a collaboration platform for grocery shopping. -

+

CollabShop is more than just a grocery app—it's a tool that embodies the spirit of teamwork and collaboration. Created by early-career developers from{' '} @@ -16,7 +16,7 @@ export function LandingPage() { href="https://the-collab-lab.codes/" target="_blank" rel="noopener noreferrer" - className="text-txtPrimary font-bold underline hover:text-[#1A759F] transition duration-300" + className="text-txtPrimary dark:text-txtPrimaryDark font-bold underline hover:text-[#1A759F] transition duration-300" > The Collab Lab @@ -25,7 +25,7 @@ export function LandingPage() { effortlessly share and collaborate on lists. With CollabShop, planning your grocery trips becomes a seamless and enjoyable experience!

-

+

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 ( <>
-
+
{!!user && (
Logo - Signed in as {auth.currentUser.displayName} + + Signed in as {auth.currentUser.displayName} +
)} + + {/* Theme toggle button */} +
-
+
-