Skip to content

Commit 4e20fd6

Browse files
committed
Refactors ScaleDropdownSelect placement in EventEditor
Moves the ScaleDropdownSelect for event type to a new position in the form for improved layout and usability. Ensures that the component remains correctly enabled or disabled based on the event type, maintaining validation and helper text functionality. Enhances the user experience by streamlining the event input process.
1 parent 335cd7d commit 4e20fd6

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

src/Components/Event/EventEditor.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,28 @@ export function EventEditor({ Event }: { Event: Models.IEvent }) {
4040
class="absolute"
4141
onScale-before-close={(e) => e.preventDefault()}
4242
>
43-
44-
<ScaleDropdownSelect
45-
label="Type"
46-
value={State.type}
47-
disabled={!IsIncident(Event.Type)}
48-
onScale-change={(e) => Actions.setType(e.target.value as EventType)}
49-
invalid={!!Validation.type}
50-
helperText={Validation.type}
51-
>
52-
{Object.values(EventType).slice(2, 5).map((type, i) =>
53-
<ScaleDropdownSelectItem value={type} key={i}>
54-
{type}
55-
</ScaleDropdownSelectItem>)}
56-
</ScaleDropdownSelect>
57-
5843
<form
5944
className="flex flex-col gap-y-6"
6045
autoComplete="off"
6146
onSubmit={(e) => {
6247
e.preventDefault();
6348
OnSubmit().then(() => setFalse());
6449
}}>
50+
51+
<ScaleDropdownSelect
52+
label="Type"
53+
value={State.type}
54+
disabled={!IsIncident(Event.Type)}
55+
onScale-change={(e) => Actions.setType(e.target.value as EventType)}
56+
invalid={!!Validation.type}
57+
helperText={Validation.type}
58+
>
59+
{Object.values(EventType).slice(2, 5).map((type, i) =>
60+
<ScaleDropdownSelectItem value={type} key={i}>
61+
{type}
62+
</ScaleDropdownSelectItem>)}
63+
</ScaleDropdownSelect>
64+
6565
<ScaleTextField
6666
placeholder="Please give the title of event"
6767
required

0 commit comments

Comments
 (0)