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
onSignOut : ( ) => void
@@ -64,41 +52,7 @@ export const UserDropdown: React.FC<UserDropdownProps> = ({ user, onSignOut }: U
64
52
variant = "user-dropdown"
65
53
onClose = { onPopoverClose }
66
54
>
67
- < div className = { styles . userInfo } >
68
- < UserProfileCard user = { user } />
69
-
70
- < Divider />
71
-
72
- < Link to = "/settings/account" className = { styles . link } >
73
- < MenuItem className = { styles . menuItem } onClick = { onPopoverClose } >
74
- < ListItemIcon className = { styles . icon } >
75
- < AccountIcon />
76
- </ ListItemIcon >
77
- < ListItemText primary = { Language . accountLabel } />
78
- </ MenuItem >
79
- </ Link >
80
-
81
- < a
82
- href = { `https://github.com/coder/coder/tree/${ process . env . CODER_VERSION } /docs` }
83
- target = "_blank"
84
- rel = "noreferrer"
85
- className = { styles . link }
86
- >
87
- < MenuItem className = { styles . menuItem } onClick = { onPopoverClose } >
88
- < ListItemIcon className = { styles . icon } >
89
- < DocsIcon />
90
- </ ListItemIcon >
91
- < ListItemText primary = { Language . docsLabel } />
92
- </ MenuItem >
93
- </ a >
94
-
95
- < MenuItem className = { styles . menuItem } onClick = { onSignOut } >
96
- < ListItemIcon className = { styles . icon } >
97
- < LogoutIcon />
98
- </ ListItemIcon >
99
- < ListItemText primary = { Language . signOutLabel } />
100
- </ MenuItem >
101
- </ div >
55
+ < UserDropdownContent user = { user } onPopoverClose = { onPopoverClose } onSignOut = { onSignOut } />
102
56
</ BorderedMenu >
103
57
</ >
104
58
)
@@ -117,10 +71,6 @@ export const useStyles = makeStyles((theme) => ({
117
71
maxWidth : 300 ,
118
72
} ,
119
73
120
- userInfo : {
121
- marginBottom : theme . spacing ( 1 ) ,
122
- } ,
123
-
124
74
menuItem : {
125
75
height : navHeight ,
126
76
padding : `${ theme . spacing ( 1.5 ) } px ${ theme . spacing ( 2.75 ) } px` ,
@@ -130,13 +80,4 @@ export const useStyles = makeStyles((theme) => ({
130
80
transition : "background-color 0.3s ease" ,
131
81
} ,
132
82
} ,
133
-
134
- link : {
135
- textDecoration : "none" ,
136
- color : "inherit" ,
137
- } ,
138
-
139
- icon : {
140
- color : theme . palette . text . secondary ,
141
- } ,
142
83
} ) )
0 commit comments