@@ -6,6 +6,8 @@ import api from '../../../../shared/api/api';
66import { AppText } from '../../../../shared/defguard-ui/components/AppText/AppText' ;
77import { Checkbox } from '../../../../shared/defguard-ui/components/Checkbox/Checkbox' ;
88import { CopyField } from '../../../../shared/defguard-ui/components/CopyField/CopyField' ;
9+ import { IconKind } from '../../../../shared/defguard-ui/components/Icon/icon-types' ;
10+ import { InfoBanner } from '../../../../shared/defguard-ui/components/InfoBanner/InfoBanner' ;
911import { Modal } from '../../../../shared/defguard-ui/components/Modal/Modal' ;
1012import { ModalControls } from '../../../../shared/defguard-ui/components/ModalControls/ModalControls' ;
1113import { SizedBox } from '../../../../shared/defguard-ui/components/SizedBox/SizedBox' ;
@@ -149,26 +151,34 @@ const ModalContent = ({ user, appInfo, enrollmentResponse }: ModalData) => {
149151 data-testid = "activation-token-field"
150152 text = { enrollmentResponse . enrollment_token }
151153 />
152- { appInfo . smtp_enabled && (
153- < >
154- < SizedBox height = { ThemeSpacing . Xl3 } />
155- < form . AppForm >
156- < Checkbox
157- text = { m . modal_add_user_enrollment_form_label_send ( ) }
158- active = { sendEmail }
159- onClick = { ( ) => setSendEmail ( ( s ) => ! s ) }
154+ < SizedBox height = { ThemeSpacing . Xl3 } />
155+ < form . AppForm >
156+ { ! appInfo . smtp_enabled && (
157+ < >
158+ < InfoBanner
159+ icon = { IconKind . InfoFilled }
160+ text = { m . state_smtp_not_configured_admin ( ) }
161+ variant = "warning"
160162 />
161- { sendEmail && (
162- < >
163- < SizedBox height = { ThemeSpacing . Xl } />
164- < form . AppField name = "email" >
165- { ( field ) => < field . FormInput label = { m . form_label_email ( ) } /> }
166- </ form . AppField >
167- </ >
168- ) }
169- </ form . AppForm >
170- </ >
171- ) }
163+ < SizedBox height = { ThemeSpacing . Md } />
164+ </ >
165+ ) }
166+ < Checkbox
167+ text = { m . modal_add_user_enrollment_form_label_send ( ) }
168+ active = { sendEmail }
169+ disabled = { ! appInfo . smtp_enabled }
170+ onClick = { ( ) => setSendEmail ( ( s ) => ! s ) }
171+ />
172+ { sendEmail && (
173+ < >
174+ < SizedBox height = { ThemeSpacing . Xl } />
175+ < form . AppField name = "email" >
176+ { ( field ) => < field . FormInput label = { m . form_label_email ( ) } required /> }
177+ </ form . AppField >
178+ </ >
179+ ) }
180+ </ form . AppForm >
181+
172182 < form . Subscribe >
173183 { ( ) => (
174184 < ModalControls
0 commit comments