add empty view according to spec
This commit is contained in:
1 parent
55cf4e0cc8
commit
2732d5f64c
2 files changed
+47
-8
No files matched your search
@@ -0,0 +1,37 @@
|
|||||||
|
import { useTheme } from "@emotion/react";
|
||||||
|
import PlaceholderLight from "../../../assets/Images/data_placeholder.svg?react";
|
||||||
|
import PlaceholderDark from "../../../assets/Images/data_placeholder_dark.svg?react";
|
||||||
|
import { Box, Typography, Stack } from "@mui/material";
|
||||||
|
import PropTypes from "prop-types";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
const Empty = ({ styles }) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
const mode = useSelector((state) => state.ui.mode);
|
||||||
|
return (
|
||||||
|
<Box sx={{ ...styles, marginTop: theme.spacing(24) }}>
|
||||||
|
<Stack
|
||||||
|
direction="column"
|
||||||
|
gap={theme.spacing(8)}
|
||||||
|
alignItems="center"
|
||||||
|
>
|
||||||
|
{mode === "light" ? <PlaceholderLight /> : <PlaceholderDark />}
|
||||||
|
|
||||||
|
<Typography variant="h2">Your infrastructure dashboard will show here</Typography>
|
||||||
|
<Typography
|
||||||
|
textAlign="center"
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
|
>
|
||||||
|
Hang tight! When we receive data, we'll show it here. Please check back in a few
|
||||||
|
minutes.
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
Empty.propTypes = {
|
||||||
|
styles: PropTypes.object,
|
||||||
|
mode: PropTypes.string,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Empty;
|
||||||
@@ -9,6 +9,7 @@ import { useSelector } from "react-redux";
|
|||||||
import { networkService } from "../../../main";
|
import { networkService } from "../../../main";
|
||||||
import PulseDot from "../../../Components/Animated/PulseDot";
|
import PulseDot from "../../../Components/Animated/PulseDot";
|
||||||
import useUtils from "../../Monitors/utils";
|
import useUtils from "../../Monitors/utils";
|
||||||
|
import Empty from "./empty";
|
||||||
import { formatDurationRounded, formatDurationSplit } from "../../../Utils/timeUtils";
|
import { formatDurationRounded, formatDurationSplit } from "../../../Utils/timeUtils";
|
||||||
import {
|
import {
|
||||||
TzTick,
|
TzTick,
|
||||||
@@ -16,7 +17,6 @@ import {
|
|||||||
InfrastructureTooltip,
|
InfrastructureTooltip,
|
||||||
} from "../../../Components/Charts/Utils/chartUtils";
|
} from "../../../Components/Charts/Utils/chartUtils";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { DateRangeIcon } from "@mui/x-date-pickers";
|
|
||||||
|
|
||||||
const BASE_BOX_PADDING_VERTICAL = 4;
|
const BASE_BOX_PADDING_VERTICAL = 4;
|
||||||
const BASE_BOX_PADDING_HORIZONTAL = 8;
|
const BASE_BOX_PADDING_HORIZONTAL = 8;
|
||||||
@@ -396,13 +396,15 @@ const InfrastructureDetails = () => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
) : (
|
) : (
|
||||||
<Stack
|
<Empty
|
||||||
direction="column"
|
styles={{
|
||||||
gap={theme.spacing(10)}
|
border: 1,
|
||||||
mt={theme.spacing(10)}
|
borderColor: theme.palette.border.light,
|
||||||
>
|
borderRadius: theme.shape.borderRadius,
|
||||||
<Typography variant="h2">Hang tight, there's no data yet</Typography>
|
backgroundColor: theme.palette.background.main,
|
||||||
</Stack>
|
p: theme.spacing(30),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user