@@ -49,6 +49,7 @@ interface SidebarProps {
49
49
}
50
50
51
51
export function AppSidebar ( { isOpen, onClose, canvasColor, setCanvasColor, isMobile, roomName, isStandalone, onClearCanvas, onExportCanvas, onImportCanvas } : SidebarProps ) {
52
+ const [ stars , setStars ] = useState < number | null > ( null ) ;
52
53
const [ clearDialogOpen , setClearDialogOpen ] = useState ( false ) ;
53
54
const { theme, setTheme } = useTheme ( ) ;
54
55
const { data : session } = useSession ( ) ;
@@ -83,6 +84,19 @@ export function AppSidebar({ isOpen, onClose, canvasColor, setCanvasColor, isMob
83
84
return ( ) => document . body . classList . remove ( "overflow-hidden" )
84
85
} , [ isOpen ] )
85
86
87
+ useEffect ( ( ) => {
88
+ const fetchRepoMetaData = async ( ) => {
89
+ try {
90
+ const res = await fetch ( 'https://api.github.com/repos/coderomm/CollabyDraw' ) ;
91
+ const data = await res . json ( ) ;
92
+ setStars ( data . stargazers_count ) ;
93
+ } catch ( error ) {
94
+ console . error ( 'Error fetching GitHub repo data:' , error ) ;
95
+ }
96
+ }
97
+ fetchRepoMetaData ( ) ;
98
+ } , [ ] )
99
+
86
100
return (
87
101
< >
88
102
< ClearCanvasDialog
@@ -136,14 +150,14 @@ export function AppSidebar({ isOpen, onClose, canvasColor, setCanvasColor, isMob
136
150
< Link
137
151
className = { cn (
138
152
buttonVariants ( { variant : "ghost" } ) ,
139
- "flex flex-row items-center justify-start gap-2 h-10 w-auto rounded-md px-3 text-sm font-medium transition-colors text-color-on-surface hover:text-color-on-surface bg-transparent hover:bg-button-hover-bg focus-visible:shadow-brand-color-shadow focus-visible:outline-none focus-visible:ring-0 active:bg-button-hover-bg active:border active:border-brand-active dark:hover:bg-w-button-hover-bg border border-[#705400] bg-[#FFE599]"
153
+ "flex flex-row items-center justify-start gap-2 h-10 w-auto rounded-md px-3 text-sm font-medium transition-colors text-white dark:text-black hover:text-color-on-surface bg-transparent hover:bg-button-hover-bg focus-visible:shadow-brand-color-shadow focus-visible:outline-none focus-visible:ring-0 active:bg-button-hover-bg active:border active:border-brand-active dark:hover:bg-w-button-hover-bg border border-[#705400] bg-[#FFE599]"
140
154
) }
141
155
href = "https://github.com/coderomm/CollabyDraw"
142
156
target = "_blank"
143
157
rel = "noopener noreferrer"
144
158
title = "GitHub"
145
159
>
146
- < Github className = "h-4 w-4" /> GitHub - < span className = "flex items-center justify-start gap-1" > 7 < Star className = "h-4 w-4" /> </ span >
160
+ < Github className = "h-4 w-4" /> GitHub - < span className = "flex items-center justify-start gap-1" > { stars } < Star className = "h-4 w-4" /> </ span >
147
161
</ Link >
148
162
< SidebarLinkItem icon = { Twitter } label = "Twitter / X" url = "https://x.com/1omsharma" />
149
163
< SidebarLinkItem icon = { Linkedin } label = "Linkedin" url = "https://www.linkedin.com/in/1omsharma" />
0 commit comments