From 2485198b6a0a3c081eb276b075dc775ce4c403b6 Mon Sep 17 00:00:00 2001 From: Daniel Cojocea Date: Wed, 7 Aug 2024 19:49:08 -0400 Subject: [PATCH] Refactored skeletons --- Client/src/Pages/Incidents/index.jsx | 41 ++- Client/src/Pages/Monitors/Configure/index.jsx | 191 ++++++------ Client/src/Pages/Monitors/Details/index.jsx | 280 +++++++++--------- Client/src/Pages/Monitors/index.jsx | 128 ++++---- Client/src/Pages/PageSpeed/Details/index.jsx | 168 +++++------ Client/src/Pages/PageSpeed/index.jsx | 111 ++++--- 6 files changed, 471 insertions(+), 448 deletions(-) diff --git a/Client/src/Pages/Incidents/index.jsx b/Client/src/Pages/Incidents/index.jsx index 399a0a3bc..4c328a364 100644 --- a/Client/src/Pages/Incidents/index.jsx +++ b/Client/src/Pages/Incidents/index.jsx @@ -12,6 +12,32 @@ import Select from "../../Components/Inputs/Select"; import "./index.css"; +/** + * Renders a skeleton layout. + * + * @returns {JSX.Element} + */ +const SkeletonLayout = () => { + const theme = useTheme(); + + return ( + <> + + + + + + + + + ); +}; + const Incidents = () => { const theme = useTheme(); const navigate = useNavigate(); @@ -106,20 +132,7 @@ const Incidents = () => { <> {loading ? ( - <> - - - - - - - - + ) : hasAnyIncidents ? ( <> diff --git a/Client/src/Pages/Monitors/Configure/index.jsx b/Client/src/Pages/Monitors/Configure/index.jsx index 238021f1d..0df88078f 100644 --- a/Client/src/Pages/Monitors/Configure/index.jsx +++ b/Client/src/Pages/Monitors/Configure/index.jsx @@ -36,6 +36,54 @@ const parseUrl = (url) => { } }; +/** + * Renders a skeleton layout. + * + * @returns {JSX.Element} + */ +const SkeletonLayout = () => { + const theme = useTheme(); + + return ( + <> + + + + + + + + + + + + + + + + + + + + + ); +}; + /** * Configure page displays monitor configurations and allows for editing actions. * @component @@ -169,56 +217,35 @@ const Configure = () => { return ( {loading ? ( - + ) : ( -