1
1
import React from 'react' ;
2
- import styles from './CommunityStats.module.css ' ;
2
+ import { cn } from '../../cn ' ;
3
3
4
4
// StatItemContent component
5
5
const StatItemContent : React . FC < {
@@ -39,12 +39,25 @@ const StatItemContent: React.FC<{
39
39
</ div >
40
40
) ;
41
41
42
- export const InstallsPerMonth : React . FC = ( ) => {
42
+ const Pill : React . FC < {
43
+ readonly children : React . ReactNode ;
44
+ readonly className ?: string ;
45
+ } > = ( { children, className} ) => {
43
46
return (
44
47
< div
45
- className = { styles . statItem }
46
- style = { { width : '30%' , flexDirection : 'column' } }
48
+ className = { cn (
49
+ className ,
50
+ 'card leading-none flex flex-wrap justify-center items-center min-w-[200px] min-h-[80px] max-h-[110px] flex-1 p-0' ,
51
+ ) }
47
52
>
53
+ { children }
54
+ </ div >
55
+ ) ;
56
+ } ;
57
+
58
+ export const InstallsPerMonth : React . FC = ( ) => {
59
+ return (
60
+ < Pill className = { 'w-[30%] flex-col' } >
48
61
< div
49
62
style = { {
50
63
display : 'flex' ,
@@ -82,16 +95,13 @@ export const InstallsPerMonth: React.FC = () => {
82
95
fontSize = "1.0rem"
83
96
fontWeight = "bold"
84
97
/>
85
- </ div >
98
+ </ Pill >
86
99
) ;
87
100
} ;
88
101
89
102
export const PagesOfDocs : React . FC = ( ) => {
90
103
return (
91
- < div
92
- className = { styles . statItem }
93
- style = { { width : '30%' , flexDirection : 'column' } }
94
- >
104
+ < Pill className = "flex-col" >
95
105
< div style = { { display : 'flex' , alignItems : 'center' } } >
96
106
< StatItemContent
97
107
content = {
@@ -124,19 +134,12 @@ export const PagesOfDocs: React.FC = () => {
124
134
fontSize = "1.0rem"
125
135
fontWeight = "bold"
126
136
/>
127
- </ div >
137
+ </ Pill >
128
138
) ;
129
139
} ;
130
140
131
141
export const TemplatesAndExamples : React . FC = ( ) => (
132
- < div
133
- className = { styles . statItem }
134
- style = { {
135
- width : '30%' ,
136
- display : 'flex' ,
137
- alignItems : 'center' ,
138
- } }
139
- >
142
+ < Pill className = "w-[30%] flex items-center" >
140
143
< StatItemContent
141
144
content = "35"
142
145
width = "60px"
@@ -149,15 +152,12 @@ export const TemplatesAndExamples: React.FC = () => (
149
152
fontSize = "1.35rem"
150
153
fontWeight = "bold"
151
154
/>
152
- </ div >
155
+ </ Pill >
153
156
) ;
154
157
155
158
export const GitHubStars : React . FC = ( ) => {
156
159
return (
157
- < div
158
- className = { styles . statItem }
159
- style = { { width : '30%' , flexDirection : 'column' } }
160
- >
160
+ < Pill className = "w-[30%] flex-col" >
161
161
< div style = { { display : 'flex' , alignItems : 'center' } } >
162
162
< StatItemContent
163
163
content = {
@@ -189,13 +189,13 @@ export const GitHubStars: React.FC = () => {
189
189
fontSize = "1.0rem"
190
190
fontWeight = "bold"
191
191
/>
192
- </ div >
192
+ </ Pill >
193
193
) ;
194
194
} ;
195
195
196
196
export const DiscordMembers : React . FC = ( ) => {
197
197
return (
198
- < div className = { styles . statItem } style = { { width : ' 30%' } } >
198
+ < Pill className = { 'w-[ 30%]' } >
199
199
< div
200
200
style = { {
201
201
width : '80%' ,
@@ -250,21 +250,13 @@ export const DiscordMembers: React.FC = () => {
250
250
/>
251
251
</ div >
252
252
</ div >
253
- </ div >
253
+ </ Pill >
254
254
) ;
255
255
} ;
256
256
257
257
export const Contributors : React . FC = ( ) => {
258
258
return (
259
- < div
260
- className = { styles . statItem }
261
- style = { {
262
- width : '30%' ,
263
- display : 'flex' ,
264
- alignItems : 'center' ,
265
- justifyContent : 'center' ,
266
- } }
267
- >
259
+ < Pill className = "w-[30%]" >
268
260
< div style = { { display : 'flex' , justifyContent : 'center' } } >
269
261
< div style = { { display : 'flex' , justifyContent : 'center' } } >
270
262
< StatItemContent
@@ -307,6 +299,6 @@ export const Contributors: React.FC = () => {
307
299
/>
308
300
</ div >
309
301
</ div >
310
- </ div >
302
+ </ Pill >
311
303
) ;
312
304
} ;
0 commit comments