diff --git a/src/App.tsx b/src/App.tsx index 1e70851..efe8b76 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,6 +2,7 @@ import React from "react"; import Dashboard from "./Routes/Dashboard/Dashboard"; import Error from "./Routes/Error/Error"; import Products from "./Routes/Products/Products"; +import Logs from "./Routes/Logs/Logs"; import Container from "./Components/Container/Container"; import { createBrowserRouter, RouterProvider } from "react-router-dom"; import Store from "./Plugins/Redux/Store/Store"; @@ -29,6 +30,14 @@ const router = createBrowserRouter([ ), }, + { + path: "/Logs", + element: ( + + + + ), + }, ]); export default function App() { diff --git a/src/Routes/Logs/Logs.tsx b/src/Routes/Logs/Logs.tsx new file mode 100644 index 0000000..72df12a --- /dev/null +++ b/src/Routes/Logs/Logs.tsx @@ -0,0 +1,78 @@ +import * as React from "react"; +import LogsIcon from "../../Components/Icons/LogsIcon/LogsIcon"; +import styles from "../../styles"; +import { + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, +} from "@mui/material"; + +function createData( + id: number, + p_id: number, + p_name: string, + amount_changed: number, + timestamp: string +) { + return { id, p_id, p_name, amount_changed, timestamp }; +} + +const sample_data = [ + createData(1, 1, "Zidanes Water", -5, "2/24/2023 10:05AM"), + createData(2, 1, "Zidanes Water", +10, "2/24/2023 1:05PM"), + createData(3, 2, "Dans Beefed Corn", +25, "2/25/2023 4:05PM"), + createData(4, 2, "Dans Beefed Corn", -15, "2/26/2023 3:35PM"), +]; + +export default function Logs() { + function change_color(amount: number) { + if (amount > 0) { + return {amount}; + } else { + return {amount}; + } + } + return ( +
+
+ +

Logs

+
+ + + + + Log ID + Product ID + Product + Amount Change + Timestamp + + + + {sample_data.map((row) => ( + + {row.id} + {row.p_id} + {row.p_name} + {change_color(row.amount_changed)} + {row.timestamp} + + ))} + +
+
+
+ ); +} diff --git a/src/styles.tsx b/src/styles.tsx index f266346..2702ab8 100644 --- a/src/styles.tsx +++ b/src/styles.tsx @@ -37,6 +37,16 @@ const styles: { [key: string]: React.CSSProperties } = { color: "white", fontWeight: "bold", }, + text_red: { + fontSize: "1.3vw", + color: "#a44141", + fontWeight: "bold", + }, + text_green: { + fontSize: "1.3vw", + color: "#80b28a", + fontWeight: "bold", + }, logo_title: { color: "#80b38b", fontSize: 26, @@ -129,7 +139,7 @@ const styles: { [key: string]: React.CSSProperties } = { flex_row: { display: "flex", flexDirection: "row", - alignItems: "stretch", + alignItems: "center", }, flex_column: { display: "flex",