refactor: enforce frontend view model boundaries
This commit is contained in:
@@ -8,72 +8,104 @@ import { Protected, Public } from "../RouteGuards";
|
||||
|
||||
const CardPage = lazy(async () => {
|
||||
const { CardPage } = await import("@/pages/card");
|
||||
|
||||
return { default: CardPage };
|
||||
});
|
||||
|
||||
const CardsPage = lazy(async () => {
|
||||
const { CardsPage } = await import("@/pages/cards");
|
||||
|
||||
return { default: CardsPage };
|
||||
});
|
||||
|
||||
const BondPage = lazy(async () => {
|
||||
const { BondPage } = await import("@/pages/bond");
|
||||
|
||||
return { default: BondPage };
|
||||
});
|
||||
|
||||
const BondsPage = lazy(async () => {
|
||||
const { BondsPage } = await import("@/pages/bonds");
|
||||
|
||||
return { default: BondsPage };
|
||||
});
|
||||
|
||||
const StockPage = lazy(async () => {
|
||||
const { StockPage } = await import("@/pages/stock");
|
||||
|
||||
return { default: StockPage };
|
||||
});
|
||||
|
||||
const StocksPage = lazy(async () => {
|
||||
const { StocksPage } = await import("@/pages/stocks");
|
||||
|
||||
return { default: StocksPage };
|
||||
});
|
||||
|
||||
const AccountPage = lazy(async () => {
|
||||
const { AccountPage } = await import("@/pages/account");
|
||||
|
||||
return { default: AccountPage };
|
||||
});
|
||||
|
||||
const AccountEventsPage = lazy(async () => {
|
||||
const { AccountEventsPage } = await import("@/pages/account-events");
|
||||
|
||||
return { default: AccountEventsPage };
|
||||
});
|
||||
|
||||
const AccountOperationsPage = lazy(async () => {
|
||||
const { AccountOperationsPage } = await import("@/pages/account-operations");
|
||||
|
||||
return { default: AccountOperationsPage };
|
||||
});
|
||||
|
||||
const AccountIncomePage = lazy(async () => {
|
||||
const { AccountIncomePage } = await import("@/pages/account-income");
|
||||
|
||||
return { default: AccountIncomePage };
|
||||
});
|
||||
|
||||
const AccountsPage = lazy(async () => {
|
||||
const { AccountsPage } = await import("@/pages/accounts");
|
||||
|
||||
return { default: AccountsPage };
|
||||
});
|
||||
|
||||
const LoginPage = lazy(async () => {
|
||||
const { LoginPage } = await import("@/pages/login");
|
||||
|
||||
return { default: LoginPage };
|
||||
});
|
||||
|
||||
const NotFoundPage = lazy(async () => {
|
||||
const { NotFoundPage } = await import("@/pages/not-found");
|
||||
|
||||
return { default: NotFoundPage };
|
||||
});
|
||||
|
||||
const RegisterPage = lazy(async () => {
|
||||
const { RegisterPage } = await import("@/pages/register");
|
||||
|
||||
return { default: RegisterPage };
|
||||
});
|
||||
|
||||
const SettingsPage = lazy(async () => {
|
||||
const { SettingsPage } = await import("@/pages/settings");
|
||||
|
||||
return { default: SettingsPage };
|
||||
});
|
||||
|
||||
const ProtectedLayout = lazy(async () => {
|
||||
const { ProtectedLayout } = await import("../ProtectedLayout");
|
||||
|
||||
return { default: ProtectedLayout };
|
||||
});
|
||||
|
||||
const AppRoutes: FC = () => (
|
||||
<Routes>
|
||||
<Route element={<Navigate replace to="/accounts" />} path="/" />
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<Public>
|
||||
@@ -84,6 +116,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/login"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<Public>
|
||||
@@ -94,6 +127,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/register"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<Protected>
|
||||
@@ -111,6 +145,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/cards/:cardId"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -119,6 +154,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/cards"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -127,6 +163,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/bonds"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -135,6 +172,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/bonds/:bondId"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -143,6 +181,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/stocks"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -151,6 +190,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/stocks/:stockId"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -159,6 +199,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/accounts"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -167,6 +208,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/accounts/all"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -175,6 +217,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/accounts/all/operations"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -183,6 +226,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/accounts/all/income"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -191,6 +235,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/accounts/all/events"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -199,6 +244,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/accounts/:accountId"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -207,6 +253,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/accounts/:accountId/events"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -215,6 +262,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/accounts/:accountId/income"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -223,6 +271,7 @@ const AppRoutes: FC = () => (
|
||||
)}
|
||||
path="/accounts/:accountId/operations"
|
||||
/>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
@@ -232,6 +281,7 @@ const AppRoutes: FC = () => (
|
||||
path="/settings"
|
||||
/>
|
||||
</Route>
|
||||
|
||||
<Route
|
||||
element={(
|
||||
<LazyPage variant="content">
|
||||
|
||||
Reference in New Issue
Block a user