mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 12:24:18 +00:00
refactor folder hooks/auth
This commit is contained in:
parent
6c28dc3d7d
commit
4a9c36bf0a
@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import { Layout } from 'src/components/common'
|
||||
import useActiveCustomer from 'src/components/hooks/useActiveCustomer'
|
||||
import { useActiveCustomer } from 'src/components/hooks/auth'
|
||||
import { AccountPage, AccountSignIn } from 'src/components/modules/account'
|
||||
|
||||
const Account = () => {
|
||||
|
@ -22,7 +22,7 @@ import {
|
||||
import Logo from '../../../Logo/Logo'
|
||||
import s from './HeaderMenu.module.scss'
|
||||
import { useLogout } from '../../../../hooks/auth'
|
||||
import useActiveCustomer from 'src/components/hooks/useActiveCustomer'
|
||||
import { useActiveCustomer } from 'src/components/hooks/auth'
|
||||
interface Props {
|
||||
children?: any
|
||||
isFull?: boolean
|
||||
|
@ -1,7 +1,7 @@
|
||||
import classNames from 'classnames'
|
||||
import { useRouter } from 'next/router'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import useActiveCustomer from 'src/components/hooks/useActiveCustomer'
|
||||
import { useActiveCustomer } from 'src/components/hooks/auth'
|
||||
import { ROUTE } from 'src/utils/constanst.utils'
|
||||
import ModalCommon from '../ModalCommon/ModalCommon'
|
||||
import FormLogin from './components/FormLogin/FormLogin'
|
||||
|
@ -3,7 +3,7 @@ import Link from 'next/link'
|
||||
import React, { useEffect, useRef } from 'react'
|
||||
import { ButtonCommon, InputFiledInForm, InputPasswordFiledInForm } from 'src/components/common'
|
||||
import { useMessage } from 'src/components/contexts'
|
||||
import useLogin from 'src/components/hooks/useLogin'
|
||||
import useLogin from 'src/components/hooks/auth/useLogin'
|
||||
import { ROUTE } from 'src/utils/constanst.utils'
|
||||
import { LANGUAGE } from 'src/utils/language.utils'
|
||||
import { CustomInputCommon } from 'src/utils/type.utils'
|
||||
|
@ -10,7 +10,7 @@ import { useMessage } from 'src/components/contexts'
|
||||
import { LANGUAGE } from 'src/utils/language.utils'
|
||||
import { CustomInputCommon } from 'src/utils/type.utils'
|
||||
import * as Yup from 'yup'
|
||||
import { useSignup } from '../../../../hooks'
|
||||
import { useSignup } from '../../../../hooks/auth'
|
||||
import s from '../FormAuthen.module.scss'
|
||||
import SocialAuthen from '../SocialAuthen/SocialAuthen'
|
||||
import styles from './FormRegister.module.scss'
|
||||
|
@ -1,3 +1,6 @@
|
||||
export { default as useSignup } from './useSignup'
|
||||
export { default as useLogin } from './useLogin'
|
||||
export { default as useLogout } from './useLogout'
|
||||
|
||||
export { default as useVerifyCustomer } from './useVerifyCustomer'
|
||||
export { default as useActiveCustomer } from './useActiveCustomer'
|
||||
|
||||
|
@ -4,7 +4,7 @@ import { useState } from 'react'
|
||||
import { CommonError } from 'src/domains/interfaces/CommonError'
|
||||
import { LOCAL_STORAGE_KEY } from 'src/utils/constanst.utils'
|
||||
import rawFetcher from 'src/utils/rawFetcher'
|
||||
import useActiveCustomer from '../useActiveCustomer'
|
||||
import useActiveCustomer from './useActiveCustomer'
|
||||
|
||||
const useLogout = () => {
|
||||
const [loading, setLoading] = useState(false)
|
||||
|
@ -2,7 +2,7 @@ import { VerifyCustomerAccountMutation } from '@framework/schema'
|
||||
import { useState } from 'react'
|
||||
import { CommonError } from 'src/domains/interfaces/CommonError'
|
||||
import rawFetcher from 'src/utils/rawFetcher'
|
||||
import { VERIFY_CUSTOMER_ACCOUNT } from '../../graphql/mutation'
|
||||
import { VERIFY_CUSTOMER_ACCOUNT } from '../../../graphql/mutation'
|
||||
import useActiveCustomer from './useActiveCustomer'
|
||||
|
||||
interface VerifyInput {
|
@ -1,3 +1 @@
|
||||
export { default as useModalCommon } from './useModalCommon'
|
||||
export { default as useVerifyCustomer } from './useVerifyCustomer'
|
||||
export { default as useSignup } from './useSignup'
|
||||
|
@ -5,7 +5,7 @@ import Image from 'next/image'
|
||||
import avatar from '../../assets/avatar.png'
|
||||
|
||||
import { ButtonCommon } from 'src/components/common'
|
||||
import useActiveCustomer from 'src/components/hooks/useActiveCustomer'
|
||||
import { useActiveCustomer } from 'src/components/hooks/auth'
|
||||
|
||||
interface AccountProps {
|
||||
name: string
|
||||
|
Loading…
x
Reference in New Issue
Block a user