add header
This commit is contained in:
1 parent
2246f227d1
commit
a700f446fd
6 files changed
+92
-18
No files matched your search
@@ -1,10 +1,12 @@
|
||||
import Button from "@mui/material/Button";
|
||||
import type { ButtonProps } from "@mui/material/Button";
|
||||
export const ButtonInput: React.FC<ButtonProps> = ({ ...props }) => {
|
||||
|
||||
export const ButtonInput: React.FC<ButtonProps> = ({ filled, sx, ...props }) => {
|
||||
return (
|
||||
<Button
|
||||
filled={filled}
|
||||
{...props}
|
||||
sx={{ textTransform: "none", height: 34, fontWeight: 400, borderRadius: 2 }}
|
||||
sx={{ textTransform: "none", height: 34, fontWeight: 400, borderRadius: 2, ...sx }}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -11,17 +11,6 @@ export const ButtonGroupInput: React.FC<ButtonGroupProps> = ({
|
||||
<ButtonGroup
|
||||
orientation={orientation}
|
||||
{...props}
|
||||
sx={{
|
||||
...(orientation !== "vertical" && { height: 34 }),
|
||||
width: orientation === "vertical" ? "100%" : "auto",
|
||||
border: 1,
|
||||
borderStyle: "solid",
|
||||
borderColor: theme.palette.primary.lowContrast,
|
||||
borderRadius: 2,
|
||||
"& .MuiButtonGroup-grouped": {
|
||||
height: "100%",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
import Stack from "@mui/material/Stack";
|
||||
import { ButtonGroup, Button } from "@/Components/v2/Inputs";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { theme } from "@/Utils/Theme/v2/theme";
|
||||
|
||||
export const HeaderRange = ({
|
||||
range,
|
||||
setRange,
|
||||
loading,
|
||||
}: {
|
||||
range: string;
|
||||
setRange: Function;
|
||||
loading: boolean;
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
return (
|
||||
<Stack
|
||||
gap={theme.spacing(9)}
|
||||
direction="row"
|
||||
alignItems={"center"}
|
||||
justifyContent="flex-end"
|
||||
>
|
||||
<Typography variant="body2">{`Showing statistics for past ${range}`}</Typography>
|
||||
<ButtonGroup
|
||||
variant="contained"
|
||||
color={"primary"}
|
||||
>
|
||||
<Button
|
||||
color={range === "2h" ? "secondary" : "inherit"}
|
||||
onClick={() => setRange("2h")}
|
||||
loading={loading}
|
||||
>
|
||||
Recent
|
||||
</Button>
|
||||
<Button
|
||||
color={range === "24h" ? "secondary" : "inherit"}
|
||||
onClick={() => setRange("24h")}
|
||||
loading={loading}
|
||||
>
|
||||
Day
|
||||
</Button>
|
||||
<Button
|
||||
color={range === "7d" ? "secondary" : "inherit"}
|
||||
onClick={() => setRange("7d")}
|
||||
loading={loading}
|
||||
>
|
||||
7 days
|
||||
</Button>
|
||||
<Button
|
||||
color={range === "30d" ? "secondary" : "inherit"}
|
||||
onClick={() => setRange("30d")}
|
||||
loading={loading}
|
||||
>
|
||||
30 days
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user