prop to hide toggle for advanced settings

This commit is contained in:
Mary Hipp 2023-07-07 14:03:37 -04:00
parent bdbdcabcdf
commit 3dc42869f4

View File

@ -90,6 +90,7 @@ type ConfigOptions = {
shouldShowDeveloperSettings: boolean;
shouldShowResetWebUiText: boolean;
shouldShowBetaLayout: boolean;
shouldShowAdvancedOptionsSettings: boolean;
};
type SettingsModalProps = {
@ -106,6 +107,8 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
const shouldShowDeveloperSettings =
config?.shouldShowDeveloperSettings ?? true;
const shouldShowResetWebUiText = config?.shouldShowResetWebUiText ?? true;
const shouldShowAdvancedOptionsSettings =
config?.shouldShowAdvancedOptionsSettings ?? true;
useEffect(() => {
if (!shouldShowDeveloperSettings) {
@ -193,6 +196,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
dispatch(setShouldConfirmOnDelete(e.target.checked))
}
/>
{shouldShowAdvancedOptionsSettings && (
<IAISwitch
label={t('settings.showAdvancedOptions')}
isChecked={shouldShowAdvancedOptions}
@ -200,6 +204,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
dispatch(setShouldShowAdvancedOptions(e.target.checked))
}
/>
)}
</StyledFlex>
<StyledFlex>