File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
app/(pages)/(main)/volunteering/menu Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff 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>
3743const 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
You can’t perform that action at this time.
0 commit comments