1
- import { UserCircleIcon } from "@heroicons/react/24/outline " ;
1
+ import { UserCircleIcon } from "@heroicons/react/24/solid " ;
2
2
3
3
import { SecondaryButton } from "../../components" ;
4
4
import {
@@ -8,10 +8,13 @@ import {
8
8
Transition ,
9
9
} from "../../components/ui" ;
10
10
import { useAuth } from "../../context/Auth" ;
11
+ import { selectSelectedOrganization } from "../../redux" ;
12
+ import { useAppSelector } from "../../redux/hooks" ;
11
13
import { ScopeSelect } from "./ScopeSelect" ;
12
14
13
15
export function AccountButton ( ) {
14
16
const { session, logout, login, organizations } = useAuth ( ) ;
17
+ const selectedOrg = useAppSelector ( selectSelectedOrganization ) ;
15
18
16
19
if ( ! session ) {
17
20
return (
@@ -26,8 +29,13 @@ export function AccountButton() {
26
29
27
30
return (
28
31
< Popover className = "relative" >
29
- < PopoverButton className = "bg-vsc-background hover:bg-vsc-input-background text-vsc-foreground flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border-none" >
30
- < UserCircleIcon className = "h-6 w-6" />
32
+ < PopoverButton className = "bg-vsc-background hover:bg-vsc-input-background text-vsc-foreground my-0.5 flex cursor-pointer rounded-md border-none px-2" >
33
+ < div className = "flex items-center gap-1.5" >
34
+ < span className = "font-medium" >
35
+ { selectedOrg === null ? "Personal" : selectedOrg . name }
36
+ </ span >
37
+ < UserCircleIcon className = "h-6 w-6" /> { " " }
38
+ </ div >
31
39
</ PopoverButton >
32
40
33
41
< Transition >
@@ -39,15 +47,17 @@ export function AccountButton() {
39
47
{ session . account . id }
40
48
</ span >
41
49
</ div >
50
+
42
51
{ organizations . length > 0 && (
43
52
< div className = "flex flex-col gap-1" >
44
- < label className = "text-vsc-foreground text-sm " >
53
+ < label className = "text-vsc-foreground text-xs " >
45
54
Organization
46
55
</ label >
47
56
< ScopeSelect />
48
57
</ div >
49
58
) }
50
- < SecondaryButton onClick = { logout } className = "" >
59
+
60
+ < SecondaryButton onClick = { logout } className = "!mx-0 w-full" >
51
61
Sign out
52
62
</ SecondaryButton >
53
63
</ div >
0 commit comments