0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(console): hide manage language button in sign-in-experience guide (#1989)

This commit is contained in:
Xiao Yijun 2022-09-26 21:33:17 +08:00
parent 5e59bc9e93
commit 58e1f9f0da
No known key found for this signature in database
GPG key ID: 6F648FC1262DB420
2 changed files with 16 additions and 10 deletions

View file

@ -13,7 +13,11 @@ import { SignInExperienceForm } from '../types';
import ManageLanguageModal from './ManageLanguageModal';
import * as styles from './index.module.scss';
const LanguagesForm = () => {
type Props = {
isManageLanguageVisible?: boolean;
};
const LanguagesForm = ({ isManageLanguageVisible = false }: Props) => {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
const { watch, control, register } = useFormContext<SignInExperienceForm>();
const isAutoDetect = watch('languageInfo.autoDetect');
@ -28,14 +32,16 @@ const LanguagesForm = () => {
label={t('sign_in_exp.others.languages.description')}
/>
</FormField>
<div
className={classNames(textButtonStyles.button, styles.manageLanguage)}
onClick={() => {
setIsManageLanguageFormOpen(true);
}}
>
{t('sign_in_exp.others.languages.manage_language')}
</div>
{isManageLanguageVisible && (
<div
className={classNames(textButtonStyles.button, styles.manageLanguage)}
onClick={() => {
setIsManageLanguageFormOpen(true);
}}
>
{t('sign_in_exp.others.languages.manage_language')}
</div>
)}
<FormField title="sign_in_exp.others.languages.default_language">
<Controller
name="languageInfo.fallbackLanguage"

View file

@ -25,7 +25,7 @@ const OthersTab = ({ defaultData, isDataDirty }: Props) => {
return (
<>
<TermsForm />
<LanguagesForm />
<LanguagesForm isManageLanguageVisible />
<AuthenticationForm />
<UnsavedChangesAlertModal hasUnsavedChanges={isDataDirty} />
</>