aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/views/admin/UserAdmin.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-04 10:31:34 +0800
committercrupest <crupest@outlook.com>2020-11-04 10:31:34 +0800
commit247f15813f914559846109c32f3a2c0e6d373fac (patch)
treeedd36228f51bfdca2354cd5734028dd490a04350 /FrontEnd/src/app/views/admin/UserAdmin.tsx
parenta581cf642fa0ff06c27e3d3d95af02aec3abd87d (diff)
downloadtimeline-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.tsx22
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);
}}
/>
);