hide whitelist section if no email configured

This commit is contained in:
Milo Schwartz 2025-01-05 16:03:29 -05:00
parent 19d87c2393
commit e97a9b9b3d

View file

@ -637,6 +637,7 @@ export default function ResourceAuthenticationPage() {
</SettingsSectionBody>
</SettingsSection>
{env.email.emailEnabled && (
<SettingsSection>
<SettingsSectionHeader>
<SettingsSectionTitle>
@ -648,14 +649,10 @@ export default function ResourceAuthenticationPage() {
</SettingsSectionDescription>
</SettingsSectionHeader>
<SettingsSectionBody>
{env.email.emailEnabled && (
<>
<SwitchInput
id="whitelist-toggle"
label="Email Whitelist"
defaultChecked={
resource.emailWhitelistEnabled
}
defaultChecked={resource.emailWhitelistEnabled}
onCheckedChange={setWhitelistEnabled}
/>
@ -686,8 +683,7 @@ export default function ResourceAuthenticationPage() {
.email()
.safeParse(
tag
)
.success;
).success;
}}
setActiveTagIndex={
setActiveEmailTagIndex
@ -728,8 +724,6 @@ export default function ResourceAuthenticationPage() {
</form>
</Form>
)}
</>
)}
</SettingsSectionBody>
<SettingsSectionFooter>
<Button
@ -742,6 +736,7 @@ export default function ResourceAuthenticationPage() {
</Button>
</SettingsSectionFooter>
</SettingsSection>
)}
</SettingsContainer>
</>
);