diff --git a/src/bin/BinYards.tsx b/src/bin/BinYards.tsx index d7bf076..fed79eb 100644 --- a/src/bin/BinYards.tsx +++ b/src/bin/BinYards.tsx @@ -14,7 +14,6 @@ import { Menu, MenuItem, Tab, - Tabs, TextField, Theme, Tooltip, @@ -25,11 +24,9 @@ import { pond } from "protobuf-ts/pond"; import { useBinYardAPI, useSnackbar, - //useUserAPI, usePermissionAPI, useBinAPI, useGlobalState - //useTeamAPI } from "providers"; import React, { useEffect, useState } from "react"; import AddIcon from "@mui/icons-material/LibraryAdd"; @@ -44,7 +41,6 @@ import EditIcon from "@mui/icons-material/Edit"; import ShareIcon from "@mui/icons-material/Share"; import { red, blue, green } from "@mui/material/colors"; import { openSnackbar } from "providers/Snackbar"; -// import { Status } from "@sentry/react"; import { binScope, binYardScope } from "models/Scope"; import ShareObject from "user/ShareObject"; import { Bin, Team, User } from "models"; @@ -116,11 +112,6 @@ const useStyles = makeStyles((theme: Theme) => { }, tab: { ...parentTab, - // width: theme.spacing(20), - // minWidth: theme.spacing(20), - // left: 0, - // height: "100%", - // background: theme.palette.background.paper }, smallTab: { ...parentTab, @@ -174,7 +165,6 @@ const useStyles = makeStyles((theme: Theme) => { interface Props { setYardFilter: React.Dispatch>; - loadBins: () => void; loadYards: (search?: string, limit?: number, offset?: number) => void; yardsLoading: boolean; @@ -191,8 +181,6 @@ export default function BinYard(props: Props) { const { setYardFilter, loadBins, loadYards, /*gainBags,*/ setShowing, yardsLoading } = props; const binYardAPI = useBinYardAPI(); const binAPI = useBinAPI(); - // const userAPI = useUserAPI(); - // const teamAPI = useTeamAPI(); const [tab, setTab] = useState(props.tab ? props.tab : 1); const [showAddYard, setShowAddYard] = useState(false); const [addYardName, setAddYardName] = useState(""); diff --git a/src/pages/Bins.tsx b/src/pages/Bins.tsx index 7917111..c23b390 100644 --- a/src/pages/Bins.tsx +++ b/src/pages/Bins.tsx @@ -14,8 +14,6 @@ import { FormControl, FormControlLabel, Grid2 as Grid, - // GridList, - // GridListTile, IconButton, ImageList, ImageListItem, @@ -1403,5 +1401,5 @@ export default function Bins(props: Props) { ); }; - return !props.insert ? {page()} : page(); + return !props.insert ? {page()} : page(); } diff --git a/src/pages/Mines.tsx b/src/pages/Mines.tsx index 134329c..22b508a 100644 --- a/src/pages/Mines.tsx +++ b/src/pages/Mines.tsx @@ -1,8 +1,6 @@ -import classNames from "classnames"; import { useCallback, useEffect, useState } from "react"; import PageContainer from "./PageContainer"; import { - Theme, Tooltip, Chip, Typography, @@ -10,59 +8,12 @@ import { } from "@mui/material"; import { pond } from "protobuf-ts/pond"; import { useMineAPI } from "hooks"; -// import { useHistory } from "react-router"; import AddMine from "ventilation/AddMine"; -import { Add } from "@mui/icons-material"; -import { makeStyles, withStyles } from "@mui/styles"; +import { LibraryAdd } from "@mui/icons-material"; import ResponsiveTable, { Column } from "common/ResponsiveTable"; import { useNavigate } from "react-router-dom"; import { or } from "utils"; -const useStyles = makeStyles((theme: Theme) => { - return ({ - gutter: { - paddingLeft: theme.spacing(1), - paddingRight: theme.spacing(1), - [theme.breakpoints.up("sm")]: { - paddingLeft: theme.spacing(2), - paddingRight: theme.spacing(2) - }, - [theme.breakpoints.up("md")]: { - paddingLeft: theme.spacing(3), - paddingRight: theme.spacing(3) - } - }, - actionToolbar: { - paddingLeft: 0, - paddingRight: theme.spacing(1), - [theme.breakpoints.up("sm")]: { - paddingRight: theme.spacing(2) - } - }, - densePaddingY: { - paddingTop: theme.spacing(1), - paddingBottom: theme.spacing(1) - }, - mobileContent: { - maxWidth: "100%", - margin: 0, - padding: `${theme.spacing(1)}px ${theme.spacing(1)}px` - }, - tableContainer: { - marginTop: theme.spacing(1), - marginBottom: theme.spacing(1), - [theme.breakpoints.up("sm")]: { - marginTop: theme.spacing(2), - marginBottom: theme.spacing(2) - }, - [theme.breakpoints.up("md")]: { - marginTop: theme.spacing(3), - marginBottom: theme.spacing(3) - } - } - }) -}); - interface MineRow { mine: pond.Mine; } @@ -84,7 +35,6 @@ const mineColumns: Column[] = [ ]; export default function Mines() { - const classes = useStyles(); const mineAPI = useMineAPI(); const navigate = useNavigate(); const [isLoading, setIsLoading] = useState(false); @@ -95,24 +45,6 @@ export default function Mines() { const [mineDialog, setMineDialog] = useState(false); const [searchValue, setSearchValue] = useState(""); - const ColorAdd = withStyles((theme: Theme) => ({ - root: { - color: theme.palette.getContrastText(theme.palette.primary.main), - backgroundColor: theme.palette.primary.main, - marginTop: "auto", - marginBottom: "auto", - borderRadius: "4px", - "&:hover": { - backgroundColor: theme.palette.primary.light, - cursor: "pointer" - }, - "&:disabled": { - backgroundColor: "rgba(0,0,0,0)", - color: theme.palette.getContrastText(theme.palette.primary.main) - } - } - }))(Add); - const load = useCallback(() => { setIsLoading(true); mineAPI @@ -148,7 +80,7 @@ export default function Mines() { Mines - setMineDialog(true)} /> + setMineDialog(true)} /> ) } @@ -157,8 +89,12 @@ export default function Mines() { navigate(or(data.mine.settings?.key, "")) } - const minesTable = () => { - return ( + const closeCallback = () => { + setMineDialog(false); + }; + + return ( + title={renderTitle} rows={mineTableData} @@ -173,20 +109,6 @@ export default function Mines() { isLoading={isLoading} onRowClick={onRowClick} /> - ) - } - - const tableContent = () => { - return
{minesTable()}
; - }; - - const closeCallback = () => { - setMineDialog(false); - }; - - return ( - - {tableContent()} ); diff --git a/src/pages/VentEditor.tsx b/src/pages/VentEditor.tsx index bcb8622..8e46944 100644 --- a/src/pages/VentEditor.tsx +++ b/src/pages/VentEditor.tsx @@ -140,7 +140,8 @@ export default function Ventilation() { }, [mineKey, mineAPI]); return ( - + // TODO: why does padding have to be -2 to fit the page? +