add missing types to site

Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
Chloe 2023-03-09 21:03:33 +07:00
parent 1de2d253e9
commit 381d4a987f
7 changed files with 12 additions and 40 deletions

View File

@ -1,17 +1,2 @@
import { MutationHook } from '@vercel/commerce/utils/types'
import useSubmitCheckout, {
UseSubmitCheckout,
} from '@vercel/commerce/checkout/use-submit-checkout'
export default useSubmitCheckout as UseSubmitCheckout<typeof handler>
export const handler: MutationHook<any> = {
fetchOptions: {
query: '',
},
async fetcher({ input, options, fetch }) {},
useHook:
({ fetch }) =>
() =>
async () => ({}),
}
export * from '@vercel/commerce/checkout/use-submit-checkout'
export { default } from '@vercel/commerce/checkout/use-submit-checkout'

View File

@ -1,17 +1,2 @@
import { MutationHook } from '@vercel/commerce/utils/types'
import useUpdateItem, {
UseUpdateItem,
} from '@vercel/commerce/customer/address/use-update-item'
export default useUpdateItem as UseUpdateItem<typeof handler>
export const handler: MutationHook<any> = {
fetchOptions: {
query: '',
},
async fetcher({ input, options, fetch }) {},
useHook:
({ fetch }) =>
() =>
async () => ({}),
}
export * from '@vercel/commerce/customer/address/use-update-item'
export { default } from '@vercel/commerce/customer/address/use-update-item'

View File

@ -40,6 +40,8 @@ export interface Brand {
path: string
}
export type Navigation = any
/**
* Operation to get site information. This includes categories and brands.
*/
@ -47,5 +49,6 @@ export type GetSiteInfoOperation = {
data: {
categories: Category[]
brands: Brand[]
navigation?: Navigation[]
}
}

View File

@ -31,7 +31,7 @@ const ShippingMethod = () => {
await updateShippingMethod({
id: cart!.id,
...addressFields,
shippingMethodId: event.target.shippingMethod.value,
...(event.target.shippingMethod.value ? {shippingMethodId: event.target.shippingMethod.value} : {})
})
setSidebarView('CHECKOUT_VIEW')

View File

@ -16,8 +16,7 @@ import ShippingMethodView from '@components/checkout/ShippingMethodView'
import { CheckoutProvider } from '@components/checkout/context'
import { MenuSidebarView } from '@components/common/UserNav'
import type { Page } from '@commerce/types/page'
import type { Category } from '@commerce/types/site'
import type { Navigation } from '@framework/types/site'
import type { Category, Navigation } from '@commerce/types/site'
import type { Link as LinkProps } from '../UserNav/MenuSidebarView'
const Loading = () => (

View File

@ -5,7 +5,7 @@ import s from './Navbar.module.css'
import NavbarRoot from './NavbarRoot'
import { Logo, Container } from '@components/ui'
import { Searchbar, UserNav } from '@components/common'
import type { Navigation } from '@framework/types/site'
import type { Navigation } from '@commerce/types/site'
import CustomNavbar from './CustomNavbar'
interface Link {

View File

@ -23,8 +23,8 @@
"@components/*": ["components/*"],
"@commerce": ["../packages/commerce/src"],
"@commerce/*": ["../packages/commerce/src/*"],
"@framework": ["../packages/opencommerce/src"],
"@framework/*": ["../packages/opencommerce/src/*"]
"@framework": ["../packages/bigcommerce/src"],
"@framework/*": ["../packages/bigcommerce/src/*"]
}
},
"include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],