Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX-1848 UI design changes #1850

Merged
merged 8 commits into from
Mar 3, 2025
31 changes: 13 additions & 18 deletions src/Pages/StatusPage/Create/Components/Tabs/Content.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Components
import { Stack, Typography, Button } from "@mui/material";
import { Stack, Typography } from "@mui/material";
import { TabPanel } from "@mui/lab";
import ConfigBox from "../../../../../Components/ConfigBox";
import MonitorList from "../MonitorList";
import Search from "../../../../../Components/Inputs/Search";
import Checkbox from "../../../../../Components/Inputs/Checkbox";
// Utils
import { useState } from "react";
import { useTheme } from "@emotion/react";
import SectionStack from "./SectionStack";
const Content = ({
tabValue,
form,
Expand All @@ -34,14 +34,10 @@ const Content = ({
return (
<TabPanel value={tabValue}>
<Stack gap={theme.spacing(10)}>
<ConfigBox>
<Stack gap={theme.spacing(6)}>
<Typography component="h2">Status page servers</Typography>
<Typography component="p">
You can add any number of servers that you monitor to your status page. You
can also reorder them for the best viewing experience.
</Typography>
</Stack>
<SectionStack
title="Status page servers"
description="You can add any number of servers that you monitor to your status page. You can also reorder them for the best viewing experience."
>
<Stack>
<Stack
direction="row"
Expand Down Expand Up @@ -72,13 +68,12 @@ const Content = ({
setSelectedMonitors={handleMonitorsChange}
/>
</Stack>
</ConfigBox>{" "}
<ConfigBox>
<Stack gap={theme.spacing(6)}>
<Typography component="h2">Features</Typography>
<Typography component="p">Show more details on the status page</Typography>
</Stack>
<Stack sx={{ margin: theme.spacing(6) }}>
</SectionStack>
<SectionStack
title="Features"
description="Show more details on the status page"
>
<Stack>
<Checkbox
id="showCharts"
name="showCharts"
Expand All @@ -94,7 +89,7 @@ const Content = ({
onChange={handleFormChange}
/>
</Stack>
</ConfigBox>
</SectionStack>
</Stack>
<Stack gap={theme.spacing(6)}></Stack>
</TabPanel>
Expand Down
22 changes: 22 additions & 0 deletions src/Pages/StatusPage/Create/Components/Tabs/SectionStack.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Stack, Typography } from "@mui/material";
import ConfigBox from "../../../../../Components/ConfigBox";
import PropTypes from "prop-types";

// This can be used to add any extra/additional section/stacks on top of existing sections on the tab
const SectionStack = ({ title, description, children }) => (
<ConfigBox>
<Stack gap={2}>
<Typography component="h2">{title}</Typography>
<Typography component="p">{description}</Typography>
</Stack>
{children}
</ConfigBox>
);

SectionStack.propTypes = {
title: PropTypes.string.isRequired, // Title must be a string and is required
description: PropTypes.string.isRequired, // Description must be a string and is required
children: PropTypes.node.isRequired,
};

export default SectionStack;