From 4642b9a4148ec209ab82eff415b47699a7ce0446 Mon Sep 17 00:00:00 2001 From: Ansh Goyal Date: Tue, 6 Feb 2024 18:25:42 +0530 Subject: [PATCH] add navbar and centered logo Signed-off-by: Ansh Goyal --- components/navigation/NavBar.js | 16 ++++++---------- pages/index.js | 19 +++++++++++++++---- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/components/navigation/NavBar.js b/components/navigation/NavBar.js index fe68b8c3cd4..17423d6f438 100644 --- a/components/navigation/NavBar.js +++ b/components/navigation/NavBar.js @@ -104,17 +104,13 @@ export default function NavBar({ router.push(href); }; - /* - useEffect to set the initial language on component mount - Detects the user's preferred language using browserLanguageDetector - and updates the language without affecting the localStorage. - This ensures the components renders with the correct initial language. - */ + /** + * useEffect to set the initial language on component mount + * Detects the user's preferred language using browserLanguageDetector + * and updates the language without affecting the localStorage. + * This ensures the components renders with the correct initial language. + */ useEffect(() => { - /** - * First param: Passes the language based on the browser's default language - * Second param: Prevents the language change from being saved in the local storage - */ changeLanguage(browserLanguageDetector(), false); }, []); diff --git a/pages/index.js b/pages/index.js index 546c7345025..c5bc7fed2b3 100644 --- a/pages/index.js +++ b/pages/index.js @@ -1,3 +1,6 @@ +import NavBar from '../components/navigation/NavBar' +import Head from '../components/Head' +import StickyNavbar from '../components/navigation/StickyNavbar' import { languageDetection } from "../lib/i18n"; function HomePage() { @@ -5,10 +8,18 @@ function HomePage() { languageDetection(); return ( -
- -
Loading...
-
+ <> + + + + +
+
+ +
Loading...
+
+
+ ) }