mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
feat: edit activeCustomer
This commit is contained in:
@@ -5,6 +5,13 @@ export const activeCustomerQuery = /* GraphQL */ `
|
||||
firstName
|
||||
lastName
|
||||
emailAddress
|
||||
favorites{
|
||||
items{
|
||||
product{
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
3
next-env.d.ts
vendored
3
next-env.d.ts
vendored
@@ -1,6 +1,3 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/types/global" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
||||
|
@@ -4,16 +4,22 @@ import React, { memo } from 'react'
|
||||
import s from './ItemWishList.module.scss'
|
||||
|
||||
interface Props {
|
||||
id:string,
|
||||
isActive?: boolean,
|
||||
onChange?: () => void
|
||||
onChange?: () => string
|
||||
}
|
||||
|
||||
const ItemWishList = memo(({isActive=false, onChange}:Props) => {
|
||||
const ItemWishList = memo(({id,isActive=false, onChange}:Props) => {
|
||||
// function toggleFavorite(id:string):string|undefined{
|
||||
// // alert(id);
|
||||
// return id;
|
||||
// }
|
||||
return(
|
||||
<div className={classNames({
|
||||
[s.heartToggle]: true,
|
||||
[s.isToggleOn]: isActive
|
||||
})}
|
||||
// onClick={toggleFavorite(id)}
|
||||
onChange={onChange}
|
||||
>
|
||||
<IconHeart />
|
||||
|
@@ -17,6 +17,7 @@ export interface ProductCardProps extends ProductCard {
|
||||
}
|
||||
|
||||
const ProductCardComponent = ({
|
||||
id,
|
||||
collection,
|
||||
name,
|
||||
slug,
|
||||
@@ -34,6 +35,7 @@ const ProductCardComponent = ({
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={s.productCardWarpper}>
|
||||
<div className={s.cardTop}>
|
||||
@@ -63,7 +65,7 @@ const ProductCardComponent = ({
|
||||
<div className={s.cardMidBot}>
|
||||
<div className={s.productPrice}>{price} {currencyCode}</div>
|
||||
<div className={s.wishList}>
|
||||
<ItemWishList />
|
||||
<ItemWishList id={id}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -33,6 +33,8 @@ const ProductList = ({ data, total = data.length, defaultCurrentPage, onPageChan
|
||||
<div className={s.list}>
|
||||
{
|
||||
data.map((product, index) => {
|
||||
console.log(product);
|
||||
|
||||
return <ProductCard {...product} key={index} />
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user