mirror of
https://github.com/vercel/commerce.git
synced 2025-06-20 06:01:21 +00:00
Merge branch 'main' into next-eslint
This commit is contained in:
commit
7dd6c04184
@ -38,6 +38,7 @@ const LoginView: FC<Props> = () => {
|
|||||||
} catch ({ errors }) {
|
} catch ({ errors }) {
|
||||||
setMessage(errors[0].message)
|
setMessage(errors[0].message)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
setDisabled(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import Image, { ImageProps } from 'next/image'
|
|||||||
import WishlistButton from '@components/wishlist/WishlistButton'
|
import WishlistButton from '@components/wishlist/WishlistButton'
|
||||||
import usePrice from '@framework/product/use-price'
|
import usePrice from '@framework/product/use-price'
|
||||||
import ProductTag from '../ProductTag'
|
import ProductTag from '../ProductTag'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
className?: string
|
className?: string
|
||||||
product: Product
|
product: Product
|
||||||
@ -23,7 +24,6 @@ const ProductCard: FC<Props> = ({
|
|||||||
className,
|
className,
|
||||||
noNameTag = false,
|
noNameTag = false,
|
||||||
variant = 'default',
|
variant = 'default',
|
||||||
...props
|
|
||||||
}) => {
|
}) => {
|
||||||
const { price } = usePrice({
|
const { price } = usePrice({
|
||||||
amount: product.price.value,
|
amount: product.price.value,
|
||||||
@ -38,7 +38,7 @@ const ProductCard: FC<Props> = ({
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href={`/product/${product.slug}`} {...props}>
|
<Link href={`/product/${product.slug}`}>
|
||||||
<a className={rootClassName}>
|
<a className={rootClassName}>
|
||||||
{variant === 'slim' && (
|
{variant === 'slim' && (
|
||||||
<>
|
<>
|
||||||
|
@ -10,7 +10,7 @@ type BCCartItemBody = {
|
|||||||
product_id: number
|
product_id: number
|
||||||
variant_id: number
|
variant_id: number
|
||||||
quantity?: number
|
quantity?: number
|
||||||
option_selections?: OptionSelections
|
option_selections?: OptionSelections[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const parseWishlistItem = (
|
export const parseWishlistItem = (
|
||||||
|
@ -16,7 +16,7 @@ export const handler: MutationHook<LoginHook> = {
|
|||||||
if (!(email && password)) {
|
if (!(email && password)) {
|
||||||
throw new CommerceError({
|
throw new CommerceError({
|
||||||
message:
|
message:
|
||||||
'A first name, last name, email and password are required to login',
|
'An email and password are required to login',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ function normalizeProductOption(productOption: any) {
|
|||||||
const {
|
const {
|
||||||
node: {
|
node: {
|
||||||
entityId,
|
entityId,
|
||||||
values: { edges },
|
values: { edges = [] } = {},
|
||||||
...rest
|
...rest
|
||||||
},
|
},
|
||||||
} = productOption
|
} = productOption
|
||||||
|
@ -40,7 +40,7 @@ export type OptionSelections = {
|
|||||||
|
|
||||||
export type CartItemBody = Core.CartItemBody & {
|
export type CartItemBody = Core.CartItemBody & {
|
||||||
productId: string // The product id is always required for BC
|
productId: string // The product id is always required for BC
|
||||||
optionSelections?: OptionSelections
|
optionSelections?: OptionSelections[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CartTypes = {
|
export type CartTypes = {
|
||||||
|
@ -22,7 +22,7 @@ export const handler: MutationHook<LoginHook> = {
|
|||||||
if (!(email && password)) {
|
if (!(email && password)) {
|
||||||
throw new CommerceError({
|
throw new CommerceError({
|
||||||
message:
|
message:
|
||||||
'A first name, last name, email and password are required to login',
|
'An email and password are required to login',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user