From 23e12d3c7e3980d2acabf5ca6135e21e7ce260c9 Mon Sep 17 00:00:00 2001 From: Kshitij Date: Thu, 19 Jun 2025 16:29:29 +0530 Subject: [PATCH] Support for language context in MainLoginPage.jsx - Updated MainLoginPage component to accept a `language` prop with a default value of "en". - Modified Navbar2 to receive the `language` prop for localization. - Passed the `language` context to the Outlet for nested routes, enabling language-specific rendering in child components. --- Frontend/src/pages/Login/MainLoginPage.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Frontend/src/pages/Login/MainLoginPage.jsx b/Frontend/src/pages/Login/MainLoginPage.jsx index a2300c8..15bad91 100644 --- a/Frontend/src/pages/Login/MainLoginPage.jsx +++ b/Frontend/src/pages/Login/MainLoginPage.jsx @@ -1,16 +1,20 @@ import React from "react"; import Navbar2 from "../../components/Navbar2.jsx"; -import { Outlet } from "react-router-dom"; +import { Outlet, useOutletContext } from "react-router-dom"; import Container from "../../components/Container.jsx"; -const MainLoginPage = () => { +const MainLoginPage = ({ language = "en" }) => { return ( <> + {/* If Navbar2 is used here, pass language */} + - + {/* Pass language to Outlet context for nested routes */} + ); }; export default MainLoginPage; +