Skip to content

Commit b72d99e

Browse files
authored
[fix] Refactors event forms to improve type field handling (#207)
1 parent 7288694 commit b72d99e

2 files changed

Lines changed: 20 additions & 18 deletions

File tree

src/Components/Event/EventEditor.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ export function EventEditor({ Event }: { Event: Models.IEvent }) {
4747
e.preventDefault();
4848
OnSubmit().then(() => setFalse());
4949
}}>
50-
<ScaleTextField
51-
placeholder="Please give the title of event"
52-
required
53-
label="Title"
54-
value={State.title}
55-
onScale-input={(e) => Actions.setTitle(e.target.value as string)}
56-
invalid={!!Validation.title}
57-
helperText={Validation.title}
58-
/>
5950

6051
<ScaleDropdownSelect
6152
label="Type"
@@ -71,6 +62,16 @@ export function EventEditor({ Event }: { Event: Models.IEvent }) {
7162
</ScaleDropdownSelectItem>)}
7263
</ScaleDropdownSelect>
7364

65+
<ScaleTextField
66+
placeholder="Please give the title of event"
67+
required
68+
label="Title"
69+
value={State.title}
70+
onScale-input={(e) => Actions.setTitle(e.target.value as string)}
71+
invalid={!!Validation.title}
72+
helperText={Validation.title}
73+
/>
74+
7475
<ScaleDropdownSelect
7576
label="Status"
7677
value={State.status}

src/Components/New/NewForm.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@ export function NewForm() {
3636
OnSubmit();
3737
}}
3838
>
39-
<ScaleTextField
40-
placeholder="Please give the title of event"
41-
required
42-
label="Title"
43-
value={State.title}
44-
onScale-input={(e) => Actions.setTitle(e.target.value as string)}
45-
invalid={!!Validation.title}
46-
helperText={Validation.title}
47-
/>
4839

4940
<ScaleDropdownSelect
5041
label="Type"
@@ -59,6 +50,16 @@ export function NewForm() {
5950
</ScaleDropdownSelectItem>)}
6051
</ScaleDropdownSelect>
6152

53+
<ScaleTextField
54+
placeholder="Please give the title of event"
55+
required
56+
label="Title"
57+
value={State.title}
58+
onScale-input={(e) => Actions.setTitle(e.target.value as string)}
59+
invalid={!!Validation.title}
60+
helperText={Validation.title}
61+
/>
62+
6263
<ScaleTextarea
6364
placeholder="If there is any known information, please write it down here."
6465
resize="vertical"

0 commit comments

Comments
 (0)