From bd5bc2617c031c78909cc5165b643f32aa52c4ec Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 18 Dec 2024 12:19:21 -0800 Subject: [PATCH 1/3] Add a config box component --- Client/src/Components/ConfigBox/index.jsx | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Client/src/Components/ConfigBox/index.jsx diff --git a/Client/src/Components/ConfigBox/index.jsx b/Client/src/Components/ConfigBox/index.jsx new file mode 100644 index 000000000..7650dd47f --- /dev/null +++ b/Client/src/Components/ConfigBox/index.jsx @@ -0,0 +1,38 @@ +import { Stack, styled } from "@mui/material"; + +const ConfigBox = styled(Stack)(({ theme }) => ({ + display: "flex", + flexDirection: "row", + justifyContent: "space-between", + gap: theme.spacing(20), + backgroundColor: theme.palette.background.main, + border: 1, + borderStyle: "solid", + borderColor: theme.palette.border.light, + borderRadius: theme.spacing(2), + "& > *": { + paddingTop: theme.spacing(12), + paddingBottom: theme.spacing(18), + }, + "& > div:first-of-type": { + flex: 0.7, + borderRight: 1, + borderRightStyle: "solid", + borderRightColor: theme.palette.border.light, + paddingRight: theme.spacing(15), + paddingLeft: theme.spacing(15), + }, + "& > div:last-of-type": { + flex: 1, + paddingRight: theme.spacing(20), + paddingLeft: theme.spacing(18), + }, + "& h1, & h2": { + color: theme.palette.text.secondary, + }, + "& p": { + color: theme.palette.text.tertiary, + }, +})); + +export default ConfigBox; From c47ec6ce8bb6925ea6f29965f41066a2cf757541 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 18 Dec 2024 12:20:09 -0800 Subject: [PATCH 2/3] refactor create maintenance to use new ConfigBox --- .../Maintenance/CreateMaintenance/index.jsx | 232 ++++++++---------- .../Maintenance/CreateMaintenance/styled.jsx | 25 -- 2 files changed, 99 insertions(+), 158 deletions(-) delete mode 100644 Client/src/Pages/Maintenance/CreateMaintenance/styled.jsx diff --git a/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx b/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx index f41603330..c832d463a 100644 --- a/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx +++ b/Client/src/Pages/Maintenance/CreateMaintenance/index.jsx @@ -2,7 +2,7 @@ import { Box, Button, Stack, Typography } from "@mui/material"; import { useSelector } from "react-redux"; import { useTheme } from "@emotion/react"; import { useEffect, useState } from "react"; -import { ConfigBox } from "./styled"; +import ConfigBox from "../../../Components/ConfigBox"; import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; import { LocalizationProvider } from "@mui/x-date-pickers"; import { DatePicker } from "@mui/x-date-pickers/DatePicker"; @@ -321,18 +321,27 @@ const CreateMaintenance = () => { Your pings won't be sent during this time frame - - - General Settings - - + + + + General Settings + + + + { + handleFormChange("name", event.target.value); + }} + error={errors["name"] ? true : false} + helperText={errors["name"]} + />