added and fixed minor details
This commit is contained in:
@@ -74,7 +74,7 @@ export const Sidebar = () => {
|
||||
Cookies.remove("token");
|
||||
navigate({ to: "/login" });
|
||||
}}
|
||||
variant={variant("/login")}
|
||||
color="danger"
|
||||
startDecorator={<ExitToAppIcon />}
|
||||
className={btnClass}
|
||||
>
|
||||
|
||||
@@ -280,7 +280,7 @@ export const InventoryPage = () => {
|
||||
description: product?.description ?? "",
|
||||
imageUrl: product?.picture ?? undefined,
|
||||
price: product?.price ?? "-",
|
||||
stock: `${product?.amount ?? 0} Stk.`,
|
||||
stock: `${product?.amount ?? 0} ${t("pcs")}`,
|
||||
location: product?.storage_location_name ?? "-",
|
||||
locationDetail: "",
|
||||
expiryDate: formatDate(product?.expiry_date),
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
import { isAuthenticated } from "../utils/auth";
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute('/')({
|
||||
export const Route = createFileRoute("/")({
|
||||
beforeLoad: async () => {
|
||||
if (!(await isAuthenticated())) {
|
||||
throw redirect({
|
||||
to: "/login",
|
||||
});
|
||||
} else {
|
||||
throw redirect({
|
||||
to: "/app/inventory",
|
||||
});
|
||||
}
|
||||
},
|
||||
component: RouteComponent,
|
||||
})
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return <div>Index "/"!</div>
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"username": "Benutzername",
|
||||
"password": "Passwort",
|
||||
"eu001": "Falscher Benutzername oder Passwort!",
|
||||
"login": "Login"
|
||||
"login": "Login",
|
||||
"pcs": "Stk."
|
||||
}
|
||||
@@ -40,5 +40,6 @@
|
||||
"settings-sub": "Manage your app preferences and store defaults.",
|
||||
"preferences": "Preferences",
|
||||
"selected": "selected",
|
||||
"logout": "Logout"
|
||||
"logout": "Logout",
|
||||
"pcs": "pcs."
|
||||
}
|
||||
Reference in New Issue
Block a user