mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor(console): update sie preview tab (#1497)
* refactor(console): update sie preview tab * fix(console): update default tab
This commit is contained in:
parent
82ed2fe169
commit
7d48d12b06
2 changed files with 10 additions and 10 deletions
|
@ -24,7 +24,7 @@ const Preview = ({ signInExperience, className }: Props) => {
|
|||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||
const [language, setLanguage] = useState<Language>(Language.English);
|
||||
const [mode, setMode] = useState<AppearanceMode>(AppearanceMode.LightMode);
|
||||
const [platform, setPlatform] = useState<'desktopWeb' | 'mobile' | 'mobileWeb'>('mobile');
|
||||
const [platform, setPlatform] = useState<'desktopWeb' | 'mobile' | 'mobileWeb'>('desktopWeb');
|
||||
const { data: allConnectors } = useSWR<ConnectorDTO[], RequestError>('/api/connectors');
|
||||
const previewRef = useRef<HTMLIFrameElement>(null);
|
||||
|
||||
|
@ -150,14 +150,6 @@ const Preview = ({ signInExperience, className }: Props) => {
|
|||
</div>
|
||||
</div>
|
||||
<TabNav className={styles.nav}>
|
||||
<TabNavItem
|
||||
isActive={platform === 'mobile'}
|
||||
onClick={() => {
|
||||
setPlatform('mobile');
|
||||
}}
|
||||
>
|
||||
{t('sign_in_exp.preview.native')}
|
||||
</TabNavItem>
|
||||
<TabNavItem
|
||||
isActive={platform === 'desktopWeb'}
|
||||
onClick={() => {
|
||||
|
@ -174,6 +166,14 @@ const Preview = ({ signInExperience, className }: Props) => {
|
|||
>
|
||||
{t('sign_in_exp.preview.mobile_web')}
|
||||
</TabNavItem>
|
||||
<TabNavItem
|
||||
isActive={platform === 'mobile'}
|
||||
onClick={() => {
|
||||
setPlatform('mobile');
|
||||
}}
|
||||
>
|
||||
{t('sign_in_exp.preview.native')}
|
||||
</TabNavItem>
|
||||
</TabNav>
|
||||
<div
|
||||
className={classNames(styles.body, platform === 'desktopWeb' ? styles.web : styles.mobile)}
|
||||
|
|
|
@ -423,7 +423,7 @@ const translation = {
|
|||
},
|
||||
dark: '深色',
|
||||
light: '浅色',
|
||||
native: '原生',
|
||||
native: '移动原生',
|
||||
desktop_web: '桌面网页',
|
||||
mobile_web: '移动网页',
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue