mirror of
https://github.com/lemeow125/Ivy-Frontend.git
synced 2025-05-14 18:41:06 +08:00
Shortened code for amount change color in Logs.tsx and polished some other stuff
This commit is contained in:
parent
2a12356820
commit
b62a160f88
3 changed files with 69 additions and 33 deletions
|
@ -3,21 +3,12 @@ import styles from "../../styles";
|
|||
import { useNavigate } from "react-router-dom";
|
||||
import ProductsIcon from "../../Components/Icons/ProductsIcon/ProductsIcon";
|
||||
import AddIcon from "../../Components/Icons/AddIcon/AddIcon";
|
||||
import { Button, Switch } from "@mui/material";
|
||||
import { Button } from "@mui/material";
|
||||
import { SampleProducts } from "../../Components/SampleData/SampleData";
|
||||
import TableView from "../../Components/ProductsPage/TableView/TableView";
|
||||
import BlobView from "../../Components/ProductsPage/BlobView/BlobView";
|
||||
import ViewManager from "../../Components/ProductsPage/ViewManager";
|
||||
|
||||
export default function Products() {
|
||||
const navigate = useNavigate();
|
||||
const [tableView, toggleTableView] = useState(false);
|
||||
function view() {
|
||||
if (tableView) {
|
||||
return <TableView Products={SampleProducts} />;
|
||||
} else {
|
||||
return <BlobView Products={SampleProducts} />;
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div style={{ margin: 32, height: "100%" }}>
|
||||
<div style={styles.content_row}>
|
||||
|
@ -31,10 +22,9 @@ export default function Products() {
|
|||
<div
|
||||
style={{
|
||||
...styles.content_row,
|
||||
...{ flex: 1, justifyContent: "flex-end" },
|
||||
...{ justifyContent: "flex-end", flex: 1 },
|
||||
}}
|
||||
>
|
||||
<Switch onClick={() => toggleTableView(!tableView)} />
|
||||
<Button
|
||||
onClick={() => navigate("/Products/AddProduct")}
|
||||
style={styles.button_add_product}
|
||||
|
@ -47,8 +37,7 @@ export default function Products() {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{view()}
|
||||
<ViewManager Products={SampleProducts} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue