diff --git a/src/components/form.jsx b/src/components/form.jsx index c2be3d67..946c63d7 100644 --- a/src/components/form.jsx +++ b/src/components/form.jsx @@ -68,11 +68,11 @@ const Form = () => { }, [userInput]); return ( -
+
-

- +

+ Start by entering a slang, {" "} and our dictionary will spit out an abbreviation.{" "} @@ -105,7 +105,7 @@ const Form = () => { setUserInput(e.target.value.toLocaleLowerCase()) @@ -135,14 +135,14 @@ const Form = () => { )} {error && ( -
+
Oops. Some connection error occured.
)} {isUserInputBlank && (
-

+

Search bar 🔍 is Empty! Please input a slang.

@@ -150,22 +150,22 @@ const Form = () => { {errorMessage && (
-

+

This entry does not exist in our records as of yet :(

-

+

1. You can help us add this by creating a{" "} + className=" text-deeppurple dark:text-purple"> github issue

-

+

2. Or, you could fill out this{" "} + className="text-deeppurple dark:text-purple"> feedback form {" "} and we will address the issue diff --git a/src/components/hero.jsx b/src/components/hero.jsx index 13720159..8c02f5b4 100644 --- a/src/components/hero.jsx +++ b/src/components/hero.jsx @@ -9,19 +9,19 @@ import Form from "./form"; const Hero = () => { return ( -

+
-

+

Writing on the internet

-

+

is changing. IYKYK

-

+

If You Know,

@@ -30,7 +30,7 @@ const Hero = () => {
-

+

You Know.

@@ -51,25 +51,25 @@ const Hero = () => {
-

- +

+ Abbreve (A-bree-vay) is {" "} an open source dictionary{" "} - for slang.{" "} + for slang.{" "}

-

+

Curated by the community, for the community.

-
+
+ className="text-deeppurple dark:text-purple">

Nate (DojoJOJO)

@Nateemerson

@@ -78,22 +78,22 @@ const Hero = () => {

Replying to{" "} - + @DunsinWebDev and @njongemy

-

+

idk wtf ur on about... ICYMI IMHO RTFM, KISS, SHIT or GTFO.

18:31 . 07 Sep 22 .{" "} - + {" "} Twitter Web App

-
+

Reading shouldn't feel like work.

@@ -102,41 +102,41 @@ const Hero = () => {
-
+
-

+

Do you find yourself googling the meaning of slang like hmu, lgtm, lfg etc ?

-
+

Always 😢

-

84.8%

+

84.8%

-
+

Never 🙂

-

15.2%

+

15.2%

18:11 . 07 Sep 22 .{" "} - + {" "} Twitter for Android @@ -144,11 +144,11 @@ const Hero = () => {

-

- Googling in between - conversations is{" "} +

+ Googling in between + conversations is{" "} fast becoming{" "} - the new normal. + the new normal.

diff --git a/src/components/navbar.jsx b/src/components/navbar.jsx index 8f8f12ce..775d5fa2 100644 --- a/src/components/navbar.jsx +++ b/src/components/navbar.jsx @@ -5,42 +5,25 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faMoon, faSun } from "@fortawesome/free-solid-svg-icons"; const Navbar = () => { - const defaultTheme = localStorage.getItem("theme") || "light"; - const defaultToggle = - JSON.parse(localStorage.getItem("toggleButton")) || false; - - const [theme, setTheme] = useState(defaultTheme); - const [toggleTheme, setToggleTheme] = useState(defaultToggle); - + const deafultTheme = localStorage.getItem("isDarkMode") || false; + const [isDarkMode, setIsDarkMode] = useState(deafultTheme); const element = document.documentElement; - const handletheme = () => { - if (toggleTheme) { - setTheme("dark"); - } else { - setTheme("light"); - } - - setToggleTheme(!toggleTheme); - }; useEffect(() => { - switch (theme) { - case "dark": + switch (isDarkMode) { + case true: element.classList.add("dark"); - localStorage.setItem("theme", "dark"); - localStorage.setItem("toggleButton", JSON.stringify(false)); + localStorage.setItem("isDarkMode", true); break; - case "light": + case false: element.classList.remove("dark"); - localStorage.setItem("theme", "light"); - localStorage.setItem("toggleButton", JSON.stringify(true)); + localStorage.setItem("isDarkMode", false); break; default: - localStorage.removeItem("theme"); - + localStorage.removeItem("isDarkMode"); break; } - }, [theme]); + }, [isDarkMode]); return (
@@ -82,5 +65,4 @@ const Navbar = () => { ); }; - export default Navbar;