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.
This commit is contained in:
K
2025-06-19 16:29:29 +05:30
parent 4b6faef5eb
commit 23e12d3c7e
+7 -3
View File
@@ -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 */}
<Navbar2 language={language} />
<Container>
<Outlet />
{/* Pass language to Outlet context for nested routes */}
<Outlet context={{ language }} />
</Container>
</>
);
};
export default MainLoginPage;