feat: demo page switch
This commit is contained in:
@@ -10,6 +10,8 @@ import { signUp, signIn, signInAsGuest } from './authControl';
|
||||
import { isValidEmail, isValidPassword } from './validate';
|
||||
import { TokenContext } from '@/utils/TokenProvider';
|
||||
import { useRouter } from '@/src/navigation';
|
||||
import Config from '@/config/config';
|
||||
const isDemoSite = Config.isDemoSite;
|
||||
|
||||
type Props = {
|
||||
isSignup: Boolean;
|
||||
@@ -166,11 +168,14 @@ export default function AuthPage({ isSignup, messages, locale }: Props) {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{isDemoSite && <div className="my-3 text-default-600">{messages.demoPageWarning}</div>}
|
||||
|
||||
<div className="flex justify-end items-center mt-3">
|
||||
<Button color="primary" onPress={validate}>
|
||||
{messages.submitTitle}
|
||||
</Button>
|
||||
{!isSignup && (
|
||||
{!isSignup && isDemoSite && (
|
||||
<Button
|
||||
className="ms-3 bg-gradient-to-tr from-pink-500 to-yellow-500 text-white shadow-lg"
|
||||
onPress={handleSignInAsGuest}
|
||||
|
||||
@@ -20,6 +20,7 @@ export default function Page(params: { locale: string }) {
|
||||
emailNotExist: t('email_not_exist'),
|
||||
signupError: t('signup_error'),
|
||||
signinError: t('signin_error'),
|
||||
demoPageWarning: t('demo_page_warning'),
|
||||
};
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -7,6 +7,7 @@ export default function Page(params: { locale: string }) {
|
||||
title: t('signup'),
|
||||
linkTitle: t('or_signin'),
|
||||
submitTitle: t('signup'),
|
||||
signInAsGuest: t('signin_as_guest'),
|
||||
email: t('email'),
|
||||
username: t('username'),
|
||||
password: t('password'),
|
||||
@@ -19,6 +20,7 @@ export default function Page(params: { locale: string }) {
|
||||
emailNotExist: t('email_not_exist'),
|
||||
signupError: t('signup_error'),
|
||||
signinError: t('signin_error'),
|
||||
demoPageWarning: t('demo_page_warning'),
|
||||
};
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user