Skip to content

Commit

Permalink
Update App.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhikaMalpani1702 committed Aug 1, 2024
1 parent 5b0c839 commit b0cb1a7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ import Contributors from './Pages/Contributors.jsx';
const ThemeContext = createContext();

const App = () => {
const theme = useSelector((state) => state.theme.value) ? "dark" : "light";
const [currentTheme, setTheme] = useState(theme);
const theme = useSelector((state) => state.theme.value) ? "dark" : "light";
const [currentTheme, setTheme] = useState(theme);

const toggleTheme = () => {
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
setTheme(newTheme);
localStorage.setItem('theme', newTheme);
};
const toggleTheme = () => {
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
setTheme(newTheme);
localStorage.setItem('theme', newTheme);
};

useEffect(() => {
AOS.init({
Expand Down

0 comments on commit b0cb1a7

Please sign in to comment.