@@ -2,7 +2,7 @@ import type { Interpolation, Theme } from "@emotion/react";
2
2
import Button from "@mui/material/Button" ;
3
3
import TextField from "@mui/material/TextField" ;
4
4
import { useFormik } from "formik" ;
5
- import type { FC } from "react" ;
5
+ import { type FC , useState } from "react" ;
6
6
import * as Yup from "yup" ;
7
7
import type {
8
8
Organization ,
@@ -22,6 +22,8 @@ import {
22
22
displayNameValidator ,
23
23
onChangeTrimmed ,
24
24
} from "utils/formUtils" ;
25
+ import { HorizontalContainer , HorizontalSection } from "./Horizontal" ;
26
+ import { DeleteDialog } from "components/Dialogs/DeleteDialog/DeleteDialog" ;
25
27
26
28
const MAX_DESCRIPTION_CHAR_LIMIT = 128 ;
27
29
const MAX_DESCRIPTION_MESSAGE = `Please enter a description that is no longer than ${ MAX_DESCRIPTION_CHAR_LIMIT } characters.` ;
@@ -59,6 +61,8 @@ export const OrganizationSettingsPageView: FC<
59
61
} ) ;
60
62
const getFieldHelpers = getFormHelpers ( form , error ) ;
61
63
64
+ const [ isDeleting , setIsDeleting ] = useState ( false ) ;
65
+
62
66
return (
63
67
< div >
64
68
< PageHeader >
@@ -70,7 +74,7 @@ export const OrganizationSettingsPageView: FC<
70
74
aria-label = "Organization settings form"
71
75
>
72
76
< FormSection
73
- title = "General info "
77
+ title = "Info "
74
78
description = "Change the name or description of the organization."
75
79
>
76
80
< fieldset
@@ -110,14 +114,59 @@ export const OrganizationSettingsPageView: FC<
110
114
</ HorizontalForm >
111
115
112
116
{ ! org . is_default && (
113
- < Button
114
- css = { styles . dangerButton }
115
- variant = "contained"
116
- onClick = { onDeleteOrg }
117
- >
118
- Delete this organization
119
- </ Button >
117
+ < HorizontalContainer css = { { marginTop : 48 } } >
118
+ < HorizontalSection
119
+ title = "Settings"
120
+ description = "Change or delete your organization."
121
+ >
122
+ < div
123
+ css = { ( theme ) => ( {
124
+ display : "flex" ,
125
+ backgroundColor : theme . roles . danger . background ,
126
+ alignItems : "center" ,
127
+ justifyContent : "space-between" ,
128
+ border : `1px solid ${ theme . roles . danger . outline } ` ,
129
+ borderRadius : 8 ,
130
+ padding : 12 ,
131
+ paddingLeft : 18 ,
132
+ gap : 8 ,
133
+ lineHeight : "18px" ,
134
+ flexGrow : 1 ,
135
+
136
+ "& .option" : {
137
+ color : theme . roles . danger . fill . solid ,
138
+ "&.Mui-checked" : {
139
+ color : theme . roles . danger . fill . solid ,
140
+ } ,
141
+ } ,
142
+
143
+ "& .info" : {
144
+ fontSize : 14 ,
145
+ fontWeight : 600 ,
146
+ color : theme . roles . danger . text ,
147
+ } ,
148
+ } ) }
149
+ >
150
+ < span > Deleting an organization is irreversible.</ span >
151
+ < Button
152
+ css = { styles . dangerButton }
153
+ variant = "contained"
154
+ onClick = { ( ) => setIsDeleting ( true ) }
155
+ >
156
+ Delete this organization
157
+ </ Button >
158
+ </ div >
159
+ </ HorizontalSection >
160
+ </ HorizontalContainer >
120
161
) }
162
+
163
+ < DeleteDialog
164
+ isOpen = { isDeleting }
165
+ onConfirm = { onDeleteOrg }
166
+ onCancel = { ( ) => setIsDeleting ( false ) }
167
+ entity = "organization"
168
+ name = { org . name }
169
+ />
121
170
</ div >
122
171
) ;
123
172
} ;
0 commit comments