@@ -16,6 +16,7 @@ import Alert from "../components/Alert";
16
16
import { TextInputField } from "../components/forms/TextInputField" ;
17
17
import isEmail from "validator/lib/isEmail" ;
18
18
import { useToast } from "../components/toasts/Toasts" ;
19
+ import { InputWithCopy } from "../components/InputWithCopy" ;
19
20
20
21
export default function Account ( ) {
21
22
const { user, setUser } = useContext ( UserContext ) ;
@@ -103,6 +104,7 @@ export default function Account() {
103
104
} }
104
105
errorMessage = { errorMessage }
105
106
emailIsReadonly = { ! canUpdateEmail }
107
+ user = { user }
106
108
>
107
109
< div className = "flex flex-row mt-8" >
108
110
< Button htmlType = "submit" > Update Profile</ Button >
@@ -126,6 +128,7 @@ function ProfileInformation(props: {
126
128
setProfileState : ( newState : User . Profile ) => void ;
127
129
errorMessage : string ;
128
130
emailIsReadonly ?: boolean ;
131
+ user ?: User ;
129
132
children ?: React . ReactChild [ ] | React . ReactChild ;
130
133
} ) {
131
134
return (
@@ -141,7 +144,7 @@ function ProfileInformation(props: {
141
144
</ Alert >
142
145
) }
143
146
< div className = "flex flex-col lg:flex-row" >
144
- < div >
147
+ < fieldset >
145
148
< TextInputField
146
149
label = "Name"
147
150
value = { props . profileState . name }
@@ -155,7 +158,15 @@ function ProfileInformation(props: {
155
158
props . setProfileState ( { ...props . profileState , email : val } ) ;
156
159
} }
157
160
/>
158
- </ div >
161
+ { props . user && (
162
+ < div className = "flex flex-col space-y-2 mt-4" >
163
+ < label className = { "text-md font-semibold dark:text-gray-400 text-gray-600" } > User ID</ label >
164
+ < p className = { "text-sm text-gray-500 dark:text-gray-500" } >
165
+ < InputWithCopy className = "max-w-md w-32" value = { props . user . id } tip = "Copy Token" />
166
+ </ p >
167
+ </ div >
168
+ ) }
169
+ </ fieldset >
159
170
< div className = "lg:pl-14" >
160
171
< div className = "mt-4" >
161
172
< Subheading > Avatar</ Subheading >
0 commit comments