feat: verify customer

:%s
This commit is contained in:
lytrankieio123
2021-09-28 16:04:47 +07:00
parent 128a9f0537
commit 68adb9026b
10 changed files with 140 additions and 13 deletions

34
pages/verify.tsx Normal file
View File

@@ -0,0 +1,34 @@
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import { Layout } from 'src/components/common'
import LoadingCommon from 'src/components/common/LoadingCommon/LoadingCommon'
import { useVerifyCustomer } from 'src/components/hooks'
export default function VerifyCustomer() {
const router = useRouter()
const { error, loading, verify } = useVerifyCustomer()
useEffect(() => {
const { token } = router.query
console.log("token: ", token)
if (token) {
verify({ token: token.toString() })
}
}, [])
return (
<div>
{
loading ? <>
<LoadingCommon />
Verifing your account ....
</> : <div className="error">
{error?.message}
</div>
}
</div>
)
}
VerifyCustomer.Layout = Layout