@@ -49,6 +49,7 @@ interface SidebarProps {
4949}
5050
5151export function AppSidebar ( { isOpen, onClose, canvasColor, setCanvasColor, isMobile, roomName, isStandalone, onClearCanvas, onExportCanvas, onImportCanvas } : SidebarProps ) {
52+ const [ stars , setStars ] = useState < number | null > ( null ) ;
5253 const [ clearDialogOpen , setClearDialogOpen ] = useState ( false ) ;
5354 const { theme, setTheme } = useTheme ( ) ;
5455 const { data : session } = useSession ( ) ;
@@ -83,6 +84,19 @@ export function AppSidebar({ isOpen, onClose, canvasColor, setCanvasColor, isMob
8384 return ( ) => document . body . classList . remove ( "overflow-hidden" )
8485 } , [ isOpen ] )
8586
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+
86100 return (
87101 < >
88102 < ClearCanvasDialog
@@ -136,14 +150,14 @@ export function AppSidebar({ isOpen, onClose, canvasColor, setCanvasColor, isMob
136150 < Link
137151 className = { cn (
138152 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]"
140154 ) }
141155 href = "https://github.com/coderomm/CollabyDraw"
142156 target = "_blank"
143157 rel = "noopener noreferrer"
144158 title = "GitHub"
145159 >
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 >
147161 </ Link >
148162 < SidebarLinkItem icon = { Twitter } label = "Twitter / X" url = "https://x.com/1omsharma" />
149163 < SidebarLinkItem icon = { Linkedin } label = "Linkedin" url = "https://www.linkedin.com/in/1omsharma" />
0 commit comments