Updated types, hooks, useCustomer sample

This commit is contained in:
Luis Alvarez
2020-10-23 19:21:37 -05:00
parent 40049b27a1
commit 444456d376
9 changed files with 83 additions and 78 deletions

View File

@@ -3,11 +3,15 @@ import { Layout } from '@components/core'
import { Logo, Modal, Button } from '@components/ui'
import useLogin from '@lib/bigcommerce/use-login'
import useLogout from '@lib/bigcommerce/use-logout'
import useCustomer from '@lib/bigcommerce/use-customer'
export default function Login() {
const signup = useSignup()
const login = useLogin()
const logout = useLogout()
// Data about the currently logged in customer, it will update
// automatically after a signup/login/logout
const { data } = useCustomer()
// TODO: use this method. It can take more than 5 seconds to do a signup
const handleSignup = async () => {
// TODO: validate the password and email before calling the signup