Skip to content

Commit

Permalink
💄 Move todo modal buttons to footer
Browse files Browse the repository at this point in the history
Prevents overflow and makes them easier to reach on mobile
  • Loading branch information
homostellaris committed Jul 20, 2024
1 parent cb95b4b commit fa39a39
Showing 1 changed file with 31 additions and 26 deletions.
57 changes: 31 additions & 26 deletions components/todos/TodoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
IonButton,
IonButtons,
IonContent,
IonFooter,
IonHeader,
IonIcon,
IonInput,
Expand Down Expand Up @@ -60,32 +61,6 @@ export default function TodoModal({
<IonHeader>
<IonToolbar>
<IonTitle slot="start">{title}</IonTitle>
<IonButtons slot="secondary">
<IonButton
role="cancel"
onClick={() => dismiss(null, 'cancel')}
>
Cancel
</IonButton>
</IonButtons>
<IonButtons slot="primary">
<IonButton
onClick={() => {
dismiss(
{
...todo,
title: input.current?.value,
note: noteInput.current?.value,
},
'confirm',
)
}}
strong={true}
>
Confirm
</IonButton>
</IonButtons>
{toolbarSlot}
</IonToolbar>
</IonHeader>
<IonContent className="space-y-4 ion-padding">
Expand Down Expand Up @@ -125,6 +100,36 @@ export default function TodoModal({
/>
)}
</IonContent>
<IonFooter>
<IonToolbar>
<IonButtons slot="secondary">
<IonButton
role="cancel"
onClick={() => dismiss(null, 'cancel')}
>
Cancel
</IonButton>
</IonButtons>
<IonButtons slot="primary">
<IonButton
onClick={() => {
dismiss(
{
...todo,
title: input.current?.value,
note: noteInput.current?.value,
},
'confirm',
)
}}
strong={true}
>
Confirm
</IonButton>
</IonButtons>
{toolbarSlot}
</IonToolbar>
</IonFooter>
</IonPage>
)
}

0 comments on commit fa39a39

Please sign in to comment.