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 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,
createHashRouter,
HashRouter,
Navigate,
Route,
RouterProvider,
Routes,
} from "react-router-dom";
import { createHashRouter, RouterProvider } from "react-router-dom";
import Store from "./Plugins/Redux/Store/Store";
import { Provider } from "react-redux";
import Inventory from "./Routes/Inventory/Inventory";

View file

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

View file

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

View file

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

View file

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