Skip to content

Commit 8b9b8b3

Browse files
committed
align buttons better
1 parent 5b801d3 commit 8b9b8b3

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

app/(pages)/(main)/volunteering/menu/category.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ function createCategory(category: MenuCategoryCreate): Promise<Response> {
3333
});
3434
}
3535

36+
function deleteCategory(categoryId: number): Promise<Response> {
37+
return fetch(`/api/v2/escape/menu/categories/${ categoryId }`, {
38+
method: "DELETE",
39+
});
40+
}
41+
3642
// a <Textfield> with larger text. Equivalent font-size to <h2>
3743
const LargeTextField = styled(TextField)({
3844
"& .MuiOutlinedInput-input": {
@@ -73,9 +79,9 @@ export function Category(
7379

7480
return (
7581
<Stack>
76-
{
82+
<Grid container spacing={ 2 } columns={ 10 }>
7783

78-
<Stack direction="row" justifyContent="space-between">
84+
<Grid item xs={ 9 }>
7985
<LargeTextField
8086
type="text"
8187
value={ categoryName }
@@ -90,6 +96,9 @@ export function Category(
9096
helperText={ categoryNameInvalid ? "Name must not be empty" : "" }
9197

9298
></LargeTextField>
99+
</Grid>
100+
101+
<Grid item xs={ 1 } display="flex" alignItems="center">
93102
<Button // UPDATE button
94103
disabled={ !hasBeenUpdated || categoryNameInvalid || isUpdating }
95104
onClick={ () => {
@@ -105,14 +114,14 @@ export function Category(
105114
});
106115
}
107116
}
108-
109117
>
110118
{
111119
isUpdating ? <CircularProgress/> : <>Update</> // show spinner when updating is in progress
112120
}
113121
</Button>
114-
</Stack>
115-
}
122+
</Grid>
123+
</Grid>
124+
116125

117126
<Grid container spacing={ 2 } columns={ 10 }>
118127

0 commit comments

Comments
 (0)