mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 12:24:18 +00:00
🔨 refactor: import cart drawer contex/ provider
:%s
This commit is contained in:
parent
0f190c6a1b
commit
907287a75e
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { useCartDrawer } from 'src/components/contexts/CartDrawer/CartDrawerContext';
|
||||
import { useCartDrawer } from 'src/components/contexts';
|
||||
import { PRODUCT_CART_DATA_TEST } from 'src/utils/demo-data';
|
||||
import { DrawerCommon } from '..';
|
||||
import s from './CartDrawer.module.scss';
|
||||
|
@ -5,7 +5,7 @@ import { memo, useMemo } from 'react'
|
||||
import { ButtonCommon } from 'src/components/common'
|
||||
import InputSearch from 'src/components/common/InputSearch/InputSearch'
|
||||
import MenuDropdown from 'src/components/common/MenuDropdown/MenuDropdown'
|
||||
import { useCartDrawer } from 'src/components/contexts/CartDrawer/CartDrawerContext'
|
||||
import { useCartDrawer } from 'src/components/contexts'
|
||||
import { IconBuy, IconFilter, IconHeart, IconHistory, IconUser } from 'src/components/icons'
|
||||
import { ACCOUNT_TAB, FILTER_PAGE, QUERY_KEY, ROUTE } from 'src/utils/constanst.utils'
|
||||
import Logo from '../../../Logo/Logo'
|
||||
|
@ -1,14 +1,13 @@
|
||||
import { CommerceProvider } from '@framework'
|
||||
import { useRouter } from 'next/router'
|
||||
import { FC } from 'react'
|
||||
import { CartDrawerProvider } from 'src/components/contexts/CartDrawer/CartDrawerProvider'
|
||||
import { CartDrawerProvider } from 'src/components/contexts'
|
||||
import LayoutContent from './LayoutContent/LayoutContent'
|
||||
interface Props {
|
||||
className?: string
|
||||
children?: any
|
||||
}
|
||||
|
||||
// note: demo code
|
||||
const Layout: FC<Props> = ({ children }) => {
|
||||
const { locale = 'en-US' } = useRouter()
|
||||
return (
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { useRouter } from 'next/router'
|
||||
import { FC } from 'react'
|
||||
import { useCartDrawer } from 'src/components/contexts/CartDrawer/CartDrawerContext'
|
||||
import { useModalCommon } from 'src/components/hooks'
|
||||
import { BRAND, CATEGORY, FEATURED, FILTER_PAGE, ROUTE } from 'src/utils/constanst.utils'
|
||||
import { CartDrawer, Footer, ScrollToTop } from '../..'
|
||||
|
2
src/components/contexts/index.ts
Normal file
2
src/components/contexts/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './CartDrawer/CartDrawerContext'
|
||||
export * from './CartDrawer/CartDrawerProvider'
|
Loading…
x
Reference in New Issue
Block a user