(fix) dark theme,train modal

This commit is contained in:
ManishMadan2882
2024-07-30 18:01:49 +05:30
parent f75ed4bc66
commit 09f2f2a9e7
8 changed files with 26 additions and 53 deletions

View File

@@ -1,5 +1,4 @@
import { Routes, Route } from 'react-router-dom';
import { useEffect } from 'react';
import Navigation from './Navigation';
import Conversation from './conversation/Conversation';
import About from './About';
@@ -34,17 +33,7 @@ function MainLayout() {
}
export default function App() {
const [isDarkTheme] = useDarkTheme();
useEffect(() => {
localStorage.setItem('selectedTheme', isDarkTheme ? 'Dark' : 'Light');
if (isDarkTheme) {
document
.getElementById('root')
?.classList.add('dark', 'dark:bg-raisin-black');
} else {
document.getElementById('root')?.classList.remove('dark');
}
}, [isDarkTheme]);
useDarkTheme();
return (
<>
<Routes>