Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bde647aa08 | ||
|
|
e2a7d2e560 |
@@ -20,7 +20,6 @@ export const LoginCard = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log(search);
|
|
||||||
if (search.loggedOut) {
|
if (search.loggedOut) {
|
||||||
setAlert({
|
setAlert({
|
||||||
isAlert: true,
|
isAlert: true,
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
import { Button, DialogTitle, Input, Modal, ModalDialog, Stack, } from "@mui/joy";
|
import {
|
||||||
|
Button,
|
||||||
|
DialogTitle,
|
||||||
|
Input,
|
||||||
|
Modal,
|
||||||
|
ModalDialog,
|
||||||
|
Stack,
|
||||||
|
} from "@mui/joy";
|
||||||
import { useForm } from "@tanstack/react-form";
|
import { useForm } from "@tanstack/react-form";
|
||||||
import { useMutation } from "@tanstack/react-query";
|
import { useMutation } from "@tanstack/react-query";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -30,8 +37,6 @@ export const ChangePasswordModal = (props: ChangePasswordProps) => {
|
|||||||
newPasswordRep: "",
|
newPasswordRep: "",
|
||||||
},
|
},
|
||||||
onSubmit: async ({ value }) => {
|
onSubmit: async ({ value }) => {
|
||||||
console.log(value);
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
value.newPassword === value.newPasswordRep &&
|
value.newPassword === value.newPasswordRep &&
|
||||||
value.newPassword !== ""
|
value.newPassword !== ""
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ export const useLogout = () => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
console.log("LOGOUT");
|
|
||||||
Cookies.remove("token");
|
Cookies.remove("token");
|
||||||
void navigate({ to: "/login", search: { loggedOut: true } });
|
void navigate({ to: "/login", search: { loggedOut: true } });
|
||||||
};
|
};
|
||||||
|
|||||||
+125
-97
@@ -12,12 +12,13 @@ import { Route as rootRouteImport } from './routes/__root'
|
|||||||
import { Route as LoginRouteImport } from './routes/login'
|
import { Route as LoginRouteImport } from './routes/login'
|
||||||
import { Route as IndexRouteImport } from './routes/index'
|
import { Route as IndexRouteImport } from './routes/index'
|
||||||
import { Route as AppHiddenLayoutRouteImport } from './routes/app/_hiddenLayout'
|
import { Route as AppHiddenLayoutRouteImport } from './routes/app/_hiddenLayout'
|
||||||
import { Route as AppHiddenLayoutViewProductRouteImport } from './routes/app/_hiddenLayout/view-product'
|
import { Route as AppHiddenLayoutAuthedRouteImport } from './routes/app/_hiddenLayout/_authed'
|
||||||
import { Route as AppHiddenLayoutStoragesRouteImport } from './routes/app/_hiddenLayout/storages'
|
|
||||||
import { Route as AppHiddenLayoutInventoryRouteImport } from './routes/app/_hiddenLayout/inventory'
|
|
||||||
import { Route as AppHiddenLayoutAppSettingsRouteImport } from './routes/app/_hiddenLayout/app-settings'
|
|
||||||
import { Route as AppHiddenLayoutAddProductRouteImport } from './routes/app/_hiddenLayout/add-product'
|
|
||||||
import { Route as AppHiddenLayoutQuickViewProductRouteImport } from './routes/app/_hiddenLayout/quick-view/product'
|
import { Route as AppHiddenLayoutQuickViewProductRouteImport } from './routes/app/_hiddenLayout/quick-view/product'
|
||||||
|
import { Route as AppHiddenLayoutAuthedViewProductRouteImport } from './routes/app/_hiddenLayout/_authed/view-product'
|
||||||
|
import { Route as AppHiddenLayoutAuthedStoragesRouteImport } from './routes/app/_hiddenLayout/_authed/storages'
|
||||||
|
import { Route as AppHiddenLayoutAuthedInventoryRouteImport } from './routes/app/_hiddenLayout/_authed/inventory'
|
||||||
|
import { Route as AppHiddenLayoutAuthedAppSettingsRouteImport } from './routes/app/_hiddenLayout/_authed/app-settings'
|
||||||
|
import { Route as AppHiddenLayoutAuthedAddProductRouteImport } from './routes/app/_hiddenLayout/_authed/add-product'
|
||||||
|
|
||||||
const LoginRoute = LoginRouteImport.update({
|
const LoginRoute = LoginRouteImport.update({
|
||||||
id: '/login',
|
id: '/login',
|
||||||
@@ -34,62 +35,67 @@ const AppHiddenLayoutRoute = AppHiddenLayoutRouteImport.update({
|
|||||||
path: '/app',
|
path: '/app',
|
||||||
getParentRoute: () => rootRouteImport,
|
getParentRoute: () => rootRouteImport,
|
||||||
} as any)
|
} as any)
|
||||||
const AppHiddenLayoutViewProductRoute =
|
const AppHiddenLayoutAuthedRoute = AppHiddenLayoutAuthedRouteImport.update({
|
||||||
AppHiddenLayoutViewProductRouteImport.update({
|
id: '/_authed',
|
||||||
id: '/view-product',
|
|
||||||
path: '/view-product',
|
|
||||||
getParentRoute: () => AppHiddenLayoutRoute,
|
|
||||||
} as any)
|
|
||||||
const AppHiddenLayoutStoragesRoute = AppHiddenLayoutStoragesRouteImport.update({
|
|
||||||
id: '/storages',
|
|
||||||
path: '/storages',
|
|
||||||
getParentRoute: () => AppHiddenLayoutRoute,
|
getParentRoute: () => AppHiddenLayoutRoute,
|
||||||
} as any)
|
} as any)
|
||||||
const AppHiddenLayoutInventoryRoute =
|
|
||||||
AppHiddenLayoutInventoryRouteImport.update({
|
|
||||||
id: '/inventory',
|
|
||||||
path: '/inventory',
|
|
||||||
getParentRoute: () => AppHiddenLayoutRoute,
|
|
||||||
} as any)
|
|
||||||
const AppHiddenLayoutAppSettingsRoute =
|
|
||||||
AppHiddenLayoutAppSettingsRouteImport.update({
|
|
||||||
id: '/app-settings',
|
|
||||||
path: '/app-settings',
|
|
||||||
getParentRoute: () => AppHiddenLayoutRoute,
|
|
||||||
} as any)
|
|
||||||
const AppHiddenLayoutAddProductRoute =
|
|
||||||
AppHiddenLayoutAddProductRouteImport.update({
|
|
||||||
id: '/add-product',
|
|
||||||
path: '/add-product',
|
|
||||||
getParentRoute: () => AppHiddenLayoutRoute,
|
|
||||||
} as any)
|
|
||||||
const AppHiddenLayoutQuickViewProductRoute =
|
const AppHiddenLayoutQuickViewProductRoute =
|
||||||
AppHiddenLayoutQuickViewProductRouteImport.update({
|
AppHiddenLayoutQuickViewProductRouteImport.update({
|
||||||
id: '/quick-view/product',
|
id: '/quick-view/product',
|
||||||
path: '/quick-view/product',
|
path: '/quick-view/product',
|
||||||
getParentRoute: () => AppHiddenLayoutRoute,
|
getParentRoute: () => AppHiddenLayoutRoute,
|
||||||
} as any)
|
} as any)
|
||||||
|
const AppHiddenLayoutAuthedViewProductRoute =
|
||||||
|
AppHiddenLayoutAuthedViewProductRouteImport.update({
|
||||||
|
id: '/view-product',
|
||||||
|
path: '/view-product',
|
||||||
|
getParentRoute: () => AppHiddenLayoutAuthedRoute,
|
||||||
|
} as any)
|
||||||
|
const AppHiddenLayoutAuthedStoragesRoute =
|
||||||
|
AppHiddenLayoutAuthedStoragesRouteImport.update({
|
||||||
|
id: '/storages',
|
||||||
|
path: '/storages',
|
||||||
|
getParentRoute: () => AppHiddenLayoutAuthedRoute,
|
||||||
|
} as any)
|
||||||
|
const AppHiddenLayoutAuthedInventoryRoute =
|
||||||
|
AppHiddenLayoutAuthedInventoryRouteImport.update({
|
||||||
|
id: '/inventory',
|
||||||
|
path: '/inventory',
|
||||||
|
getParentRoute: () => AppHiddenLayoutAuthedRoute,
|
||||||
|
} as any)
|
||||||
|
const AppHiddenLayoutAuthedAppSettingsRoute =
|
||||||
|
AppHiddenLayoutAuthedAppSettingsRouteImport.update({
|
||||||
|
id: '/app-settings',
|
||||||
|
path: '/app-settings',
|
||||||
|
getParentRoute: () => AppHiddenLayoutAuthedRoute,
|
||||||
|
} as any)
|
||||||
|
const AppHiddenLayoutAuthedAddProductRoute =
|
||||||
|
AppHiddenLayoutAuthedAddProductRouteImport.update({
|
||||||
|
id: '/add-product',
|
||||||
|
path: '/add-product',
|
||||||
|
getParentRoute: () => AppHiddenLayoutAuthedRoute,
|
||||||
|
} as any)
|
||||||
|
|
||||||
export interface FileRoutesByFullPath {
|
export interface FileRoutesByFullPath {
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'/login': typeof LoginRoute
|
'/login': typeof LoginRoute
|
||||||
'/app': typeof AppHiddenLayoutRouteWithChildren
|
'/app': typeof AppHiddenLayoutAuthedRouteWithChildren
|
||||||
'/app/add-product': typeof AppHiddenLayoutAddProductRoute
|
'/app/add-product': typeof AppHiddenLayoutAuthedAddProductRoute
|
||||||
'/app/app-settings': typeof AppHiddenLayoutAppSettingsRoute
|
'/app/app-settings': typeof AppHiddenLayoutAuthedAppSettingsRoute
|
||||||
'/app/inventory': typeof AppHiddenLayoutInventoryRoute
|
'/app/inventory': typeof AppHiddenLayoutAuthedInventoryRoute
|
||||||
'/app/storages': typeof AppHiddenLayoutStoragesRoute
|
'/app/storages': typeof AppHiddenLayoutAuthedStoragesRoute
|
||||||
'/app/view-product': typeof AppHiddenLayoutViewProductRoute
|
'/app/view-product': typeof AppHiddenLayoutAuthedViewProductRoute
|
||||||
'/app/quick-view/product': typeof AppHiddenLayoutQuickViewProductRoute
|
'/app/quick-view/product': typeof AppHiddenLayoutQuickViewProductRoute
|
||||||
}
|
}
|
||||||
export interface FileRoutesByTo {
|
export interface FileRoutesByTo {
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'/login': typeof LoginRoute
|
'/login': typeof LoginRoute
|
||||||
'/app': typeof AppHiddenLayoutRouteWithChildren
|
'/app': typeof AppHiddenLayoutAuthedRouteWithChildren
|
||||||
'/app/add-product': typeof AppHiddenLayoutAddProductRoute
|
'/app/add-product': typeof AppHiddenLayoutAuthedAddProductRoute
|
||||||
'/app/app-settings': typeof AppHiddenLayoutAppSettingsRoute
|
'/app/app-settings': typeof AppHiddenLayoutAuthedAppSettingsRoute
|
||||||
'/app/inventory': typeof AppHiddenLayoutInventoryRoute
|
'/app/inventory': typeof AppHiddenLayoutAuthedInventoryRoute
|
||||||
'/app/storages': typeof AppHiddenLayoutStoragesRoute
|
'/app/storages': typeof AppHiddenLayoutAuthedStoragesRoute
|
||||||
'/app/view-product': typeof AppHiddenLayoutViewProductRoute
|
'/app/view-product': typeof AppHiddenLayoutAuthedViewProductRoute
|
||||||
'/app/quick-view/product': typeof AppHiddenLayoutQuickViewProductRoute
|
'/app/quick-view/product': typeof AppHiddenLayoutQuickViewProductRoute
|
||||||
}
|
}
|
||||||
export interface FileRoutesById {
|
export interface FileRoutesById {
|
||||||
@@ -97,11 +103,12 @@ export interface FileRoutesById {
|
|||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
'/login': typeof LoginRoute
|
'/login': typeof LoginRoute
|
||||||
'/app/_hiddenLayout': typeof AppHiddenLayoutRouteWithChildren
|
'/app/_hiddenLayout': typeof AppHiddenLayoutRouteWithChildren
|
||||||
'/app/_hiddenLayout/add-product': typeof AppHiddenLayoutAddProductRoute
|
'/app/_hiddenLayout/_authed': typeof AppHiddenLayoutAuthedRouteWithChildren
|
||||||
'/app/_hiddenLayout/app-settings': typeof AppHiddenLayoutAppSettingsRoute
|
'/app/_hiddenLayout/_authed/add-product': typeof AppHiddenLayoutAuthedAddProductRoute
|
||||||
'/app/_hiddenLayout/inventory': typeof AppHiddenLayoutInventoryRoute
|
'/app/_hiddenLayout/_authed/app-settings': typeof AppHiddenLayoutAuthedAppSettingsRoute
|
||||||
'/app/_hiddenLayout/storages': typeof AppHiddenLayoutStoragesRoute
|
'/app/_hiddenLayout/_authed/inventory': typeof AppHiddenLayoutAuthedInventoryRoute
|
||||||
'/app/_hiddenLayout/view-product': typeof AppHiddenLayoutViewProductRoute
|
'/app/_hiddenLayout/_authed/storages': typeof AppHiddenLayoutAuthedStoragesRoute
|
||||||
|
'/app/_hiddenLayout/_authed/view-product': typeof AppHiddenLayoutAuthedViewProductRoute
|
||||||
'/app/_hiddenLayout/quick-view/product': typeof AppHiddenLayoutQuickViewProductRoute
|
'/app/_hiddenLayout/quick-view/product': typeof AppHiddenLayoutQuickViewProductRoute
|
||||||
}
|
}
|
||||||
export interface FileRouteTypes {
|
export interface FileRouteTypes {
|
||||||
@@ -132,11 +139,12 @@ export interface FileRouteTypes {
|
|||||||
| '/'
|
| '/'
|
||||||
| '/login'
|
| '/login'
|
||||||
| '/app/_hiddenLayout'
|
| '/app/_hiddenLayout'
|
||||||
| '/app/_hiddenLayout/add-product'
|
| '/app/_hiddenLayout/_authed'
|
||||||
| '/app/_hiddenLayout/app-settings'
|
| '/app/_hiddenLayout/_authed/add-product'
|
||||||
| '/app/_hiddenLayout/inventory'
|
| '/app/_hiddenLayout/_authed/app-settings'
|
||||||
| '/app/_hiddenLayout/storages'
|
| '/app/_hiddenLayout/_authed/inventory'
|
||||||
| '/app/_hiddenLayout/view-product'
|
| '/app/_hiddenLayout/_authed/storages'
|
||||||
|
| '/app/_hiddenLayout/_authed/view-product'
|
||||||
| '/app/_hiddenLayout/quick-view/product'
|
| '/app/_hiddenLayout/quick-view/product'
|
||||||
fileRoutesById: FileRoutesById
|
fileRoutesById: FileRoutesById
|
||||||
}
|
}
|
||||||
@@ -169,39 +177,11 @@ declare module '@tanstack/react-router' {
|
|||||||
preLoaderRoute: typeof AppHiddenLayoutRouteImport
|
preLoaderRoute: typeof AppHiddenLayoutRouteImport
|
||||||
parentRoute: typeof rootRouteImport
|
parentRoute: typeof rootRouteImport
|
||||||
}
|
}
|
||||||
'/app/_hiddenLayout/view-product': {
|
'/app/_hiddenLayout/_authed': {
|
||||||
id: '/app/_hiddenLayout/view-product'
|
id: '/app/_hiddenLayout/_authed'
|
||||||
path: '/view-product'
|
path: ''
|
||||||
fullPath: '/app/view-product'
|
fullPath: '/app'
|
||||||
preLoaderRoute: typeof AppHiddenLayoutViewProductRouteImport
|
preLoaderRoute: typeof AppHiddenLayoutAuthedRouteImport
|
||||||
parentRoute: typeof AppHiddenLayoutRoute
|
|
||||||
}
|
|
||||||
'/app/_hiddenLayout/storages': {
|
|
||||||
id: '/app/_hiddenLayout/storages'
|
|
||||||
path: '/storages'
|
|
||||||
fullPath: '/app/storages'
|
|
||||||
preLoaderRoute: typeof AppHiddenLayoutStoragesRouteImport
|
|
||||||
parentRoute: typeof AppHiddenLayoutRoute
|
|
||||||
}
|
|
||||||
'/app/_hiddenLayout/inventory': {
|
|
||||||
id: '/app/_hiddenLayout/inventory'
|
|
||||||
path: '/inventory'
|
|
||||||
fullPath: '/app/inventory'
|
|
||||||
preLoaderRoute: typeof AppHiddenLayoutInventoryRouteImport
|
|
||||||
parentRoute: typeof AppHiddenLayoutRoute
|
|
||||||
}
|
|
||||||
'/app/_hiddenLayout/app-settings': {
|
|
||||||
id: '/app/_hiddenLayout/app-settings'
|
|
||||||
path: '/app-settings'
|
|
||||||
fullPath: '/app/app-settings'
|
|
||||||
preLoaderRoute: typeof AppHiddenLayoutAppSettingsRouteImport
|
|
||||||
parentRoute: typeof AppHiddenLayoutRoute
|
|
||||||
}
|
|
||||||
'/app/_hiddenLayout/add-product': {
|
|
||||||
id: '/app/_hiddenLayout/add-product'
|
|
||||||
path: '/add-product'
|
|
||||||
fullPath: '/app/add-product'
|
|
||||||
preLoaderRoute: typeof AppHiddenLayoutAddProductRouteImport
|
|
||||||
parentRoute: typeof AppHiddenLayoutRoute
|
parentRoute: typeof AppHiddenLayoutRoute
|
||||||
}
|
}
|
||||||
'/app/_hiddenLayout/quick-view/product': {
|
'/app/_hiddenLayout/quick-view/product': {
|
||||||
@@ -211,24 +191,72 @@ declare module '@tanstack/react-router' {
|
|||||||
preLoaderRoute: typeof AppHiddenLayoutQuickViewProductRouteImport
|
preLoaderRoute: typeof AppHiddenLayoutQuickViewProductRouteImport
|
||||||
parentRoute: typeof AppHiddenLayoutRoute
|
parentRoute: typeof AppHiddenLayoutRoute
|
||||||
}
|
}
|
||||||
|
'/app/_hiddenLayout/_authed/view-product': {
|
||||||
|
id: '/app/_hiddenLayout/_authed/view-product'
|
||||||
|
path: '/view-product'
|
||||||
|
fullPath: '/app/view-product'
|
||||||
|
preLoaderRoute: typeof AppHiddenLayoutAuthedViewProductRouteImport
|
||||||
|
parentRoute: typeof AppHiddenLayoutAuthedRoute
|
||||||
|
}
|
||||||
|
'/app/_hiddenLayout/_authed/storages': {
|
||||||
|
id: '/app/_hiddenLayout/_authed/storages'
|
||||||
|
path: '/storages'
|
||||||
|
fullPath: '/app/storages'
|
||||||
|
preLoaderRoute: typeof AppHiddenLayoutAuthedStoragesRouteImport
|
||||||
|
parentRoute: typeof AppHiddenLayoutAuthedRoute
|
||||||
|
}
|
||||||
|
'/app/_hiddenLayout/_authed/inventory': {
|
||||||
|
id: '/app/_hiddenLayout/_authed/inventory'
|
||||||
|
path: '/inventory'
|
||||||
|
fullPath: '/app/inventory'
|
||||||
|
preLoaderRoute: typeof AppHiddenLayoutAuthedInventoryRouteImport
|
||||||
|
parentRoute: typeof AppHiddenLayoutAuthedRoute
|
||||||
|
}
|
||||||
|
'/app/_hiddenLayout/_authed/app-settings': {
|
||||||
|
id: '/app/_hiddenLayout/_authed/app-settings'
|
||||||
|
path: '/app-settings'
|
||||||
|
fullPath: '/app/app-settings'
|
||||||
|
preLoaderRoute: typeof AppHiddenLayoutAuthedAppSettingsRouteImport
|
||||||
|
parentRoute: typeof AppHiddenLayoutAuthedRoute
|
||||||
|
}
|
||||||
|
'/app/_hiddenLayout/_authed/add-product': {
|
||||||
|
id: '/app/_hiddenLayout/_authed/add-product'
|
||||||
|
path: '/add-product'
|
||||||
|
fullPath: '/app/add-product'
|
||||||
|
preLoaderRoute: typeof AppHiddenLayoutAuthedAddProductRouteImport
|
||||||
|
parentRoute: typeof AppHiddenLayoutAuthedRoute
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface AppHiddenLayoutAuthedRouteChildren {
|
||||||
|
AppHiddenLayoutAuthedAddProductRoute: typeof AppHiddenLayoutAuthedAddProductRoute
|
||||||
|
AppHiddenLayoutAuthedAppSettingsRoute: typeof AppHiddenLayoutAuthedAppSettingsRoute
|
||||||
|
AppHiddenLayoutAuthedInventoryRoute: typeof AppHiddenLayoutAuthedInventoryRoute
|
||||||
|
AppHiddenLayoutAuthedStoragesRoute: typeof AppHiddenLayoutAuthedStoragesRoute
|
||||||
|
AppHiddenLayoutAuthedViewProductRoute: typeof AppHiddenLayoutAuthedViewProductRoute
|
||||||
|
}
|
||||||
|
|
||||||
|
const AppHiddenLayoutAuthedRouteChildren: AppHiddenLayoutAuthedRouteChildren = {
|
||||||
|
AppHiddenLayoutAuthedAddProductRoute: AppHiddenLayoutAuthedAddProductRoute,
|
||||||
|
AppHiddenLayoutAuthedAppSettingsRoute: AppHiddenLayoutAuthedAppSettingsRoute,
|
||||||
|
AppHiddenLayoutAuthedInventoryRoute: AppHiddenLayoutAuthedInventoryRoute,
|
||||||
|
AppHiddenLayoutAuthedStoragesRoute: AppHiddenLayoutAuthedStoragesRoute,
|
||||||
|
AppHiddenLayoutAuthedViewProductRoute: AppHiddenLayoutAuthedViewProductRoute,
|
||||||
|
}
|
||||||
|
|
||||||
|
const AppHiddenLayoutAuthedRouteWithChildren =
|
||||||
|
AppHiddenLayoutAuthedRoute._addFileChildren(
|
||||||
|
AppHiddenLayoutAuthedRouteChildren,
|
||||||
|
)
|
||||||
|
|
||||||
interface AppHiddenLayoutRouteChildren {
|
interface AppHiddenLayoutRouteChildren {
|
||||||
AppHiddenLayoutAddProductRoute: typeof AppHiddenLayoutAddProductRoute
|
AppHiddenLayoutAuthedRoute: typeof AppHiddenLayoutAuthedRouteWithChildren
|
||||||
AppHiddenLayoutAppSettingsRoute: typeof AppHiddenLayoutAppSettingsRoute
|
|
||||||
AppHiddenLayoutInventoryRoute: typeof AppHiddenLayoutInventoryRoute
|
|
||||||
AppHiddenLayoutStoragesRoute: typeof AppHiddenLayoutStoragesRoute
|
|
||||||
AppHiddenLayoutViewProductRoute: typeof AppHiddenLayoutViewProductRoute
|
|
||||||
AppHiddenLayoutQuickViewProductRoute: typeof AppHiddenLayoutQuickViewProductRoute
|
AppHiddenLayoutQuickViewProductRoute: typeof AppHiddenLayoutQuickViewProductRoute
|
||||||
}
|
}
|
||||||
|
|
||||||
const AppHiddenLayoutRouteChildren: AppHiddenLayoutRouteChildren = {
|
const AppHiddenLayoutRouteChildren: AppHiddenLayoutRouteChildren = {
|
||||||
AppHiddenLayoutAddProductRoute: AppHiddenLayoutAddProductRoute,
|
AppHiddenLayoutAuthedRoute: AppHiddenLayoutAuthedRouteWithChildren,
|
||||||
AppHiddenLayoutAppSettingsRoute: AppHiddenLayoutAppSettingsRoute,
|
|
||||||
AppHiddenLayoutInventoryRoute: AppHiddenLayoutInventoryRoute,
|
|
||||||
AppHiddenLayoutStoragesRoute: AppHiddenLayoutStoragesRoute,
|
|
||||||
AppHiddenLayoutViewProductRoute: AppHiddenLayoutViewProductRoute,
|
|
||||||
AppHiddenLayoutQuickViewProductRoute: AppHiddenLayoutQuickViewProductRoute,
|
AppHiddenLayoutQuickViewProductRoute: AppHiddenLayoutQuickViewProductRoute,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { createFileRoute, Outlet } from "@tanstack/react-router";
|
||||||
|
import { verifyLogin } from "../../../utils/api/auth";
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/app/_hiddenLayout/_authed")({
|
||||||
|
beforeLoad: async () => {
|
||||||
|
await verifyLogin();
|
||||||
|
},
|
||||||
|
component: () => <Outlet />,
|
||||||
|
});
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
import { AddProduct } from "../../../../pages/AddProduct";
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/app/_hiddenLayout/_authed/add-product")({
|
||||||
|
component: RouteComponent,
|
||||||
|
});
|
||||||
|
|
||||||
|
function RouteComponent() {
|
||||||
|
return <AddProduct />;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
import { Settings } from "../../../../pages/Settings";
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/app/_hiddenLayout/_authed/app-settings")(
|
||||||
|
{
|
||||||
|
component: RouteComponent,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
function RouteComponent() {
|
||||||
|
return <Settings />;
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
import { InventoryPage } from "../../../../pages/Inventory";
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/app/_hiddenLayout/_authed/inventory")({
|
||||||
|
component: RouteComponent,
|
||||||
|
});
|
||||||
|
|
||||||
|
function RouteComponent() {
|
||||||
|
return <InventoryPage />;
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
import { Storages } from "../../../../pages/Storages";
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/app/_hiddenLayout/_authed/storages")({
|
||||||
|
component: RouteComponent,
|
||||||
|
});
|
||||||
|
|
||||||
|
function RouteComponent() {
|
||||||
|
return <Storages />;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
import { z } from "zod";
|
||||||
|
import { ViewProduct } from "../../../../pages/ViewProduct";
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/app/_hiddenLayout/_authed/view-product")(
|
||||||
|
{
|
||||||
|
validateSearch: z.object({
|
||||||
|
product: z.string(),
|
||||||
|
}),
|
||||||
|
component: RouteComponent,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
function RouteComponent() {
|
||||||
|
const { product } = Route.useSearch();
|
||||||
|
return <ViewProduct uuid={product} />;
|
||||||
|
}
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { createFileRoute } from "@tanstack/react-router";
|
|
||||||
import { verifyLogin } from "../../../utils/api/auth";
|
|
||||||
import { AddProduct } from "../../../pages/AddProduct";
|
|
||||||
|
|
||||||
export const Route = createFileRoute("/app/_hiddenLayout/add-product")({
|
|
||||||
beforeLoad: async () => {
|
|
||||||
await verifyLogin();
|
|
||||||
},
|
|
||||||
component: RouteComponent,
|
|
||||||
});
|
|
||||||
|
|
||||||
function RouteComponent() {
|
|
||||||
return <AddProduct />;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { createFileRoute } from "@tanstack/react-router";
|
|
||||||
import { verifyLogin } from "../../../utils/api/auth";
|
|
||||||
import { Settings } from "../../../pages/Settings";
|
|
||||||
|
|
||||||
export const Route = createFileRoute("/app/_hiddenLayout/app-settings")({
|
|
||||||
beforeLoad: async () => {
|
|
||||||
await verifyLogin();
|
|
||||||
},
|
|
||||||
component: RouteComponent,
|
|
||||||
});
|
|
||||||
|
|
||||||
function RouteComponent() {
|
|
||||||
return <Settings />;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { createFileRoute } from "@tanstack/react-router";
|
|
||||||
import { verifyLogin } from "../../../utils/api/auth";
|
|
||||||
import { InventoryPage } from "../../../pages/Inventory";
|
|
||||||
|
|
||||||
export const Route = createFileRoute("/app/_hiddenLayout/inventory")({
|
|
||||||
beforeLoad: async () => {
|
|
||||||
await verifyLogin();
|
|
||||||
},
|
|
||||||
component: RouteComponent,
|
|
||||||
});
|
|
||||||
|
|
||||||
function RouteComponent() {
|
|
||||||
return <InventoryPage />;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { createFileRoute } from "@tanstack/react-router";
|
|
||||||
import { verifyLogin } from "../../../utils/api/auth";
|
|
||||||
import { Storages } from "../../../pages/Storages";
|
|
||||||
|
|
||||||
export const Route = createFileRoute("/app/_hiddenLayout/storages")({
|
|
||||||
beforeLoad: async () => {
|
|
||||||
await verifyLogin();
|
|
||||||
},
|
|
||||||
component: RouteComponent,
|
|
||||||
});
|
|
||||||
|
|
||||||
function RouteComponent() {
|
|
||||||
return <Storages />;
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { createFileRoute } from "@tanstack/react-router";
|
|
||||||
import { z } from "zod";
|
|
||||||
import { verifyLogin } from "../../../utils/api/auth";
|
|
||||||
import { ViewProduct } from "../../../pages/ViewProduct";
|
|
||||||
|
|
||||||
export const Route = createFileRoute("/app/_hiddenLayout/view-product")({
|
|
||||||
beforeLoad: async () => {
|
|
||||||
await verifyLogin();
|
|
||||||
},
|
|
||||||
validateSearch: z.object({
|
|
||||||
product: z.string(),
|
|
||||||
}),
|
|
||||||
component: RouteComponent,
|
|
||||||
});
|
|
||||||
|
|
||||||
function RouteComponent() {
|
|
||||||
const { product } = Route.useSearch();
|
|
||||||
return <ViewProduct uuid={product} />;
|
|
||||||
}
|
|
||||||
Generated
-13
@@ -6331,19 +6331,6 @@
|
|||||||
"integrity": "sha512-kZFnouyVv7eP/Phmrlo9FK+zcAdriZJvzxXHF1Sl1P377WSGe2G/JxVolhTrB/jeV47lKImhNUsijjHAAbcl/A==",
|
"integrity": "sha512-kZFnouyVv7eP/Phmrlo9FK+zcAdriZJvzxXHF1Sl1P377WSGe2G/JxVolhTrB/jeV47lKImhNUsijjHAAbcl/A==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/react-toastify": {
|
|
||||||
"version": "11.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-11.1.0.tgz",
|
|
||||||
"integrity": "sha512-e9h23x3phN0wbFeB6yovmWp7lobzV4CaCH0LO8nVP6H7Y+3GbcLpIzMm9dJhcp1RXbpyfvjgpfXqO80QAmn7sg==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"clsx": "^2.1.1"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"react": "^18 || ^19",
|
|
||||||
"react-dom": "^18 || ^19"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/react-transition-group": {
|
"node_modules/react-transition-group": {
|
||||||
"version": "4.4.5",
|
"version": "4.4.5",
|
||||||
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
|
||||||
|
|||||||
Reference in New Issue
Block a user