From 7247f6d8089f8c4388a802b0fb6cc2bd2b28787e Mon Sep 17 00:00:00 2001 From: Owaiseimdad Date: Sat, 22 Mar 2025 10:02:13 +0530 Subject: [PATCH 1/2] fixed the status boxes on screen to be more repsonsive and better aling with UI --- src/Components/StatBox/index.jsx | 19 ++++++++++++++++--- src/Components/StatusBoxes/index.jsx | 2 ++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Components/StatBox/index.jsx b/src/Components/StatBox/index.jsx index 54a4af5ca..7fd9bb2d8 100644 --- a/src/Components/StatBox/index.jsx +++ b/src/Components/StatBox/index.jsx @@ -62,7 +62,7 @@ const StatBox = ({ color: theme.palette.primary.contrastTextSecondary, }; - const spanFixedStyles = { marginLeft: theme.spacing(2), fontSize: 15, fontWeight: 600}; + const spanFixedStyles = { marginLeft: theme.spacing(2), fontSize: 15, fontWeight: 600 }; const detailTextStyles = gradient ? { color: theme.palette[themeColor].contrastText, @@ -79,6 +79,12 @@ const StatBox = ({ }, }; + const responsiveWidths = { + default: "calc(95% / 4)", + xl: "calc(95% / 3)", + md: "calc(95% / 2)", + }; + return ( {heading} - {subHeading} + {subHeading} ); diff --git a/src/Components/StatusBoxes/index.jsx b/src/Components/StatusBoxes/index.jsx index a2c627d19..fedc74011 100644 --- a/src/Components/StatusBoxes/index.jsx +++ b/src/Components/StatusBoxes/index.jsx @@ -20,6 +20,8 @@ const StatusBoxes = ({ shouldRender, flexWrap = "nowrap", children }) => { direction="row" flexWrap={flexWrap} gap={theme.spacing(8)} + justifyContent="space-between" + display="flex" > {children} From b9a8fda77e5708ad2ae51cac5445c358350deed7 Mon Sep 17 00:00:00 2001 From: Owaiseimdad Date: Thu, 3 Apr 2025 09:36:03 +0530 Subject: [PATCH 2/2] Added a new logic to calculate the width of the status boxes based on the parent spacings. --- src/Components/StatBox/index.jsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Components/StatBox/index.jsx b/src/Components/StatBox/index.jsx index 7fd9bb2d8..ed0b6694a 100644 --- a/src/Components/StatBox/index.jsx +++ b/src/Components/StatBox/index.jsx @@ -80,9 +80,8 @@ const StatBox = ({ }; const responsiveWidths = { - default: "calc(95% / 4)", - xl: "calc(95% / 3)", - md: "calc(95% / 2)", + default: `calc(25% - (3 * ${theme.spacing(8)} / 4))`, + md: `calc(50% - (1 * ${theme.spacing(8)} / 2))`, }; return ( @@ -94,9 +93,6 @@ const StatBox = ({ minWidth: 200, // this is for status box to be reponsive on diff screens width: responsiveWidths.default, // Default: 4 items per row - [theme.breakpoints.down("xl")]: { - width: responsiveWidths.xl, // 3 items per row - }, [theme.breakpoints.down("md")]: { width: responsiveWidths.md, // 2 items per row },