diff --git a/README.md b/README.md index 371027c..52be28e 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,10 @@ This will start the development server and you can view the application in your Denied /denied + + Denied + /denied + diff --git a/src/App.jsx b/src/App.jsx index 928dbe5..a2cc2ad 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -100,7 +100,6 @@ const App = () => { ) } /> - { ) } /> + + } /> diff --git a/src/components/DarkModeToggle.jsx b/src/components/DarkModeToggle.jsx new file mode 100644 index 0000000..4b08bda --- /dev/null +++ b/src/components/DarkModeToggle.jsx @@ -0,0 +1,49 @@ +import React, {useState,useEffect} from 'react' + +const DarkModeToggle = () => { + const [theme, setTheme] = useState('dark'); + + useEffect(() => { + const savedTheme = localStorage.getItem('theme'); + if (savedTheme) { + setTheme(savedTheme); + } else { + setTheme('dark'); + localStorage.setItem('theme', 'dark'); + } + }, []); + + useEffect(() => { + if (theme === 'dark') { + document.documentElement.classList.add('dark'); + } else { + document.documentElement.classList.remove('dark'); + } + localStorage.setItem('theme', theme); + }, [theme]); + + const toggleTheme = () => { + const newTheme = theme === 'dark' ? 'light' : 'dark'; + setTheme(newTheme); + }; + + return ( +
+
+ {/* Circle inside the switch */} +
+
+
+ ) +} + +export default DarkModeToggle diff --git a/src/components/FormStep1.jsx b/src/components/FormStep1.jsx index 2082cea..f34f11e 100644 --- a/src/components/FormStep1.jsx +++ b/src/components/FormStep1.jsx @@ -4,6 +4,7 @@ import { AuthContext } from '../context/AuthContext'; import { Link } from 'react-router-dom'; import { validations } from '../utils/formValidations'; + const FormStep1 = ({ onNext }) => { const { updateRegisterInfo, registerInfo } = useContext(AuthContext); const [errors, setErrors] = useState({}); @@ -36,70 +37,71 @@ const FormStep1 = ({ onNext }) => { animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: 20 }} transition={{ duration: 0.5 }} - className="p-6 rounded-lg shadow-lg h-full " + className="p-6 rounded-lg shadow-lg h-full bg-white dark:bg-neutral-900" > -

START FOR FREE

-

Create your account

-

Already a member ? Log in

+

START FOR FREE

+

Create your account

+

+ Already a member? + + Log in + +

- - + +
- - -