Polished code and fixed warnings

This commit is contained in:
keannu125 2023-05-16 12:16:35 +08:00
parent f5a9b2e4cd
commit 87b5833de6
5 changed files with 5 additions and 16 deletions

View file

@ -1,18 +1,10 @@
import React, { useEffect } from "react"; import React from "react";
import Dashboard from "./Routes/Dashboard/Dashboard"; import Dashboard from "./Routes/Dashboard/Dashboard";
import Error from "./Routes/Error/Error"; import Error from "./Routes/Error/Error";
import Products from "./Routes/Products/Products"; import Products from "./Routes/Products/Products";
import Logs from "./Routes/Logs/Logs"; import Logs from "./Routes/Logs/Logs";
import Container from "./Components/Container/Container"; import Container from "./Components/Container/Container";
import { import { createHashRouter, RouterProvider } from "react-router-dom";
createBrowserRouter,
createHashRouter,
HashRouter,
Navigate,
Route,
RouterProvider,
Routes,
} from "react-router-dom";
import Store from "./Plugins/Redux/Store/Store"; import Store from "./Plugins/Redux/Store/Store";
import { Provider } from "react-redux"; import { Provider } from "react-redux";
import Inventory from "./Routes/Inventory/Inventory"; import Inventory from "./Routes/Inventory/Inventory";

View file

@ -2,7 +2,6 @@ import * as React from "react";
import { ProductLog, ProductLogList } from "../../../Interfaces/Interfaces"; import { ProductLog, ProductLogList } from "../../../Interfaces/Interfaces";
import styles from "../../../styles"; import styles from "../../../styles";
import LogsIcon from "../../Icons/LogsIcon/LogsIcon"; import LogsIcon from "../../Icons/LogsIcon/LogsIcon";
import Moment from "react-moment";
export default function RecentTransactionsWidget(props: ProductLogList) { export default function RecentTransactionsWidget(props: ProductLogList) {
return ( return (

View file

@ -1,7 +1,7 @@
import * as React from "react"; import * as React from "react";
import styles from "../../../styles"; import styles from "../../../styles";
import TotalProductsIcon from "../../Icons/TotalProductsIcon/TotalProductsIcon"; import TotalProductsIcon from "../../Icons/TotalProductsIcon/TotalProductsIcon";
import { Product, ProductList } from "../../../Interfaces/Interfaces"; import { ProductList } from "../../../Interfaces/Interfaces";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
export interface props {} export interface props {}
@ -16,7 +16,7 @@ export default function TotalProductsWidget(props: ProductList) {
} else { } else {
setItems(props.Products.length + " Unique Items"); setItems(props.Products.length + " Unique Items");
} }
}, []); }, [props.Products.length]);
return ( return (
<div <div
style={{ style={{

View file

@ -44,7 +44,7 @@ export default function StockRenderer(product: Product) {
} else if (stock === product.quantity) { } else if (stock === product.quantity) {
setValueChanged(false); setValueChanged(false);
} }
}, [stock]); }, [stock, product.quantity]);
let style; let style;
if (stock >= 0 && stock <= 3) { if (stock >= 0 && stock <= 3) {
style = styles.text_red; style = styles.text_red;

View file

@ -1,9 +1,7 @@
import * as React from "react"; import * as React from "react";
import styles from "../../../styles"; import styles from "../../../styles";
import { ProductList } from "../../../Interfaces/Interfaces"; import { ProductList } from "../../../Interfaces/Interfaces";
import ProductIcon from "../../Icons/ProductIcon/ProductIcon"; import ProductIcon from "../../Icons/ProductIcon/ProductIcon";
import { Button } from "@mui/material";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
export default function BlobView({ Products }: ProductList) { export default function BlobView({ Products }: ProductList) {