Merge branch 'dev_environment' of gitlab.com:brandx/bxt-app into dev_environment
This commit is contained in:
commit
044b2ad8f4
3 changed files with 12 additions and 7 deletions
|
|
@ -450,7 +450,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
columns.map((column, j) => {
|
||||
if (filterList.includes(column.title)) return null
|
||||
if (column.render) return (
|
||||
<TableCell key={"row-"+index+"cell-"+j} sx={{ padding: 0}} >
|
||||
<TableCell key={"row-"+index+"cell-"+j} sx={column.cellStyle ? column.cellStyle : {padding: 0}}>
|
||||
{column.render(row)}
|
||||
</TableCell>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Box, Grid2 as Grid, Skeleton, Theme, Tooltip } from "@mui/material";
|
||||
import { Box, Grid2 as Grid, Skeleton, Theme, Tooltip, Typography } from "@mui/material";
|
||||
import { makeStyles } from "@mui/styles";
|
||||
import { NextMeasurementChip } from "common/NextMeasurementChip";
|
||||
import ResponsiveTable, { Column } from "common/ResponsiveTable";
|
||||
|
|
@ -465,16 +465,20 @@ export default function DeviceComponent() {
|
|||
return [
|
||||
{
|
||||
title: "Timestamp",
|
||||
cellStyle: {width: "50%"},
|
||||
render: row => {
|
||||
return (
|
||||
<Tooltip title={moment(row.timestamp).calendar()}>
|
||||
<span>{moment(row.timestamp).fromNow()}</span>
|
||||
<Box>
|
||||
<Typography>{moment(row.timestamp).fromNow()}</Typography>
|
||||
</Box>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "Measurement",
|
||||
cellStyle: {width: "50%"},
|
||||
render: row => {
|
||||
return (
|
||||
<UnitMeasurementSummary
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { Button, Theme } from "@mui/material";
|
||||
import { makeStyles } from "@mui/styles";
|
||||
import {
|
||||
ProviderContext as NotistackProviderContext,
|
||||
SnackbarAction,
|
||||
SnackbarProvider as NotistackSnackbarProvider,
|
||||
useSnackbar as useNotistackSnackbar
|
||||
|
|
@ -95,15 +94,17 @@ function SnackbarHelper(props: PropsWithChildren<Props>) {
|
|||
export default function SnackbarProvider(props: PropsWithChildren<Props>) {
|
||||
const { children } = props;
|
||||
const classes = useStyles();
|
||||
const notistackRef = React.createRef<NotistackProviderContext>();
|
||||
const providerRef = React.createRef<NotistackSnackbarProvider>();
|
||||
|
||||
const onClickDismiss = (key: React.ReactText) => () => {
|
||||
if (notistackRef && notistackRef.current) notistackRef.current.closeSnackbar(key);
|
||||
if (providerRef && providerRef.current) {
|
||||
providerRef.current.closeSnackbar(key);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<NotistackSnackbarProvider
|
||||
// ref={notistackRef}
|
||||
ref={providerRef}
|
||||
maxSnack={1}
|
||||
anchorOrigin={{
|
||||
vertical: "bottom",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue