Add a link to login instead of register on the register page
This commit is contained in:
@@ -7,13 +7,14 @@ import axios from 'axios'
|
||||
import { getCookie } from '@/util/cookie'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import Link from 'next/link'
|
||||
|
||||
export default function AccountRegisterPage () {
|
||||
const [loading, setLoading] = useState<boolean>(true)
|
||||
const router = useRouter()
|
||||
|
||||
const [token, setToken] = useState<string | null>(null)
|
||||
const [result, setResult] = useState<number>(-1)
|
||||
const [result, setResult] = useState<number>(0)
|
||||
|
||||
const [username, setUsername] = useState<string>('')
|
||||
const [email, setEmail] = useState<string>('')
|
||||
@@ -54,6 +55,7 @@ export default function AccountRegisterPage () {
|
||||
className='flex justify-center'
|
||||
/>
|
||||
) : result == 0 ? (
|
||||
<>
|
||||
<form
|
||||
className='flex flex-col gap-2'
|
||||
onSubmit={async e => {
|
||||
@@ -148,6 +150,16 @@ export default function AccountRegisterPage () {
|
||||
/>
|
||||
<button type='submit'>Register</button>
|
||||
</form>
|
||||
<div className='flex justify-center flex-col mt-6 text-center'>
|
||||
<Link
|
||||
href='/account/login'
|
||||
draggable={false}
|
||||
className='button'
|
||||
>
|
||||
Already have an account?
|
||||
</Link>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
result == 1 && (
|
||||
<p className='mt-2 -mb-2 text-center text-sm'>
|
||||
|
||||
Reference in New Issue
Block a user