diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 82c8203a8..efab418ec 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -41,6 +41,7 @@ import { logger } from "./Utils/Logger"; // Import the logger import { networkService } from "./main"; import { Infrastructure } from "./Pages/Infrastructure"; import InfrastructureDetails from "./Pages/Infrastructure/Details"; +import CreateStatus from "./Pages/Status/CreateStatus"; function App() { const AdminCheckedRegister = withAdminCheck(Register); const MonitorsWithAdminProp = withAdminProp(Monitors); @@ -148,6 +149,10 @@ function App() { path="status" element={} /> + } + /> } diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index 4c274409b..6b8321695 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -43,6 +43,7 @@ import DotsVertical from "../../assets/icons/dots-vertical.svg?react"; import ChangeLog from "../../assets/icons/changeLog.svg?react"; import Docs from "../../assets/icons/docs.svg?react"; import Folder from "../../assets/icons/folder.svg?react"; +import StatusPages from "../../assets/icons/status-pages.svg?react"; import "./index.css"; @@ -51,7 +52,7 @@ const menu = [ { name: "Pagespeed", path: "pagespeed", icon: }, { name: "Infrastructure", path: "infrastructure", icon: }, { name: "Incidents", path: "incidents", icon: }, - // { name: "Status pages", path: "status", icon: }, + { name: "Status pages", path: "status", icon: }, { name: "Maintenance", path: "maintenance", icon: }, // { name: "Integrations", path: "integrations", icon: }, { diff --git a/Client/src/Components/TabPanels/Status/GeneralSettingsPanel.jsx b/Client/src/Components/TabPanels/Status/GeneralSettingsPanel.jsx new file mode 100644 index 000000000..a14fba7ee --- /dev/null +++ b/Client/src/Components/TabPanels/Status/GeneralSettingsPanel.jsx @@ -0,0 +1,66 @@ +import { useState, useRef } from "react"; +import { Box, Stack, Typography } from "@mui/material"; +import { ConfigBox } from "../../../Pages/Monitors/styled"; +import Checkbox from "../../Inputs/Checkbox"; +import { useTheme } from "@emotion/react"; +import { useDispatch, useSelector } from "react-redux"; +import TabPanel from "@mui/lab/TabPanel"; + +const GeneralSettingsPanel = () => { + const theme = useTheme(); + const dispatch = useDispatch(); + + //redux state + const { user, authToken, isLoading } = useSelector((state) => state.auth); + + // Local state for form data, errors, and file handling + const [localData, setLocalData] = useState({ + }); + const [errors, setErrors] = useState({}); + const [file, setFile] = useState(); + + const handleSubmit = () => {}; + + const handleChange = () => {}; + + const handleBlur = () => {}; + return ( + + + + + + Access + + If your status page is ready, you can mark it as published. + + + + handleChange(e)} + onBlur={handleBlur} + /> + + + + ); +}; + +export default GeneralSettingsPanel; diff --git a/Client/src/Pages/Status/CreateStatus/index.jsx b/Client/src/Pages/Status/CreateStatus/index.jsx new file mode 100644 index 000000000..84512833d --- /dev/null +++ b/Client/src/Pages/Status/CreateStatus/index.jsx @@ -0,0 +1,82 @@ +import PropTypes from "prop-types"; +import { useNavigate } from "react-router"; +import { useSelector } from "react-redux"; +import { Box, Tab, useTheme } from "@mui/material"; +import TabContext from "@mui/lab/TabContext"; +import TabList from "@mui/lab/TabList"; +import GeneralSettingsPanel from "../../../Components/TabPanels/Status/GeneralSettingsPanel"; + +/** + * CreateStatus page renders a page with tabs for general settings and contents. + * @param {string} [props.open] - Specifies the initially open tab: 'general settings' or 'content'. + * @returns {JSX.Element} + */ + +const CreateStatus = ({ open = "general settings" }) => { + const theme = useTheme(); + const navigate = useNavigate(); + const tab = open; + const handleTabChange = (event, newTab) => { + navigate(`/status/${newTab}`); + }; + const { user } = useSelector((state) => state.auth); + + const requiredRoles = ["superadmin", "admin"]; + let tabList = ["General Settings", "Contents"]; + + return ( + + + + + {tabList.map((label, index) => ( + + ))} + + + + + + ); +}; + +CreateStatus.propTypes = { + open: PropTypes.oneOf(["general settings", "contents"]), +}; + +export default CreateStatus; diff --git a/Client/src/Pages/Status/index.css b/Client/src/Pages/Status/index.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/Client/src/Pages/Status/index.jsx b/Client/src/Pages/Status/index.jsx index 6827834ac..4ac66c3f5 100644 --- a/Client/src/Pages/Status/index.jsx +++ b/Client/src/Pages/Status/index.jsx @@ -1,10 +1,11 @@ -import { Box } from "@mui/material"; import { useTheme } from "@emotion/react"; import Fallback from "../../Components/Fallback"; +import { Box, Button, Stack } from "@mui/material"; +import { useNavigate } from "react-router-dom"; const Status = () => { const theme = useTheme(); - + const navigate = useNavigate(); return ( { "Build trust with your customers", ]} /> + + + ); };