Refactored code

This commit is contained in:
singh-kanwarpreet committed 2025-08-13 22:41:13 +05:30
1 parent 480ba034ce
commit 7ab5f4ab09
2 files changed
+27 -17

No files matched your search

+18 -2
View File
@@ -50,8 +50,17 @@ const Logs = () => {
{ _id: "debug", name: t("logsPage.logLevelSelect.values.debug") }, { _id: "debug", name: t("logsPage.logLevelSelect.values.debug") },
]; ];
return ( return (
<Stack gap={theme.spacing(4)}> <Stack gap={theme.spacing(8)}>
<Box> <Box
sx={{
position: "sticky",
top: 40,
left: 10,
zIndex: 950,
backgroundColor: theme.palette.tertiary.main,
paddingY: theme.spacing(6),
}}
>
<Typography variant="h2">{t("logsPage.description")}</Typography> <Typography variant="h2">{t("logsPage.description")}</Typography>
</Box> </Box>
<Divider color={theme.palette.accent.main} /> <Divider color={theme.palette.accent.main} />
@@ -61,6 +70,13 @@ const Logs = () => {
alignItems="center" alignItems="center"
gap={theme.spacing(4)} gap={theme.spacing(4)}
mt={theme.spacing(10)} mt={theme.spacing(10)}
sx={{
position: "sticky",
top: 80,
zIndex: 900,
backgroundColor: theme.palette.tertiary.main,
paddingY: theme.spacing(1),
}}
> >
<Typography>{t("logsPage.logLevelSelect.title")}</Typography> <Typography>{t("logsPage.logLevelSelect.title")}</Typography>
<Select <Select
+9 -15
View File
@@ -24,24 +24,20 @@ const Logs = () => {
const BREADCRUMBS = [{ name: t("logsPage.title"), path: "/logs" }]; const BREADCRUMBS = [{ name: t("logsPage.title"), path: "/logs" }];
// Height of the header (Breadcrumbs + Tabs)
const HEADER_HEIGHT = theme.spacing(25);
return ( return (
<> <Stack gap={theme.spacing(20)}>
<Breadcrumbs list={BREADCRUMBS} />
<Stack <Stack
gap={theme.spacing(20)} gap={theme.spacing(10)}
sx={{ sx={{
position: "sticky", position: "sticky",
top: 0, top: 0,
left: 0,
right: 0,
zIndex: 1000, zIndex: 1000,
backgroundColor: theme.palette.primary.main, backgroundColor: theme.palette.primary.main,
paddingY: theme.spacing(2), paddingY: theme.spacing(2),
}} }}
> >
<Breadcrumbs list={BREADCRUMBS} />
<Tabs <Tabs
value={value} value={value}
onChange={handleChange} onChange={handleChange}
@@ -52,13 +48,11 @@ const Logs = () => {
</Tabs> </Tabs>
</Stack> </Stack>
{/* Main content below fixed header */} {/* Main content */}
<Stack sx={{ paddingTop: HEADER_HEIGHT }}> {value === 0 && <LogsComponent />}
{value === 0 && <LogsComponent />} {value === 1 && <Queue />}
{value === 1 && <Queue />} {value === 2 && <Diagnostics />}
{value === 2 && <Diagnostics />} </Stack>
</Stack>
</>
); );
}; };