bin list will show grid view now
This commit is contained in:
parent
b5071dfb40
commit
7dad5217e7
3 changed files with 14 additions and 68 deletions
|
|
@ -2,7 +2,7 @@ import {
|
||||||
Box,
|
Box,
|
||||||
Card,
|
Card,
|
||||||
darken,
|
darken,
|
||||||
Grid,
|
Grid2 as Grid,
|
||||||
IconButton,
|
IconButton,
|
||||||
Theme,
|
Theme,
|
||||||
Typography,
|
Typography,
|
||||||
|
|
@ -296,10 +296,10 @@ export default function BinCard(props: Props) {
|
||||||
return (
|
return (
|
||||||
<Box className={classes.displayBox}>
|
<Box className={classes.displayBox}>
|
||||||
<Grid container alignContent="center" alignItems="center" direction="row">
|
<Grid container alignContent="center" alignItems="center" direction="row">
|
||||||
<Grid item xs={3}>
|
<Grid size={{ xs: 3 }}>
|
||||||
<TemperatureIcon heightWidth={20} />
|
<TemperatureIcon heightWidth={20} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={9}>
|
<Grid size={{ xs: 9 }}>
|
||||||
<Box>
|
<Box>
|
||||||
{tempDisplay()}
|
{tempDisplay()}
|
||||||
<Typography
|
<Typography
|
||||||
|
|
@ -311,10 +311,10 @@ export default function BinCard(props: Props) {
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={3} style={{ paddingLeft: 5 }}>
|
<Grid size={{ xs: 3 }} style={{ paddingLeft: 5 }}>
|
||||||
<HumidityIcon height={20} />
|
<HumidityIcon height={20} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={9}>
|
<Grid size={{ xs: 9 }}>
|
||||||
<Box>
|
<Box>
|
||||||
{percentDisplay()}
|
{percentDisplay()}
|
||||||
<Typography
|
<Typography
|
||||||
|
|
@ -335,10 +335,10 @@ export default function BinCard(props: Props) {
|
||||||
return (
|
return (
|
||||||
<Box className={classes.displayBox} key={controller.key}>
|
<Box className={classes.displayBox} key={controller.key}>
|
||||||
<Grid container direction="row" alignItems="center" alignContent="center">
|
<Grid container direction="row" alignItems="center" alignContent="center">
|
||||||
<Grid item xs={3} style={{ paddingLeft: 5, paddingTop: 5 }}>
|
<Grid size={{ xs: 3 }} style={{ paddingLeft: 5, paddingTop: 5 }}>
|
||||||
<AerationFanIcon size={18} />
|
<AerationFanIcon size={18} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={9}>
|
<Grid size={{ xs: 9 }}>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography
|
<Typography
|
||||||
align="center"
|
align="center"
|
||||||
|
|
@ -361,11 +361,11 @@ export default function BinCard(props: Props) {
|
||||||
return (
|
return (
|
||||||
<Box className={classes.displayBox} key={controller.key}>
|
<Box className={classes.displayBox} key={controller.key}>
|
||||||
<Grid container direction="row" alignItems="center" alignContent="center">
|
<Grid container direction="row" alignItems="center" alignContent="center">
|
||||||
<Grid item xs={3} style={{ paddingLeft: 5, paddingTop: 3 }}>
|
<Grid size={{ xs: 3 }} style={{ paddingLeft: 5, paddingTop: 3 }}>
|
||||||
{/* <ObjectHeaterIcon height={18} width={18} /> */}
|
{/* <ObjectHeaterIcon height={18} width={18} /> */}
|
||||||
<ObjectHeaterIcon />
|
<ObjectHeaterIcon />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={9}>
|
<Grid size={{ xs: 9 }}>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography
|
<Typography
|
||||||
align="center"
|
align="center"
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,16 @@ import {
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Grid2 as Grid,
|
Grid2 as Grid,
|
||||||
Theme,
|
|
||||||
Typography
|
Typography
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { Bin } from "models";
|
import { Bin } from "models";
|
||||||
import React, { useContext, useRef, useState } from "react";
|
import React, { useContext, useState } from "react";
|
||||||
// import ScrollMenu from "react-horizontal-scroll-menu";
|
|
||||||
// import { useHistory } from "react-router";
|
|
||||||
import { ArrowForward, ArrowBack, Replay } from "@mui/icons-material";
|
import { ArrowForward, ArrowBack, Replay } from "@mui/icons-material";
|
||||||
import { useMobile } from "hooks";
|
import { useMobile } from "hooks";
|
||||||
import BinCardV2 from "./BinCardV2";
|
import BinCardV2 from "./BinCardV2";
|
||||||
import { makeStyles } from "@mui/styles";
|
import { makeStyles } from "@mui/styles";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { publicApiType, ScrollMenu, VisibilityContext } from "react-horizontal-scrolling-menu";
|
import { ScrollMenu, VisibilityContext } from "react-horizontal-scrolling-menu";
|
||||||
import 'react-horizontal-scrolling-menu/dist/styles.css';
|
import 'react-horizontal-scrolling-menu/dist/styles.css';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
@ -27,7 +24,7 @@ interface Props {
|
||||||
valDisplay?: "high" | "low" | "average";
|
valDisplay?: "high" | "low" | "average";
|
||||||
}
|
}
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) => {
|
const useStyles = makeStyles((_theme) => {
|
||||||
return ({
|
return ({
|
||||||
gridListTile: {
|
gridListTile: {
|
||||||
position: "relative",
|
position: "relative",
|
||||||
|
|
@ -56,53 +53,6 @@ export default function BinsList(props: Props) {
|
||||||
navigate(path, { state: {bin: bins[i]} });
|
navigate(path, { state: {bin: bins[i]} });
|
||||||
};
|
};
|
||||||
|
|
||||||
// const scroll = () => {
|
|
||||||
// return (
|
|
||||||
// <ScrollMenu
|
|
||||||
// wheel={false}
|
|
||||||
// ref={scrollRef}
|
|
||||||
// alignCenter={false}
|
|
||||||
// inertiaScrolling
|
|
||||||
// translate={startingTranslate}
|
|
||||||
// hideArrows
|
|
||||||
// hideSingleArrow
|
|
||||||
// arrowDisabledClass={classes.hidden}
|
|
||||||
// onUpdate={params => {
|
|
||||||
// if (scrollRef.current.state) {
|
|
||||||
// if (scrollRef.current.getOffsetAtEnd() === params.translate && loadMore) {
|
|
||||||
// loadMore(params.translate);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }}
|
|
||||||
// onSelect={e => {
|
|
||||||
// if (!duplicate) {
|
|
||||||
// goToBin(e as number);
|
|
||||||
// }
|
|
||||||
// }}
|
|
||||||
// arrowLeft={
|
|
||||||
// <Button style={{ height: 184, display: isMobile ? "none" : "block" }}>
|
|
||||||
// <ArrowBack />
|
|
||||||
// </Button>
|
|
||||||
// }
|
|
||||||
// arrowRight={
|
|
||||||
// <Button style={{ height: 184, display: isMobile ? "none" : "block" }}>
|
|
||||||
// <ArrowForward />
|
|
||||||
// </Button>
|
|
||||||
// }
|
|
||||||
// data={bins.map((b, i) => (
|
|
||||||
// <Box key={i} className={classes.gridListTile}>
|
|
||||||
// <BinCardV2
|
|
||||||
// bin={b}
|
|
||||||
// duplicateBin={duplicateBin}
|
|
||||||
// dupHovered={setDuplicate}
|
|
||||||
// valDisplay={valDisplay}
|
|
||||||
// />
|
|
||||||
// </Box>
|
|
||||||
// ))}
|
|
||||||
// />
|
|
||||||
// );
|
|
||||||
// };
|
|
||||||
|
|
||||||
const leftArrow = () => {
|
const leftArrow = () => {
|
||||||
const visibility = useContext(VisibilityContext);
|
const visibility = useContext(VisibilityContext);
|
||||||
//const isFirstVisible = visibility.useIsVisible('first', false)
|
//const isFirstVisible = visibility.useIsVisible('first', false)
|
||||||
|
|
@ -200,9 +150,9 @@ export default function BinsList(props: Props) {
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{title && <Typography>{title}</Typography>}
|
{title && <Typography>{title}</Typography>}
|
||||||
{/* {gridView ? grid() : scroll()} */}
|
{gridView ? grid() : scroll()}
|
||||||
{/* {grid()} */}
|
{/* {grid()} */}
|
||||||
{scroll()}
|
{/* {scroll()} */}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,7 @@ import {
|
||||||
ToggleButtonGroup,
|
ToggleButtonGroup,
|
||||||
Typography,
|
Typography,
|
||||||
useTheme,
|
useTheme,
|
||||||
withStyles
|
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
// import { green, yellow } from "@material-ui/core/colors";
|
|
||||||
import {
|
import {
|
||||||
ArrowBackIos,
|
ArrowBackIos,
|
||||||
ArrowForwardIos,
|
ArrowForwardIos,
|
||||||
|
|
@ -43,8 +41,6 @@ import {
|
||||||
ViewComfy,
|
ViewComfy,
|
||||||
ViewList
|
ViewList
|
||||||
} from "@mui/icons-material";
|
} from "@mui/icons-material";
|
||||||
// import { Skeleton } from "@material-ui/lab";
|
|
||||||
// import AddBinFab from "bin/AddBinFab";
|
|
||||||
// import BinsFansStatusTable from "bin/BinFansStatusTable";
|
// import BinsFansStatusTable from "bin/BinFansStatusTable";
|
||||||
// import BinSettings from "bin/BinSettings";
|
// import BinSettings from "bin/BinSettings";
|
||||||
import BinsList from "bin/BinsList";
|
import BinsList from "bin/BinsList";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue