From 6aacfe0ca836967badedbb51f96706a4cd49cdc7 Mon Sep 17 00:00:00 2001 From: Daniel Cojocea Date: Mon, 22 Jul 2024 16:35:57 -0400 Subject: [PATCH] Implemented fallback component --- Client/src/Components/Check/Check.jsx | 11 +++-- Client/src/Components/Fallback/index.css | 23 ++++++++++ Client/src/Components/Fallback/index.jsx | 44 +++++++++++++++++++ Client/src/Pages/Status/index.jsx | 23 +++++++++- .../src/assets/Images/create-placeholder.svg | 29 ++++++++++++ Client/src/assets/icons/check-outlined.svg | 3 ++ 6 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 Client/src/Components/Fallback/index.css create mode 100644 Client/src/Components/Fallback/index.jsx create mode 100644 Client/src/assets/Images/create-placeholder.svg create mode 100644 Client/src/assets/icons/check-outlined.svg diff --git a/Client/src/Components/Check/Check.jsx b/Client/src/Components/Check/Check.jsx index 501d0a344..b43754fa9 100644 --- a/Client/src/Components/Check/Check.jsx +++ b/Client/src/Components/Check/Check.jsx @@ -1,6 +1,7 @@ import "./check.css"; import PropTypes from "prop-types"; import CheckGrey from "../../assets/icons/check.svg?react"; +import CheckOutlined from "../../assets/icons/check-outlined.svg?react"; import { Stack, Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; @@ -18,12 +19,12 @@ import { useTheme } from "@emotion/react"; * * @returns {React.Element} The `Check` component with a check icon and a label, defined by the `text` prop. */ -const Check = ({ text, variant = "info" }) => { +const Check = ({ text, variant = "info", outlined = false }) => { const theme = useTheme(); return ( { }`} alignItems="center" > - + {outlined ? ( + + ) : ( + + )} {text} ); diff --git a/Client/src/Components/Fallback/index.css b/Client/src/Components/Fallback/index.css new file mode 100644 index 000000000..31c706241 --- /dev/null +++ b/Client/src/Components/Fallback/index.css @@ -0,0 +1,23 @@ +[class*="fallback__"] { + width: 255px; + margin: auto; + margin-top: 100px; +} +[class*="fallback__"] h1.MuiTypography-root { + font-size: var(--env-var-font-size-large); + font-weight: 600; +} +[class*="fallback__"] .check span.MuiTypography-root, +[class*="fallback__"] h1.MuiTypography-root { + color: var(--env-var-color-5); +} +[class*="fallback__"] button.MuiButtonBase-root, +[class*="fallback__"] .check { + width: max-content; +} +[class*="fallback__"] button.MuiButtonBase-root { + height: 34px; +} +[class*="fallback__"] .check span.MuiTypography-root { + font-size: var(--env-var-font-size-medium); +} diff --git a/Client/src/Components/Fallback/index.jsx b/Client/src/Components/Fallback/index.jsx new file mode 100644 index 000000000..8df84feba --- /dev/null +++ b/Client/src/Components/Fallback/index.jsx @@ -0,0 +1,44 @@ +import { useTheme } from "@emotion/react"; +import { Stack, Typography } from "@mui/material"; +import Skeleton from "../../assets/Images/create-placeholder.svg?react"; +import Button from "../Button"; +import Check from "../Check/Check"; +import { useNavigate } from "react-router-dom"; +import "./index.css"; + +const Fallback = ({ title, checks, link = "/" }) => { + const theme = useTheme(); + const navigate = useNavigate(); + + return ( + + + + + A {title} is used to: + + {checks.map((check, index) => ( + + ))} + +