import { Routes, Route } from 'react-router-dom'; import Navigation from './Navigation'; import Conversation from './conversation/Conversation'; import About from './About'; import PageNotFound from './PageNotFound'; import { inject } from '@vercel/analytics'; import { useMediaQuery } from './hooks'; import { useState,useEffect } from 'react'; import Setting from './Setting'; inject(); export default function App() { const { isMobile } = useMediaQuery(); const [navOpen, setNavOpen] = useState(!isMobile); const selectedTheme = localStorage.getItem('selectedTheme'); useEffect(()=>{ if (selectedTheme === 'Dark') { document.documentElement.classList.add('dark'); document.body.classList.add('dark:bg-raisin-black'); } else { document.documentElement.classList.remove('dark'); } },[]) return (
} /> } /> } /> } />
); }