mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 03:31:23 +00:00
✨ feat: verify customer
:%s
This commit is contained in:
34
pages/verify.tsx
Normal file
34
pages/verify.tsx
Normal 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
|
Reference in New Issue
Block a user