1
1
import Badge from "@material-ui/core/Badge"
2
- import Divider from "@material-ui/core/Divider"
3
- import ListItemIcon from "@material-ui/core/ListItemIcon"
4
- import ListItemText from "@material-ui/core/ListItemText"
5
2
import MenuItem from "@material-ui/core/MenuItem"
6
3
import { fade , makeStyles } from "@material-ui/core/styles"
7
- import AccountIcon from "@material-ui/icons/AccountCircleOutlined"
8
4
import React , { useState } from "react"
9
- import { Link } from "react-router-dom"
10
5
import * as TypesGen from "../../api/typesGenerated"
11
6
import { navHeight } from "../../theme/constants"
12
7
import { BorderedMenu } from "../BorderedMenu/BorderedMenu"
13
8
import { CloseDropdown , OpenDropdown } from "../DropdownArrows/DropdownArrows"
14
- import { DocsIcon } from "../Icons/DocsIcon"
15
- import { LogoutIcon } from "../Icons/LogoutIcon"
16
9
import { UserAvatar } from "../UserAvatar/UserAvatar"
17
- import { UserProfileCard } from "../UserProfileCard/UserProfileCard "
10
+ import { UserDropdownContent } from "../UserDropdownContent/UserDropdownContent "
18
11
19
- export const Language = {
20
- accountLabel : "Account" ,
21
- docsLabel : "Documentation" ,
22
- signOutLabel : "Sign Out" ,
23
- }
24
12
export interface UserDropdownProps {
25
13
user : TypesGen . User
26
14
/**
@@ -68,43 +56,7 @@ export const UserDropdown: React.FC<UserDropdownProps> = ({ isOpen = false, user
68
56
variant = "user-dropdown"
69
57
onClose = { onPopoverClose }
70
58
>
71
- < div className = { styles . userInfo } >
72
- < UserProfileCard user = { user } />
73
-
74
- < Divider />
75
-
76
- < Link to = "/settings/account" className = { styles . link } >
77
- < MenuItem className = { styles . menuItem } onClick = { onPopoverClose } >
78
- < ListItemIcon className = { styles . icon } >
79
- < AccountIcon />
80
- </ ListItemIcon >
81
- < ListItemText primary = { Language . accountLabel } />
82
- </ MenuItem >
83
- </ Link >
84
-
85
- < Divider />
86
-
87
- < a
88
- href = { `https://github.com/coder/coder/tree/${ process . env . CODER_VERSION } /docs` }
89
- target = "_blank"
90
- rel = "noreferrer"
91
- className = { styles . link }
92
- >
93
- < MenuItem className = { styles . menuItem } onClick = { onPopoverClose } >
94
- < ListItemIcon className = { styles . icon } >
95
- < DocsIcon />
96
- </ ListItemIcon >
97
- < ListItemText primary = { Language . docsLabel } />
98
- </ MenuItem >
99
- </ a >
100
-
101
- < MenuItem className = { styles . menuItem } onClick = { onSignOut } >
102
- < ListItemIcon className = { styles . icon } >
103
- < LogoutIcon />
104
- </ ListItemIcon >
105
- < ListItemText primary = { Language . signOutLabel } />
106
- </ MenuItem >
107
- </ div >
59
+ < UserDropdownContent user = { user } onPopoverClose = { onPopoverClose } onSignOut = { onSignOut } />
108
60
</ BorderedMenu >
109
61
</ >
110
62
)
@@ -123,10 +75,6 @@ export const useStyles = makeStyles((theme) => ({
123
75
maxWidth : 300 ,
124
76
} ,
125
77
126
- userInfo : {
127
- marginBottom : theme . spacing ( 1 ) ,
128
- } ,
129
-
130
78
menuItem : {
131
79
height : navHeight ,
132
80
padding : `${ theme . spacing ( 1.5 ) } px ${ theme . spacing ( 2.75 ) } px` ,
@@ -136,13 +84,4 @@ export const useStyles = makeStyles((theme) => ({
136
84
transition : "background-color 0.3s ease" ,
137
85
} ,
138
86
} ,
139
-
140
- link : {
141
- textDecoration : "none" ,
142
- color : "inherit" ,
143
- } ,
144
-
145
- icon : {
146
- color : theme . palette . text . secondary ,
147
- } ,
148
87
} ) )
0 commit comments