hide localization toggle

This commit is contained in:
Mary Hipp 2023-07-26 10:55:38 -04:00
parent 385483ff8e
commit f86d0d1b69

View File

@ -104,6 +104,7 @@ type ConfigOptions = {
shouldShowAdvancedOptionsSettings: boolean; shouldShowAdvancedOptionsSettings: boolean;
shouldShowClearIntermediates: boolean; shouldShowClearIntermediates: boolean;
shouldShowNodesToggle: boolean; shouldShowNodesToggle: boolean;
shouldShowLocalizationToggle: boolean;
}; };
type SettingsModalProps = { type SettingsModalProps = {
@ -125,6 +126,8 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
const shouldShowClearIntermediates = const shouldShowClearIntermediates =
config?.shouldShowClearIntermediates ?? true; config?.shouldShowClearIntermediates ?? true;
const shouldShowNodesToggle = config?.shouldShowNodesToggle ?? true; const shouldShowNodesToggle = config?.shouldShowNodesToggle ?? true;
const shouldShowLocalizationToggle =
config?.shouldShowLocalizationToggle ?? true;
useEffect(() => { useEffect(() => {
if (!shouldShowDeveloperSettings) { if (!shouldShowDeveloperSettings) {
@ -325,6 +328,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
onChange={handleToggleNodes} onChange={handleToggleNodes}
/> />
)} )}
{shouldShowLocalizationToggle && (
<IAIMantineSelect <IAIMantineSelect
disabled={!isLocalizationEnabled} disabled={!isLocalizationEnabled}
label={t('common.languagePickerLabel')} label={t('common.languagePickerLabel')}
@ -335,6 +339,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
}))} }))}
onChange={handleLanguageChanged} onChange={handleLanguageChanged}
/> />
)}
</StyledFlex> </StyledFlex>
{shouldShowDeveloperSettings && ( {shouldShowDeveloperSettings && (