-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
/
MuiStatistics.tsx
58 lines (56 loc) · 1.59 KB
/
MuiStatistics.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import * as React from 'react';
import Box from '@mui/material/Box';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';
const data = [
{ title: '4M', metadata: 'Weekly downloads on npm' },
{ title: '83k', metadata: 'Stars on GitHub' },
{ title: '2.6k', metadata: 'Open-source contributors' },
{ title: '18.1k', metadata: 'Followers on Twitter' },
];
export default function MuiStatistics() {
return (
<Grid item xs={12} md={6} container spacing={4}>
{data.map((item) => (
<Grid key={item.title} item xs={6}>
<Box
sx={(theme) => ({
height: '100%',
p: 0.5,
pl: 2,
borderLeft: '2px solid',
borderColor: 'primary.100',
...theme.applyDarkStyles({
borderColor: 'primaryDark.600',
}),
})}
>
<Typography
component="div"
variant="h4"
fontWeight="bold"
sx={(theme) => ({
color: 'primary.main',
...theme.applyDarkStyles({
color: 'primary.200',
}),
})}
>
{item.title}
</Typography>
<Typography
sx={(theme) => ({
color: 'grey.800',
...theme.applyDarkStyles({
color: 'grey.300',
}),
})}
>
{item.metadata}
</Typography>
</Box>
</Grid>
))}
</Grid>
);
}