mirror of
https://github.com/lemeow125/Ivy-Frontend.git
synced 2025-05-12 09:31:07 +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
27
src/Components/ProductsPage/ViewManager.tsx
Normal file
27
src/Components/ProductsPage/ViewManager.tsx
Normal file
|
@ -0,0 +1,27 @@
|
|||
import * as React from "react";
|
||||
import { useState } from "react";
|
||||
import { Switch } from "@mui/material";
|
||||
import TableView from "../../Components/ProductsPage/TableView/TableView";
|
||||
import BlobView from "../../Components/ProductsPage/BlobView/BlobView";
|
||||
import { ProductList } from "../../Interfaces/Interfaces";
|
||||
|
||||
export interface props {}
|
||||
|
||||
export default function ViewManager(props: ProductList) {
|
||||
const [tableView, toggleTableView] = useState(false);
|
||||
if (tableView) {
|
||||
return (
|
||||
<div>
|
||||
<Switch onClick={() => toggleTableView(!tableView)} />
|
||||
<TableView Products={props.Products} />
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<div>
|
||||
<Switch onClick={() => toggleTableView(!tableView)} />
|
||||
<BlobView Products={props.Products} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue