mirror of
https://github.com/vercel/commerce.git
synced 2025-06-28 09:21:22 +00:00
Modify types to accomodate custom brand themes in providers
This commit is contained in:
parent
406626bc05
commit
6bdf0a216c
@ -8,6 +8,7 @@ import {
|
|||||||
} from 'react'
|
} from 'react'
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
Brand,
|
||||||
Customer,
|
Customer,
|
||||||
Wishlist,
|
Wishlist,
|
||||||
Cart,
|
Cart,
|
||||||
@ -24,6 +25,7 @@ const Commerce = createContext<CommerceContextValue<any> | {}>({})
|
|||||||
|
|
||||||
export type Provider = CommerceConfig & {
|
export type Provider = CommerceConfig & {
|
||||||
fetcher: Fetcher
|
fetcher: Fetcher
|
||||||
|
brand: Brand.Config
|
||||||
cart?: {
|
cart?: {
|
||||||
useCart?: SWRHook<Cart.GetCartHook>
|
useCart?: SWRHook<Cart.GetCartHook>
|
||||||
useAddItem?: MutationHook<Cart.AddItemHook>
|
useAddItem?: MutationHook<Cart.AddItemHook>
|
||||||
|
5
packages/commerce/src/types/brand.ts
Normal file
5
packages/commerce/src/types/brand.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import type { VFC } from 'react'
|
||||||
|
|
||||||
|
export type Config = {
|
||||||
|
Logo: VFC
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
import * as Brand from './brand'
|
||||||
import * as Cart from './cart'
|
import * as Cart from './cart'
|
||||||
import * as Checkout from './checkout'
|
import * as Checkout from './checkout'
|
||||||
import * as Common from './common'
|
import * as Common from './common'
|
||||||
@ -11,6 +12,7 @@ import * as Site from './site'
|
|||||||
import * as Wishlist from './wishlist'
|
import * as Wishlist from './wishlist'
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
|
Brand,
|
||||||
Cart,
|
Cart,
|
||||||
Checkout,
|
Checkout,
|
||||||
Common,
|
Common,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user