diff --git a/app/App.tsx b/app/App.tsx index 98b71aa..09b3a08 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -1,5 +1,7 @@ "use client"; import React, { useEffect, useState } from "react"; +import { ToastContainer, toast } from "react-toastify"; +import "react-toastify/dist/ReactToastify.css"; import { Navbar, Link, @@ -9,34 +11,24 @@ import { CardFooter, } from "@nextui-org/react"; import { ChevronDown } from "@/public/assets/ChevronDown"; -import { - ImDeviantart, - ImDownload, - ImHammer, - ImNewspaper, -} from "react-icons/im"; +import { ImDeviantart, ImDownload, ImHammer, ImNewspaper } from "react-icons/im"; import Footer from "@/components/ui/footer"; import { useTheme } from "next-themes"; import NavbarComponent from "./front-navbar"; import ThemeProvider from "./provider"; -import Progressbar from "../components/progressbar/progressbar" +import Progressbar from "../components/progressbar/progressbar"; import { AnimatePresence, motion } from "framer-motion"; import Preloader from "../components/Preloader"; -import BackToTop from "../components/BackToTop/BackToTop" +import BackToTop from "../components/BackToTop/BackToTop"; + export default function App() { const [isMenuOpen, setIsMenuOpen] = useState(false); const [isLoggedIn, setIsLoggedIn] = useState(false); + const [darkMode, setDarkMode] = useState(false); + const icons = { - chevron: ( - - ), + chevron: , hammer: , dev: , slide: , @@ -54,261 +46,99 @@ export default function App() { ]; const { systemTheme, theme } = useTheme(); - const currentTheme = theme === "dark" ? systemTheme : theme; - const [darkMode, setDarkMode] = useState(false); - useEffect(() => { - setDarkMode(currentTheme === "dark"); - }, [currentTheme]); + setDarkMode((theme === "dark" ? systemTheme : theme) === "dark"); + }, [systemTheme, theme]); return ( - <> - - - - + + + + -
-