Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
db5f2ae7
Commit
db5f2ae7
authored
Dec 07, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
custom media 4 homepage stats
parent
fea7d736
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
StatsItem.tsx
ui/home/StatsItem.tsx
+19
-2
No files found.
ui/home/StatsItem.tsx
View file @
db5f2ae7
import
{
Flex
,
Icon
,
Text
,
useColorModeValue
,
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
breakpoints
from
'
theme/foundations/breakpoints
'
;
type
Props
=
{
icon
:
React
.
FC
<
React
.
SVGAttributes
<
SVGElement
>>
;
title
:
string
;
...
...
@@ -8,13 +10,24 @@ type Props = {
className
?:
string
;
}
const
LARGEST_BREAKPOINT
=
'
1240px
'
;
const
StatsItem
=
({
icon
,
title
,
value
,
className
}:
Props
)
=>
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const
sxContainer
=
{}
as
any
;
sxContainer
[
`@media screen and (min-width:
${
breakpoints
.
lg
}
) and (max-width:
${
LARGEST_BREAKPOINT
}
)`
]
=
{
flexDirection
:
'
column
'
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const
sxText
=
{}
as
any
;
sxText
[
`@media screen and (min-width:
${
breakpoints
.
lg
}
) and (max-width:
${
LARGEST_BREAKPOINT
}
)`
]
=
{
alignItems
:
'
center
'
};
return
(
<
Flex
backgroundColor=
{
useColorModeValue
(
'
blue.50
'
,
'
blue.800
'
)
}
padding=
{
3
}
borderRadius=
"md"
flexDirection=
{
{
base
:
'
row
'
,
lg
:
'
column
'
,
xl
:
'
row
'
}
}
flexDirection=
"row"
sx=
{
sxContainer
}
alignItems=
"center"
columnGap=
{
3
}
rowGap=
{
2
}
...
...
@@ -22,7 +35,11 @@ const StatsItem = ({ icon, title, value, className }: Props) => {
color=
{
useColorModeValue
(
'
black
'
,
'
white
'
)
}
>
<
Icon
as=
{
icon
}
boxSize=
{
7
}
/>
<
Flex
flexDirection=
"column"
alignItems=
{
{
base
:
'
start
'
,
lg
:
'
center
'
,
xl
:
'
start
'
}
}
>
<
Flex
flexDirection=
"column"
alignItems=
"start"
sx=
{
sxText
}
>
<
Text
variant=
"secondary"
fontSize=
"xs"
lineHeight=
"16px"
>
{
title
}
</
Text
>
<
Text
fontWeight=
{
500
}
fontSize=
"md"
color=
{
useColorModeValue
(
'
black
'
,
'
white
'
)
}
>
{
value
}
</
Text
>
</
Flex
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment