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:
parent
5e59bc9e93
commit
58e1f9f0da
2 changed files with 16 additions and 10 deletions
|
@ -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"
|
||||
|
|
|
@ -25,7 +25,7 @@ const OthersTab = ({ defaultData, isDataDirty }: Props) => {
|
|||
return (
|
||||
<>
|
||||
<TermsForm />
|
||||
<LanguagesForm />
|
||||
<LanguagesForm isManageLanguageVisible />
|
||||
<AuthenticationForm />
|
||||
<UnsavedChangesAlertModal hasUnsavedChanges={isDataDirty} />
|
||||
</>
|
||||
|
|
Loading…
Reference in a new issue