mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 03:31:23 +00:00
Merge branch 'release-stable' of github.com:KieIO/grocery-vercel-commerce into feature/m3-add-product-to-cart-product-detail
This commit is contained in:
10
pages/forgot-password.tsx
Normal file
10
pages/forgot-password.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { FormForgot, Layout } from 'src/components/common'
|
||||
|
||||
export default function NotFound() {
|
||||
return (
|
||||
<div>
|
||||
<FormForgot/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
NotFound.Layout = Layout
|
@@ -8,20 +8,23 @@ import { FeaturedProductsCarousel, FreshProducts, HomeBanner, HomeCategories, Ho
|
||||
import HomeSpice from 'src/components/modules/home/HomeSpice/HomeSpice';
|
||||
import { FACET } from 'src/utils/constanst.utils';
|
||||
import { FilterOneVatiant, getFacetIdByName } from 'src/utils/funtion.utils';
|
||||
import { CODE_FACET_DISCOUNT, CODE_FACET_FEATURED } from 'src/utils/constanst.utils';
|
||||
import { CODE_FACET_DISCOUNT, CODE_FACET_FEATURED,COLLECTION_SLUG_SPICE } from 'src/utils/constanst.utils';
|
||||
import { getAllFacetValueIdsByParentCode, getAllFacetValuesForFeatuedProducts, getAllPromies, getFreshFacetId } from 'src/utils/funtion.utils';
|
||||
import { PromiseWithKey } from 'src/utils/types.utils';
|
||||
|
||||
interface Props {
|
||||
featuredAndDiscountFacetsValue: FacetValue[],
|
||||
freshProducts: ProductCard[],
|
||||
featuredProducts: ProductCard[],
|
||||
collections: Collection[]
|
||||
veggie: ProductCard[],
|
||||
featuredAndDiscountFacetsValue: FacetValue[],
|
||||
freshProducts: ProductCard[],
|
||||
featuredProducts: ProductCard[],
|
||||
collections: Collection[]
|
||||
spiceProducts:ProductCard[]
|
||||
veggie: ProductCard[],
|
||||
|
||||
}
|
||||
export default function Home({ featuredAndDiscountFacetsValue,
|
||||
freshProducts, featuredProducts, veggie,
|
||||
collections }: Props) {
|
||||
export default function Home({ featuredAndDiscountFacetsValue, veggie,
|
||||
freshProducts, featuredProducts,
|
||||
collections,spiceProducts }: Props) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<HomeBanner />
|
||||
@@ -30,7 +33,7 @@ export default function Home({ featuredAndDiscountFacetsValue,
|
||||
<HomeCollection data = {veggie}/>
|
||||
<FreshProducts data={freshProducts} collections={collections} />
|
||||
<HomeVideo />
|
||||
<HomeSpice />
|
||||
{spiceProducts.length>0 && <HomeSpice data={spiceProducts}/>}
|
||||
<FeaturedProductsCarousel data={featuredProducts} featuredFacetsValue={featuredAndDiscountFacetsValue} />
|
||||
<HomeCTA />
|
||||
<HomeRecipe />
|
||||
@@ -76,6 +79,7 @@ export async function getStaticProps({
|
||||
props.freshProducts = []
|
||||
}
|
||||
|
||||
//veggie
|
||||
const veggieProductvariables: ProductVariables = {
|
||||
groupByProduct:false
|
||||
}
|
||||
@@ -115,16 +119,24 @@ export async function getStaticProps({
|
||||
})
|
||||
promisesWithKey.push({ key: 'collections', promise: collectionsPromise, keyResult: 'collections' })
|
||||
|
||||
// spiceProducts
|
||||
const spiceProducts = commerce.getAllProducts({
|
||||
variables: {
|
||||
collectionSlug: COLLECTION_SLUG_SPICE,
|
||||
},
|
||||
config,
|
||||
preview,
|
||||
})
|
||||
promisesWithKey.push({ key: 'spiceProducts', promise: spiceProducts, keyResult: 'products' })
|
||||
|
||||
try {
|
||||
const promises = getAllPromies(promisesWithKey)
|
||||
const rs = await Promise.all(promises)
|
||||
|
||||
|
||||
promisesWithKey.map((item, index) => {
|
||||
props[item.key] = item.keyResult ? FilterOneVatiant(rs[index][item.keyResult]) : rs[index]
|
||||
return null
|
||||
})
|
||||
|
||||
return {
|
||||
props,
|
||||
revalidate: 60,
|
||||
|
10
pages/reset-password.tsx
Normal file
10
pages/reset-password.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { FormResetPassword, Layout } from 'src/components/common'
|
||||
|
||||
export default function NotFound() {
|
||||
return (
|
||||
<div>
|
||||
<FormResetPassword/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
NotFound.Layout = Layout
|
Reference in New Issue
Block a user