diff options
author | crupest <crupest@outlook.com> | 2020-11-04 10:31:34 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-11-04 10:31:34 +0800 |
commit | 247f15813f914559846109c32f3a2c0e6d373fac (patch) | |
tree | edd36228f51bfdca2354cd5734028dd490a04350 /FrontEnd/src/app/views/admin/UserAdmin.tsx | |
parent | a581cf642fa0ff06c27e3d3d95af02aec3abd87d (diff) | |
download | timeline-247f15813f914559846109c32f3a2c0e6d373fac.tar.gz timeline-247f15813f914559846109c32f3a2c0e6d373fac.tar.bz2 timeline-247f15813f914559846109c32f3a2c0e6d373fac.zip |
refactor: Refactor operation dialog.
Diffstat (limited to 'FrontEnd/src/app/views/admin/UserAdmin.tsx')
-rw-r--r-- | FrontEnd/src/app/views/admin/UserAdmin.tsx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/FrontEnd/src/app/views/admin/UserAdmin.tsx b/FrontEnd/src/app/views/admin/UserAdmin.tsx index 18b77ca8..0f5f8796 100644 --- a/FrontEnd/src/app/views/admin/UserAdmin.tsx +++ b/FrontEnd/src/app/views/admin/UserAdmin.tsx @@ -152,16 +152,18 @@ const CreateUserDialog: React.FC<CreateUserDialogProps> = (props) => { title="Create" titleColor="create" inputPrompt="You are creating a new user." - inputScheme={[ - { type: "text", label: "Username" }, - { type: "text", label: "Password" }, - { type: "bool", label: "Administrator" }, - ]} + inputScheme={ + [ + { type: "text", label: "Username" }, + { type: "text", label: "Password" }, + { type: "bool", label: "Administrator" }, + ] as const + } onProcess={([username, password, administrator]) => props.process({ - username: username as string, - password: password as string, - administrator: administrator as boolean, + username: username, + password: password, + administrator: administrator, }) } close={props.close} @@ -221,7 +223,7 @@ const UserChangeUsernameDialog: React.FC<UserModifyDialogProps<string>> = ( )} inputScheme={[{ type: "text", label: "New Username" }]} onProcess={([newUsername]) => { - return props.process(newUsername as string); + return props.process(newUsername); }} /> ); @@ -245,7 +247,7 @@ const UserChangePasswordDialog: React.FC<UserModifyDialogProps<string>> = ( )} inputScheme={[{ type: "text", label: "New Password" }]} onProcess={([newPassword]) => { - return props.process(newPassword as string); + return props.process(newPassword); }} /> ); |