({isCollapsed, onCollapsedChange}: ProfileMenuProps)
| 88 | } |
| 89 | |
| 90 | function ProfileMenu({isCollapsed, onCollapsedChange}: ProfileMenuProps) { |
| 91 | return ( |
| 92 | <MenuTrigger> |
| 93 | <ActionButton isQuiet aria-label="Account"> |
| 94 | <Avatar src="https://i.imgur.com/xIe7Wlb.png" /> |
| 95 | </ActionButton> |
| 96 | <Popover hideArrow placement="bottom end"> |
| 97 | <div className={style({paddingTop: 4, display: 'flex', flexDirection: 'column', gap: 12})}> |
| 98 | <div className={style({display: 'flex', gap: 12, alignItems: 'center', marginX: 12})}> |
| 99 | <Avatar src="https://i.imgur.com/xIe7Wlb.png" size={56} /> |
| 100 | <div> |
| 101 | <div className={style({font: 'title'})}>Thor Odenson</div> |
| 102 | <div className={style({font: 'ui', color: 'body'})}>thor@example.com</div> |
| 103 | </div> |
| 104 | </div> |
| 105 | <Divider styles={style({marginX: 12})} /> |
| 106 | <Menu aria-label="Account"> |
| 107 | <MenuSection> |
| 108 | <Header> |
| 109 | <Heading>Settings</Heading> |
| 110 | </Header> |
| 111 | <MenuItem onAction={() => onCollapsedChange(!isCollapsed)}> |
| 112 | {isCollapsed ? <ChevronDoubleRight /> : <ChevronDoubleLeft />} |
| 113 | <Text slot="label"> |
| 114 | {isCollapsed ? 'Expand side panel' : 'Collapse side panel'} |
| 115 | </Text> |
| 116 | </MenuItem> |
| 117 | <MenuItem> |
| 118 | <Settings /> |
| 119 | <Text slot="label">Preferences</Text> |
| 120 | </MenuItem> |
| 121 | </MenuSection> |
| 122 | <MenuSection aria-label="Session"> |
| 123 | <MenuItem>Sign out</MenuItem> |
| 124 | </MenuSection> |
| 125 | </Menu> |
| 126 | </div> |
| 127 | </Popover> |
| 128 | </MenuTrigger> |
| 129 | ); |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * A miniature application frame used by the SideNavPanel examples. It provides a header, |
nothing calls this directly
no outgoing calls
no test coverage detected