2025-04-28 19:03:29 +01:00
|
|
|
"use client";
|
2025-02-24 12:37:15 +00:00
|
|
|
import type { Metadata } from "next";
|
2025-05-12 13:25:57 +01:00
|
|
|
import "./globals.css";
|
2025-02-24 12:37:15 +00:00
|
|
|
|
2025-05-12 13:25:57 +01:00
|
|
|
import { action, createStore, StoreProvider } from "easy-peasy";
|
|
|
|
|
import { Inter } from "next/font/google";
|
2025-04-28 19:03:29 +01:00
|
|
|
|
2025-05-12 14:00:03 +01:00
|
|
|
import { StoreModel } from "@appTypes/StoreModel";
|
|
|
|
|
import Navbar from "@components/Navbar";
|
2025-04-28 19:03:29 +01:00
|
|
|
|
2025-03-19 19:20:18 +00:00
|
|
|
const inter = Inter({
|
2025-04-28 19:03:29 +01:00
|
|
|
subsets: ["latin"],
|
|
|
|
|
variable: "--font-inter",
|
2025-02-24 12:37:15 +00:00
|
|
|
});
|
|
|
|
|
|
2025-04-28 19:03:29 +01:00
|
|
|
const store = createStore<StoreModel>({
|
|
|
|
|
currency: {
|
2025-05-09 10:30:12 +01:00
|
|
|
selectedCurrency: "EUR",
|
2025-04-28 19:03:29 +01:00
|
|
|
setSelectedCurrency: action((state, payload) => {
|
|
|
|
|
state.selectedCurrency = payload;
|
|
|
|
|
}),
|
|
|
|
|
currencies: ["GBP", "USD", "EUR"],
|
2025-05-09 10:30:12 +01:00
|
|
|
conversionRates: { GBP: 0.85, USD: 1.14, EUR: 1 },
|
2025-04-28 19:03:29 +01:00
|
|
|
tickers: { GBP: "£", USD: "$", EUR: "€" },
|
|
|
|
|
},
|
2025-05-12 14:00:03 +01:00
|
|
|
// user: null,
|
|
|
|
|
user: {
|
|
|
|
|
id: 123456,
|
|
|
|
|
createdAt: new Date(8.64e15),
|
|
|
|
|
email: "emily.neighbour@dyson.com",
|
|
|
|
|
passwordHash: "",
|
|
|
|
|
name: "Emily Neighbour",
|
|
|
|
|
role: "ADMIN",
|
|
|
|
|
scientist: undefined,
|
|
|
|
|
purchasedArtifacts: [],
|
|
|
|
|
},
|
2025-04-28 19:03:29 +01:00
|
|
|
});
|
2025-02-24 12:37:15 +00:00
|
|
|
|
|
|
|
|
export default function RootLayout({
|
2025-04-28 19:03:29 +01:00
|
|
|
children,
|
2025-02-24 12:37:15 +00:00
|
|
|
}: Readonly<{
|
2025-04-28 19:03:29 +01:00
|
|
|
children: React.ReactNode;
|
2025-02-24 12:37:15 +00:00
|
|
|
}>) {
|
2025-04-28 19:03:29 +01:00
|
|
|
return (
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<StoreProvider store={store}>
|
|
|
|
|
<body className={`${inter.variable} h-[calc(100vh-3.5rem)] flex flex-col min-h-screen antialiased`}>
|
|
|
|
|
<Navbar></Navbar>
|
|
|
|
|
<div className="flex-1 overflow-y-auto">{children}</div>
|
|
|
|
|
</body>
|
|
|
|
|
</StoreProvider>
|
|
|
|
|
</html>
|
|
|
|
|
);
|
2025-02-24 12:37:15 +00:00
|
|
|
}
|