11import reflex as rx
22from pcweb .components .icons import get_icon
3- from pcweb .constants import GITHUB_STARS
3+ from pcweb .github import GithubStarState
4+
45
56def stat_card (stat : str , text : str , icon : str , class_name : str = "" ) -> rx .Component :
67 return rx .box (
@@ -10,15 +11,27 @@ def stat_card(stat: str, text: str, icon: str, class_name: str = "") -> rx.Compo
1011 class_name = "flex flex-row gap-2 items-center" ,
1112 ),
1213 rx .text (stat , class_name = "font-x-large text-slate-12" ),
13- class_name = "flex flex-col gap-2 w-full p-10 items-center lg:items-start" + " " + class_name ,
14+ class_name = "flex flex-col gap-2 w-full p-10 items-center lg:items-start"
15+ + " "
16+ + class_name ,
1417 )
1518
1619
1720def stats_grid () -> rx .Component :
1821 return rx .box (
19- stat_card (stat = f"{ GITHUB_STARS :,} +" , text = "Stars" , icon = "star" , class_name = "lg:!border-l !border-slate-3" ),
20- stat_card (stat = "150+" , text = "Contributors" , icon = "fork" ),
21- stat_card (stat = "5,500+" , text = "Discord" , icon = "discord_navbar" , class_name = "lg:!border-r !border-slate-3" ),
22+ stat_card (
23+ stat = f"{ GithubStarState .stars :,} " ,
24+ text = "Stars" ,
25+ icon = "star" ,
26+ class_name = "lg:!border-l !border-slate-3" ,
27+ ),
28+ stat_card (stat = "150+" , text = "Contributors" , icon = "fork" ),
29+ stat_card (
30+ stat = "5,500+" ,
31+ text = "Discord" ,
32+ icon = "discord_navbar" ,
33+ class_name = "lg:!border-r !border-slate-3" ,
34+ ),
2235 class_name = "grid grid-cols-1 lg:grid-cols-3 gap-0 grid-rows-1 w-full divide-slate-3 lg:divide-x !border-t-0 divide-y lg:divide-y-0" ,
2336 )
2437
0 commit comments