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'
|
||||
|
||||
import type {
|
||||
Brand,
|
||||
Customer,
|
||||
Wishlist,
|
||||
Cart,
|
||||
@ -24,6 +25,7 @@ const Commerce = createContext<CommerceContextValue<any> | {}>({})
|
||||
|
||||
export type Provider = CommerceConfig & {
|
||||
fetcher: Fetcher
|
||||
brand: Brand.Config
|
||||
cart?: {
|
||||
useCart?: SWRHook<Cart.GetCartHook>
|
||||
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 Checkout from './checkout'
|
||||
import * as Common from './common'
|
||||
@ -11,6 +12,7 @@ import * as Site from './site'
|
||||
import * as Wishlist from './wishlist'
|
||||
|
||||
export type {
|
||||
Brand,
|
||||
Cart,
|
||||
Checkout,
|
||||
Common,
|
||||
|
Loading…
x
Reference in New Issue
Block a user