refactor: switch to declarative mode instead of data mode in react router

This commit is contained in:
Stavros
2025-05-30 18:24:34 +03:00
parent 34c8d16c7d
commit f2c81b6a5c
2 changed files with 23 additions and 55 deletions

View File

@@ -1,7 +1,8 @@
import { useAppContext } from "@/context/app-context";
import { LanguageSelector } from "../language/language";
import { Outlet } from "react-router";
export const Layout = ({ children }: { children: React.ReactNode }) => {
export const Layout = () => {
const { backgroundImage } = useAppContext();
return (
@@ -14,7 +15,7 @@ export const Layout = ({ children }: { children: React.ReactNode }) => {
}}
>
<LanguageSelector />
{children}
<Outlet />
</div>
);
};