Modify types to accomodate custom brand themes in providers

This commit is contained in:
Guillaume Bibeau-Laviolette 2022-06-06 12:51:00 -04:00
parent 406626bc05
commit 6bdf0a216c
3 changed files with 9 additions and 0 deletions

View File

@ -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>

View File

@ -0,0 +1,5 @@
import type { VFC } from 'react'
export type Config = {
Logo: VFC
}

View File

@ -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,