refactor: update heading sizes in ItemTable, LoanTable, and UserTable components

This commit is contained in:
2025-10-26 13:54:43 +01:00
parent 71fea52da7
commit 9daff3ea5c
4 changed files with 9 additions and 21 deletions

View File

@@ -3,7 +3,6 @@ import { useEffect } from "react";
import Dashboard from "./Dashboard";
import Login from "./Login";
import Cookies from "js-cookie";
import Landingpage from "@/components/API/Landingpage";
const API_BASE =
(import.meta as any).env?.VITE_BACKEND_URL ||
@@ -12,16 +11,8 @@ const API_BASE =
const Layout: React.FC = () => {
const [isLoggedIn, setIsLoggedIn] = useState(false);
const [showAPI, setShowAPI] = useState(false);
useEffect(() => {
const path = window.location.pathname.replace(/\/+$/, ""); // remove trailing slash
if (path === "/api") {
setShowAPI(true);
console.log("signal");
return;
}
if (Cookies.get("token")) {
const verifyToken = async () => {
const response = await fetch(`${API_BASE}/api/verifyToken`, {
@@ -48,14 +39,6 @@ const Layout: React.FC = () => {
setIsLoggedIn(false);
};
if (showAPI) {
return (
<main>
<Landingpage />
</main>
);
}
return (
<main>
{isLoggedIn ? (

View File

@@ -149,7 +149,7 @@ const ItemTable: React.FC = () => {
</HStack>
{/* End action toolbar */}
<Heading marginBottom={4} size="md">
<Heading marginBottom={4} size="2xl">
Gegenstände
</Heading>
{isError && (

View File

@@ -54,6 +54,7 @@ const LoanTable: React.FC = () => {
returned_date: string;
created_at: string;
loaned_items_name: string[];
deleted: boolean;
};
useEffect(() => {
@@ -108,9 +109,13 @@ const LoanTable: React.FC = () => {
</HStack>
{/* End action toolbar */}
<Heading marginBottom={4} size="md">
<Heading marginBottom={4} size="2xl">
Ausleihen
</Heading>
<Text>
Die Ausleihen die rot sind, wurden gelöscht und sind nur für den Admin
sichtbar.
</Text>
{isError && (
<MyAlert
@@ -163,7 +168,7 @@ const LoanTable: React.FC = () => {
</Table.Header>
<Table.Body>
{items.map((item) => (
<Table.Row key={item.id}>
<Table.Row color={item.deleted ? "red" : "white"} key={item.id}>
<Table.Cell>{item.id}</Table.Cell>
<Table.Cell>{item.username}</Table.Cell>
<Table.Cell>

View File

@@ -144,7 +144,7 @@ const UserTable: React.FC = () => {
</HStack>
{/* End action toolbar */}
<Heading marginBottom={4} size="md">
<Heading marginBottom={4} size="2xl">
Benutzer
</Heading>
{changePWform && (