diff --git a/Client/src/App.jsx b/Client/src/App.jsx index a5b649e8b..69edf9a6d 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -24,6 +24,7 @@ import withAdminCheck from "./HOC/withAdminCheck"; import Configure from "./Pages/Monitors/Configure"; import PageSpeed from "./Pages/PageSpeed"; import CreatePageSpeed from "./Pages/PageSpeed/CreatePageSpeed"; +import CreateNewMaintenanceWindow from "./Pages/Maintenance/CreateMaintenanceWindow"; function App() { const AdminCheckedRegister = withAdminCheck(Register); @@ -69,6 +70,10 @@ function App() { path="maintenance" element={} /> + } + /> } diff --git a/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.css b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.css new file mode 100644 index 000000000..a799bf0af --- /dev/null +++ b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.css @@ -0,0 +1,21 @@ +.maintenance-options > .MuiStack-root > .MuiStack-root.select-wrapper { + width: 380px; +} + +.date-picker .MuiOutlinedInput-root, +.time-picker .MuiOutlinedInput-root { + height: 34px; + font-size: var(--env-var-font-size-medium); +} + +.date-picker .MuiOutlinedInput-root { + width: 140px; +} + +.time-picker .MuiOutlinedInput-root { + width: 90px; +} + +.MuiInputAdornment-outlined .MuiIconButton-root svg { + width: 20px; +} diff --git a/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx new file mode 100644 index 000000000..aea012e2c --- /dev/null +++ b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx @@ -0,0 +1,151 @@ +import { Box, Stack, Typography } from "@mui/material"; +import "./index.css"; +import React, { useState } from "react"; +import Button from "../../../Components/Button"; +import Back from "../../../assets/icons/left-arrow.svg?react"; +import Select from "../../../Components/Inputs/Select"; +import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; +import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider"; +import dayjs from "dayjs"; +import { DatePicker } from "@mui/x-date-pickers/DatePicker"; +import { MobileTimePicker } from "@mui/x-date-pickers/MobileTimePicker"; + +const directory = { + title: "Create a maintenance window", + description: "Your pings won’t be sent in this time frame.", +}; + +const repeatOptions = [ + { _id: 1, name: "Don't repeat" }, + { _id: 2, name: "Repeat daily" }, + { _id: 3, name: "Repeat weekly" }, +]; + +const configOptionTitle = (title, description) => { + return ( + + + {title} + + {description && ( + + {description} + + )} + + ); +}; + +const CreateNewMaintenanceWindow = () => { + const [values, setValues] = useState({ + repeat: 1, + }); + + const handleChange = (event, name) => { + const { value } = event.target; + setValues((prev) => ({ + ...prev, + [name]: value, + })); + }; + + const configOptions = [ + { + title: "Repeat", + component: ( + handleChange(e, "repeat")} + id="repeat-mode" + items={repeatOptions} + value={values.repeat} + /> + ), + }, + { + title: "Date", + component: ( + + + + ), + }, + { + title: "Start time", + description: "Your pings won’t be sent in this time frame.", + component: ( + + + + ), + }, + ]; + + return ( + + + } + /> + + + {directory.title} + + + + {directory.description} + + + + {configOptions.map((item, index) => ( + + {configOptionTitle(item.title, item.description)} + {item.component && item.component} + + ))} + + + + ); +}; + +export default CreateNewMaintenanceWindow; diff --git a/Client/src/Pages/Maintenance/index.jsx b/Client/src/Pages/Maintenance/index.jsx index 92cd351ef..c589552f7 100644 --- a/Client/src/Pages/Maintenance/index.jsx +++ b/Client/src/Pages/Maintenance/index.jsx @@ -14,6 +14,7 @@ const Maintenance = () => { "Eliminate any misunderstandings", "Stop sending alerts in maintenance windows", ]} + link="/maintenance/create" /> ); diff --git a/Client/src/assets/icons/left-arrow.svg b/Client/src/assets/icons/left-arrow.svg new file mode 100644 index 000000000..db9b827ed --- /dev/null +++ b/Client/src/assets/icons/left-arrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/Client/src/index.css b/Client/src/index.css index 40f7dcd5d..7f66b6ebd 100644 --- a/Client/src/index.css +++ b/Client/src/index.css @@ -50,6 +50,8 @@ --env-var-color-28: #f79009; --env-var-color-29: #d0d5dd; --env-var-color-30: #fcfcfd; + --env-var-color-31: #1a1919; + --env-var-color-32: #f5f5f5; --env-var-radius-1: 4px; --env-var-radius-2: 8px;