From 0119fe5de5a3d12a67c42f62701b7fdbb03e2f91 Mon Sep 17 00:00:00 2001 From: Simon Nedjari Date: Mon, 27 May 2024 11:57:14 +0200 Subject: [PATCH 1/5] create StastCard component --- .../dashboard-statistics/cards/StatsCard.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/components/admin/dashboard-statistics/cards/StatsCard.tsx diff --git a/src/components/admin/dashboard-statistics/cards/StatsCard.tsx b/src/components/admin/dashboard-statistics/cards/StatsCard.tsx new file mode 100644 index 000000000..5806d779f --- /dev/null +++ b/src/components/admin/dashboard-statistics/cards/StatsCard.tsx @@ -0,0 +1,18 @@ +import React from 'react'; + +import styles from './StatsCard.module.css'; + +interface StatsCardProps { + children: React.ReactNode; + data: number; +} +const StatsCard = ({ children, data }: StatsCardProps) => { + return ( +
+

{children}

+

{data}

+
+ ); +}; + +export default StatsCard; From e867dd6a602e447b351cbd97194f3331700085c4 Mon Sep 17 00:00:00 2001 From: Simon Nedjari Date: Mon, 27 May 2024 11:58:44 +0200 Subject: [PATCH 2/5] add StatsCard.module.css --- .../cards/StatsCard.module.css | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/components/admin/dashboard-statistics/cards/StatsCard.module.css diff --git a/src/components/admin/dashboard-statistics/cards/StatsCard.module.css b/src/components/admin/dashboard-statistics/cards/StatsCard.module.css new file mode 100644 index 000000000..94f559949 --- /dev/null +++ b/src/components/admin/dashboard-statistics/cards/StatsCard.module.css @@ -0,0 +1,24 @@ +.cardContainer { + background: linear-gradient(0deg, #6065FC, #6065FC), + radial-gradient(69.64% 69.64% at 51.53% 21.25%, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 100%); + text-align: center; + padding: 1rem; + border-radius: 1rem; + width: 240px; + flex-wrap: wrap; + color: #FFF; +} + +.cardContainer>p { + margin: 0; + padding: 0; +} + +.cardContainer>p:first-child { + font-size: 1.25rem; +} + +.cardContainer>p:last-child { + font-size: 2rem; + font-weight: 600; +} \ No newline at end of file From 316978f499a948a1da9b807a420706e5549a19df Mon Sep 17 00:00:00 2001 From: Simon Nedjari Date: Mon, 27 May 2024 12:02:24 +0200 Subject: [PATCH 3/5] add Stats Card to Global page --- src/components/admin/dashboard-statistics/GlobalStats.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/admin/dashboard-statistics/GlobalStats.tsx b/src/components/admin/dashboard-statistics/GlobalStats.tsx index 8151e343e..0a67fb101 100644 --- a/src/components/admin/dashboard-statistics/GlobalStats.tsx +++ b/src/components/admin/dashboard-statistics/GlobalStats.tsx @@ -1,7 +1,12 @@ import React from 'react'; +import StatsCard from './cards/StatsCard'; const GlobalStats = () => { - return

1Village

; + return (
+ Nombre de classes inscrites + Nombre de classes connectées + Nombre de classes contributrices +
) }; export default GlobalStats; From 8ed1b66a71b5b2ce7f0d79e08c038e9c79d524dc Mon Sep 17 00:00:00 2001 From: Simon Nedjari Date: Mon, 27 May 2024 12:02:56 +0200 Subject: [PATCH 4/5] add StatsCard to global stats --- .../admin/dashboard-statistics/GlobalStats.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/admin/dashboard-statistics/GlobalStats.tsx b/src/components/admin/dashboard-statistics/GlobalStats.tsx index 0a67fb101..10a93eab8 100644 --- a/src/components/admin/dashboard-statistics/GlobalStats.tsx +++ b/src/components/admin/dashboard-statistics/GlobalStats.tsx @@ -1,12 +1,15 @@ import React from 'react'; + import StatsCard from './cards/StatsCard'; const GlobalStats = () => { - return (
- Nombre de classes inscrites - Nombre de classes connectées - Nombre de classes contributrices -
) + return ( +
+ Nombre de classes inscrites + Nombre de classes connectées + Nombre de classes contributrices +
+ ); }; export default GlobalStats; From a1ca7fb8e115a0537b80c1733a7632c32bdc8a9f Mon Sep 17 00:00:00 2001 From: Simon Nedjari Date: Mon, 27 May 2024 12:03:57 +0200 Subject: [PATCH 5/5] remove other StatsCard --- src/components/admin/dashboard-statistics/GlobalStats.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/admin/dashboard-statistics/GlobalStats.tsx b/src/components/admin/dashboard-statistics/GlobalStats.tsx index 10a93eab8..e5ac3ae20 100644 --- a/src/components/admin/dashboard-statistics/GlobalStats.tsx +++ b/src/components/admin/dashboard-statistics/GlobalStats.tsx @@ -6,8 +6,6 @@ const GlobalStats = () => { return (
Nombre de classes inscrites - Nombre de classes connectées - Nombre de classes contributrices
); };