just some styling
This commit is contained in:
parent
ebf889fa7c
commit
7da3e3c42f
4 changed files with 11 additions and 102 deletions
|
|
@ -14,7 +14,6 @@ import {
|
||||||
Menu,
|
Menu,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
Tab,
|
Tab,
|
||||||
Tabs,
|
|
||||||
TextField,
|
TextField,
|
||||||
Theme,
|
Theme,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
|
@ -25,11 +24,9 @@ import { pond } from "protobuf-ts/pond";
|
||||||
import {
|
import {
|
||||||
useBinYardAPI,
|
useBinYardAPI,
|
||||||
useSnackbar,
|
useSnackbar,
|
||||||
//useUserAPI,
|
|
||||||
usePermissionAPI,
|
usePermissionAPI,
|
||||||
useBinAPI,
|
useBinAPI,
|
||||||
useGlobalState
|
useGlobalState
|
||||||
//useTeamAPI
|
|
||||||
} from "providers";
|
} from "providers";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import AddIcon from "@mui/icons-material/LibraryAdd";
|
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 ShareIcon from "@mui/icons-material/Share";
|
||||||
import { red, blue, green } from "@mui/material/colors";
|
import { red, blue, green } from "@mui/material/colors";
|
||||||
import { openSnackbar } from "providers/Snackbar";
|
import { openSnackbar } from "providers/Snackbar";
|
||||||
// import { Status } from "@sentry/react";
|
|
||||||
import { binScope, binYardScope } from "models/Scope";
|
import { binScope, binYardScope } from "models/Scope";
|
||||||
import ShareObject from "user/ShareObject";
|
import ShareObject from "user/ShareObject";
|
||||||
import { Bin, Team, User } from "models";
|
import { Bin, Team, User } from "models";
|
||||||
|
|
@ -116,11 +112,6 @@ const useStyles = makeStyles((theme: Theme) => {
|
||||||
},
|
},
|
||||||
tab: {
|
tab: {
|
||||||
...parentTab,
|
...parentTab,
|
||||||
// width: theme.spacing(20),
|
|
||||||
// minWidth: theme.spacing(20),
|
|
||||||
// left: 0,
|
|
||||||
// height: "100%",
|
|
||||||
// background: theme.palette.background.paper
|
|
||||||
},
|
},
|
||||||
smallTab: {
|
smallTab: {
|
||||||
...parentTab,
|
...parentTab,
|
||||||
|
|
@ -174,7 +165,6 @@ const useStyles = makeStyles((theme: Theme) => {
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
setYardFilter: React.Dispatch<React.SetStateAction<string>>;
|
setYardFilter: React.Dispatch<React.SetStateAction<string>>;
|
||||||
|
|
||||||
loadBins: () => void;
|
loadBins: () => void;
|
||||||
loadYards: (search?: string, limit?: number, offset?: number) => void;
|
loadYards: (search?: string, limit?: number, offset?: number) => void;
|
||||||
yardsLoading: boolean;
|
yardsLoading: boolean;
|
||||||
|
|
@ -191,8 +181,6 @@ export default function BinYard(props: Props) {
|
||||||
const { setYardFilter, loadBins, loadYards, /*gainBags,*/ setShowing, yardsLoading } = props;
|
const { setYardFilter, loadBins, loadYards, /*gainBags,*/ setShowing, yardsLoading } = props;
|
||||||
const binYardAPI = useBinYardAPI();
|
const binYardAPI = useBinYardAPI();
|
||||||
const binAPI = useBinAPI();
|
const binAPI = useBinAPI();
|
||||||
// const userAPI = useUserAPI();
|
|
||||||
// const teamAPI = useTeamAPI();
|
|
||||||
const [tab, setTab] = useState<number>(props.tab ? props.tab : 1);
|
const [tab, setTab] = useState<number>(props.tab ? props.tab : 1);
|
||||||
const [showAddYard, setShowAddYard] = useState<boolean>(false);
|
const [showAddYard, setShowAddYard] = useState<boolean>(false);
|
||||||
const [addYardName, setAddYardName] = useState<string>("");
|
const [addYardName, setAddYardName] = useState<string>("");
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ import {
|
||||||
FormControl,
|
FormControl,
|
||||||
FormControlLabel,
|
FormControlLabel,
|
||||||
Grid2 as Grid,
|
Grid2 as Grid,
|
||||||
// GridList,
|
|
||||||
// GridListTile,
|
|
||||||
IconButton,
|
IconButton,
|
||||||
ImageList,
|
ImageList,
|
||||||
ImageListItem,
|
ImageListItem,
|
||||||
|
|
@ -1403,5 +1401,5 @@ export default function Bins(props: Props) {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
return !props.insert ? <PageContainer padding={1}>{page()}</PageContainer> : page();
|
return !props.insert ? <PageContainer padding={-1}>{page()}</PageContainer> : page();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import classNames from "classnames";
|
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import PageContainer from "./PageContainer";
|
import PageContainer from "./PageContainer";
|
||||||
import {
|
import {
|
||||||
Theme,
|
|
||||||
Tooltip,
|
Tooltip,
|
||||||
Chip,
|
Chip,
|
||||||
Typography,
|
Typography,
|
||||||
|
|
@ -10,59 +8,12 @@ import {
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { pond } from "protobuf-ts/pond";
|
import { pond } from "protobuf-ts/pond";
|
||||||
import { useMineAPI } from "hooks";
|
import { useMineAPI } from "hooks";
|
||||||
// import { useHistory } from "react-router";
|
|
||||||
import AddMine from "ventilation/AddMine";
|
import AddMine from "ventilation/AddMine";
|
||||||
import { Add } from "@mui/icons-material";
|
import { LibraryAdd } from "@mui/icons-material";
|
||||||
import { makeStyles, withStyles } from "@mui/styles";
|
|
||||||
import ResponsiveTable, { Column } from "common/ResponsiveTable";
|
import ResponsiveTable, { Column } from "common/ResponsiveTable";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { or } from "utils";
|
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 {
|
interface MineRow {
|
||||||
mine: pond.Mine;
|
mine: pond.Mine;
|
||||||
}
|
}
|
||||||
|
|
@ -84,7 +35,6 @@ const mineColumns: Column<MineRow>[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function Mines() {
|
export default function Mines() {
|
||||||
const classes = useStyles();
|
|
||||||
const mineAPI = useMineAPI();
|
const mineAPI = useMineAPI();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||||
|
|
@ -95,24 +45,6 @@ export default function Mines() {
|
||||||
const [mineDialog, setMineDialog] = useState(false);
|
const [mineDialog, setMineDialog] = useState(false);
|
||||||
const [searchValue, setSearchValue] = useState("");
|
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(() => {
|
const load = useCallback(() => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
mineAPI
|
mineAPI
|
||||||
|
|
@ -148,7 +80,7 @@ export default function Mines() {
|
||||||
<Typography variant="h5">
|
<Typography variant="h5">
|
||||||
Mines
|
Mines
|
||||||
</Typography>
|
</Typography>
|
||||||
<ColorAdd onClick={() => setMineDialog(true)} />
|
<LibraryAdd color="primary" onClick={() => setMineDialog(true)} />
|
||||||
</Grid2>
|
</Grid2>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -157,8 +89,12 @@ export default function Mines() {
|
||||||
navigate(or(data.mine.settings?.key, ""))
|
navigate(or(data.mine.settings?.key, ""))
|
||||||
}
|
}
|
||||||
|
|
||||||
const minesTable = () => {
|
const closeCallback = () => {
|
||||||
return (
|
setMineDialog(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PageContainer padding={0}>
|
||||||
<ResponsiveTable<MineRow>
|
<ResponsiveTable<MineRow>
|
||||||
title={renderTitle}
|
title={renderTitle}
|
||||||
rows={mineTableData}
|
rows={mineTableData}
|
||||||
|
|
@ -173,20 +109,6 @@ export default function Mines() {
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
onRowClick={onRowClick}
|
onRowClick={onRowClick}
|
||||||
/>
|
/>
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const tableContent = () => {
|
|
||||||
return <div className={classNames(classes.gutter, classes.tableContainer)}>{minesTable()}</div>;
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeCallback = () => {
|
|
||||||
setMineDialog(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageContainer>
|
|
||||||
{tableContent()}
|
|
||||||
<AddMine open={mineDialog} closeCallback={closeCallback} refreshCallback={load} />
|
<AddMine open={mineDialog} closeCallback={closeCallback} refreshCallback={load} />
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,8 @@ export default function Ventilation() {
|
||||||
}, [mineKey, mineAPI]);
|
}, [mineKey, mineAPI]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContainer>
|
// TODO: why does padding have to be -2 to fit the page?
|
||||||
|
<PageContainer padding={-2}>
|
||||||
<div style={{ height: "100%", overflow: "hidden" }}>
|
<div style={{ height: "100%", overflow: "hidden" }}>
|
||||||
<EditorHeader
|
<EditorHeader
|
||||||
setMode={setMode}
|
setMode={setMode}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue