diff --git a/package.json b/package.json index 7c36eda..c697a76 100644 --- a/package.json +++ b/package.json @@ -44,15 +44,19 @@ "@mui/material": "^5.11.12", "@mui/x-date-pickers": "^7.7.1", "@reduxjs/toolkit": "^2.0.1", + "compression": "^1.7.5", "dayjs": "^1.11.11", + "express": "^4.21.2", "formik": "^2.2.9", "js-cookie": "^3.0.5", + "memory-cache": "^0.2.0", "qs": "^6.11.2", "react": "^18.2.0", "react-dom": "^18.2.0", "react-redux": "^9.1.0", "react-router-dom": "^6.23.1", "serve": "^14.2.3", + "sirv": "^3.0.0", "yup": "^1.1.1" }, "devDependencies": { @@ -60,6 +64,7 @@ "@testing-library/jest-dom": "^6.2.0", "@testing-library/react": "^14.1.2", "@testing-library/user-event": "^14.5.2", + "@types/express": "^5.0.0", "@types/js-cookie": "^3.0.3", "@types/node": "^20.14.2", "@types/qs": "^6.9.7", @@ -84,6 +89,7 @@ "@testing-library/jest-dom": "^6.2.0", "@testing-library/react": "^14.1.2", "@testing-library/user-event": "^14.5.2", + "@types/express": "^5.0.0", "@types/jest": "^29.5.12", "@types/js-cookie": "^3.0.3", "@types/node": "^20.14.2", diff --git a/src/components/App.tsx b/src/components/App.tsx index 5162423..e0220a5 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1,13 +1,16 @@ import { CssBaseline, ThemeProvider } from "@mui/material" import { type ThemeProviderProps } from "@mui/material/styles/ThemeProvider" -import { useCallback, type FC, type ReactNode } from "react" +import { type FC, type ReactNode } from "react" import { Provider, type ProviderProps } from "react-redux" import { BrowserRouter, Routes as RouterRoutes } from "react-router-dom" +import { StaticRouter } from "react-router-dom/server" import { type Action } from "redux" import "./App.css" -import { InactiveDialog, ScreenTimeDialog } from "../features" -import { useCountdown, useEventListener, useLocation } from "../hooks" +import { useLocation } from "../hooks" +import { SSR } from "../settings" +// import { InactiveDialog, ScreenTimeDialog } from "../features" +// import { useCountdown, useEventListener } from "../hooks" // import "../scripts" // import { // configureFreshworksWidget, @@ -15,6 +18,7 @@ import { useCountdown, useEventListener, useLocation } from "../hooks" // } from "../utils/window" export interface AppProps { + path?: string theme: ThemeProviderProps["theme"] store: ProviderProps["store"] routes: ReactNode @@ -26,53 +30,54 @@ export interface AppProps { maxTotalSeconds?: number } -const Routes: FC< - Pick< - AppProps, - "routes" | "header" | "footer" | "headerExcludePaths" | "footerExcludePaths" - > -> = ({ +type BaseRoutesProps = Pick< + AppProps, + "routes" | "header" | "footer" | "headerExcludePaths" | "footerExcludePaths" +> + +const Routes: FC = ({ + path, routes, header = <>, // TODO: "header =
" footer = <>, // TODO: "footer =