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

View File

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

View File

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

View File

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