@@ -33,10 +33,8 @@ function getInitials(name?: string, email?: string): string {
3333 return "?"
3434}
3535
36- const ZOO_CODE_BASE_URL = "https://www.zoocode.dev"
37-
3836export const ZooCodeAuthBadge : React . FC < ZooCodeAuthBadgeProps > = ( { className } ) => {
39- const { zooCodeIsAuthenticated, zooCodeUserName, zooCodeUserEmail, zooCodeUserImage, uriScheme } =
37+ const { zooCodeIsAuthenticated, zooCodeUserName, zooCodeUserEmail, zooCodeUserImage, zooCodeBaseUrl , uriScheme } =
4038 useExtensionState ( )
4139 const [ isOpen , setIsOpen ] = useState ( false )
4240 const [ imageError , setImageError ] = useState ( false )
@@ -58,7 +56,7 @@ export const ZooCodeAuthBadge: React.FC<ZooCodeAuthBadgeProps> = ({ className })
5856 setImageError ( false )
5957 } , [ zooCodeUserImage ] )
6058
61- const authUrl = getZooCodeAuthUrl ( uriScheme )
59+ const authUrl = getZooCodeAuthUrl ( uriScheme , zooCodeBaseUrl )
6260
6361 const showImage = zooCodeIsAuthenticated && zooCodeUserImage && ! imageError
6462 const avatarColor = getAvatarColor ( zooCodeUserEmail || zooCodeUserName || "ZC" )
@@ -87,7 +85,8 @@ export const ZooCodeAuthBadge: React.FC<ZooCodeAuthBadgeProps> = ({ className })
8785 fontSize : zooCodeIsAuthenticated && ! showImage ? 9 : 14 ,
8886 fontWeight : 600 ,
8987 background : zooCodeIsAuthenticated ? ( showImage ? "transparent" : avatarColor ) : undefined ,
90- color : zooCodeIsAuthenticated && ! showImage ? "#ffffff" : undefined ,
88+ color :
89+ zooCodeIsAuthenticated && ! showImage ? "var(--vscode-button-foreground, #ffffff)" : undefined ,
9190 } }
9291 title = { zooCodeIsAuthenticated ? `Zoo Code: ${ zooCodeUserEmail || "Connected" } ` : "Sign in to Zoo Code" } >
9392 { zooCodeIsAuthenticated ? (
@@ -134,8 +133,8 @@ export const ZooCodeAuthBadge: React.FC<ZooCodeAuthBadgeProps> = ({ className })
134133 "overflow-hidden" ,
135134 ) }
136135 style = { {
137- background : "#1e1e1e " ,
138- border : "1px solid #3c3c3c" ,
136+ background : "var(--vscode-menu-background) " ,
137+ border : "1px solid var(--vscode-menu-border, var(--vscode-widget-border, #3c3c3c)) " ,
139138 zIndex : 9999 ,
140139 } } >
141140 { ! zooCodeIsAuthenticated ? (
@@ -144,9 +143,11 @@ export const ZooCodeAuthBadge: React.FC<ZooCodeAuthBadgeProps> = ({ className })
144143 onClick = { ( ) => setIsOpen ( false ) }
145144 className = { cn ( "block px-3.5 py-2.5" , "text-[13px]" , "no-underline cursor-pointer" ) }
146145 style = { {
147- color : "#cccccc " ,
146+ color : "var(--vscode-menu-foreground) " ,
148147 } }
149- onMouseEnter = { ( e ) => ( e . currentTarget . style . background = "#094771" ) }
148+ onMouseEnter = { ( e ) =>
149+ ( e . currentTarget . style . background = "var(--vscode-menu-selectionBackground)" )
150+ }
150151 onMouseLeave = { ( e ) => ( e . currentTarget . style . background = "transparent" ) } >
151152 Sign in to Zoo Code
152153 </ a >
@@ -160,20 +161,23 @@ export const ZooCodeAuthBadge: React.FC<ZooCodeAuthBadgeProps> = ({ className })
160161 "pointer-events-none select-none" ,
161162 ) }
162163 style = { {
163- color : "#858585" ,
164- borderBottom : "1px solid #3c3c3c" ,
164+ color : "var(--vscode-descriptionForeground)" ,
165+ borderBottom :
166+ "1px solid var(--vscode-menu-separatorBackground, var(--vscode-widget-border, #3c3c3c))" ,
165167 } } >
166168 { zooCodeUserEmail }
167169 </ div >
168170 ) }
169171 < a
170- href = { `${ ZOO_CODE_BASE_URL } /dashboard` }
172+ href = { `${ zooCodeBaseUrl || "https://www.zoocode.dev" } /dashboard` }
171173 onClick = { ( ) => setIsOpen ( false ) }
172174 className = { cn ( "block px-3.5 py-2.5" , "text-[13px]" , "no-underline cursor-pointer" ) }
173175 style = { {
174- color : "#cccccc " ,
176+ color : "var(--vscode-menu-foreground) " ,
175177 } }
176- onMouseEnter = { ( e ) => ( e . currentTarget . style . background = "#094771" ) }
178+ onMouseEnter = { ( e ) =>
179+ ( e . currentTarget . style . background = "var(--vscode-menu-selectionBackground)" )
180+ }
177181 onMouseLeave = { ( e ) => ( e . currentTarget . style . background = "transparent" ) } >
178182 Go to Dashboard
179183 </ a >
@@ -186,9 +190,11 @@ export const ZooCodeAuthBadge: React.FC<ZooCodeAuthBadgeProps> = ({ className })
186190 "text-left cursor-pointer" ,
187191 ) }
188192 style = { {
189- color : "#f14c4c " ,
193+ color : "var(--vscode-errorForeground) " ,
190194 } }
191- onMouseEnter = { ( e ) => ( e . currentTarget . style . background = "#094771" ) }
195+ onMouseEnter = { ( e ) =>
196+ ( e . currentTarget . style . background = "var(--vscode-menu-selectionBackground)" )
197+ }
192198 onMouseLeave = { ( e ) => ( e . currentTarget . style . background = "transparent" ) } >
193199 Sign out
194200 </ button >
0 commit comments