mirror of
				https://github.com/DerTyp7/explainegy-nextjs.git
				synced 2025-10-31 05:37:12 +01:00 
			
		
		
		
	texts
This commit is contained in:
		| @@ -12,9 +12,10 @@ function switchTheme(theme: string) { | ||||
|   const bodyElement = document.getElementsByTagName("body")[0]; | ||||
|  | ||||
|   if (theme == "dark") { | ||||
|     bodyElement.classList.remove("theme-light"); | ||||
|   } else { | ||||
|     bodyElement.classList.add("theme-light"); | ||||
|   } else { | ||||
|     bodyElement.classList.remove("theme-light"); | ||||
|     localStorage.setItem("theme", "light"); | ||||
|   } | ||||
| } | ||||
|  | ||||
| @@ -48,7 +49,7 @@ export default function Nav() { | ||||
|   const [categories, setCategories] = useState<Category[]>([]); | ||||
|  | ||||
|   async function handleSearchInput(event: React.ChangeEvent<HTMLInputElement>) { | ||||
|     const query = event.target.value; | ||||
|     const query = event.target.value ?? ""; | ||||
|     let result = await fetch(`/api/search?q=${query}`); | ||||
|     let json = await result.json(); | ||||
|  | ||||
| @@ -67,10 +68,6 @@ export default function Nav() { | ||||
|     } | ||||
|   }, []); | ||||
|  | ||||
|   useEffect(() => { | ||||
|     console.log(searchResults); | ||||
|   }, [searchResults]); | ||||
|  | ||||
|   useEffect(() => { | ||||
|     async function getCategories() { | ||||
|       await fetch(urlJoin(apiUrl, "categories")) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Janis
					Janis