From eea14a3c0f0d541877638408a607008ebce0fa92 Mon Sep 17 00:00:00 2001 From: Rosny Ratsianompo <60210333+mitia-anah@users.noreply.github.com> Date: Sat, 19 Feb 2022 00:45:01 +0300 Subject: [PATCH] fix: edit dash width (#329) --- src/components/DashStat.js | 85 +++++++++++++++--------------- src/components/Home/Home.js | 11 ++-- src/components/Home/Home.styles.js | 7 +++ 3 files changed, 52 insertions(+), 51 deletions(-) diff --git a/src/components/DashStat.js b/src/components/DashStat.js index fe8759deb..0b3ee5fc7 100644 --- a/src/components/DashStat.js +++ b/src/components/DashStat.js @@ -1,15 +1,28 @@ import React from 'react'; -import Grid from '@material-ui/core/Grid'; import { withStyles } from '@material-ui/core/styles'; import { CircularProgress } from '@material-ui/core'; const style = (theme) => ({ - dashstatContainer: { - height: '95px', - backgroundColor: 'white', + dashstatCard: { borderRadius: '10px', + display: 'flex', + backgroundColor: '#FFF', + flexDirection: 'row', + gap: '1rem', + width: '245px', + + '@media (max-width: 900px)': { + flexDirection: 'column', + gap: 0, + height: '175px', + alignItems: 'center', + width: '200px', + textAlign: 'center', + }, }, dashstatIconContainer: { + display: 'flex', + flexWrap: 'wrap', width: '58px', height: '58px', marginTop: '20px', @@ -17,6 +30,11 @@ const style = (theme) => ({ marginBottom: '20px', float: 'left', position: 'relative', + + '@media (max-width: 900px)': { + height: '150px', + marginLeft: 0, + }, }, dashstatCircleIcon: { borderRadius: '29px', @@ -27,6 +45,7 @@ const style = (theme) => ({ top: '0', position: 'absolute', }, + dashstatIcon: { margin: '0 auto', left: '11px', @@ -34,31 +53,19 @@ const style = (theme) => ({ width: '35px', height: '35px', position: 'absolute', + + '@media (max-width: 900px)': { + top: '10px', + }, }, + dashstatText: { - float: 'left', - marginLeft: '22px', - height: '100%', - width: '110px', - boxSizing: 'border-box', - position: 'relative', + display: 'block', fontFamily: theme.typography.fontFamily, }, - dashstatData: { - display: 'inline-block', - position: 'absolute', - top: '18px', - marginBlockStart: 0, - marginBlockEnd: 0, - }, + dashstatLabel: { - display: 'inline-block', fontSize: '12px', - bottom: '20px', - marginBlockStart: 0, - marginBlockEnd: 0, - width: '110px', - position: 'absolute', }, }); @@ -75,27 +82,19 @@ function DashStat(props) { const { data, Icon, label, color = '#000000', classes } = props; return ( - -
-
-
- -
-
-

- {data || } -

-
-

{label}

-
+
+
+
+ +
+
+

{data || }

+

{label}

- +
); } diff --git a/src/components/Home/Home.js b/src/components/Home/Home.js index e7f685a1e..6d6684f14 100644 --- a/src/components/Home/Home.js +++ b/src/components/Home/Home.js @@ -103,7 +103,7 @@ function Home(props) { - + Version: {`${process.env.REACT_APP_VERSION}`} @@ -146,12 +146,7 @@ function Home(props) { )} - +
{hasPermission(appContext.user, [ POLICIES.SUPER_PERMISSION, POLICIES.LIST_TREE, @@ -197,7 +192,7 @@ function Home(props) { )} - +
diff --git a/src/components/Home/Home.styles.js b/src/components/Home/Home.styles.js index 89663d742..23d13dff5 100644 --- a/src/components/Home/Home.styles.js +++ b/src/components/Home/Home.styles.js @@ -14,6 +14,7 @@ const styles = (theme) => ({ }, version: { justifyContent: 'space-between', + paddingBlockEnd: '0.5rem', }, timeBox: { display: 'flex', @@ -64,6 +65,12 @@ const styles = (theme) => ({ minWidth: '336px', }, }, + dashstatWraper: { + display: 'flex', + flexDirection: 'row', + gap: '20px', + flexWrap: 'wrap', + }, }); export default styles;