mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Merge branch 'master' of https://github.com/okbel/e-comm-example
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
|
||||
import { getConfig } from '@lib/bigcommerce/api'
|
||||
import getPage from '@lib/bigcommerce/api/operations/get-page'
|
||||
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||
import getPage from '@bigcommerce/storefront-data-hooks/api/operations/get-page'
|
||||
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
|
||||
import getSlug from '@utils/get-slug'
|
||||
import { Layout, HTMLContent } from '@components/core'
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import cartApi from '@lib/bigcommerce/api/cart'
|
||||
import cartApi from '@bigcommerce/storefront-data-hooks/api/cart'
|
||||
|
||||
export default cartApi()
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import catalogProductsApi from '@lib/bigcommerce/api/catalog/products'
|
||||
import catalogProductsApi from '@bigcommerce/storefront-data-hooks/api/catalog/products'
|
||||
|
||||
export default catalogProductsApi()
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import checkoutApi from '@lib/bigcommerce/api/checkout'
|
||||
import checkoutApi from '@bigcommerce/storefront-data-hooks/api/checkout'
|
||||
|
||||
export default checkoutApi()
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import customersApi from '@lib/bigcommerce/api/customers'
|
||||
import customersApi from '@bigcommerce/storefront-data-hooks/api/customers'
|
||||
|
||||
export default customersApi()
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import loginApi from '@lib/bigcommerce/api/customers/login'
|
||||
import loginApi from '@bigcommerce/storefront-data-hooks/api/customers/login'
|
||||
|
||||
export default loginApi()
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import logoutApi from '@lib/bigcommerce/api/customers/logout'
|
||||
import logoutApi from '@bigcommerce/storefront-data-hooks/api/customers/logout'
|
||||
|
||||
export default logoutApi()
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import signupApi from '@lib/bigcommerce/api/customers/signup'
|
||||
import signupApi from '@bigcommerce/storefront-data-hooks/api/customers/signup'
|
||||
|
||||
export default signupApi()
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import wishlistApi from '@lib/bigcommerce/api/wishlist'
|
||||
import wishlistApi from '@bigcommerce/storefront-data-hooks/api/wishlist'
|
||||
|
||||
export default wishlistApi()
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import type { GetStaticPropsContext } from 'next'
|
||||
import { getConfig } from '@lib/bigcommerce/api'
|
||||
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
|
||||
import { Layout } from '@components/core'
|
||||
import { Container } from '@components/ui'
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import type { GetStaticPropsContext } from 'next'
|
||||
import { getConfig } from '@lib/bigcommerce/api'
|
||||
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
|
||||
import useCart from '@bigcommerce/storefront-data-hooks/cart/use-cart'
|
||||
import usePrice from '@bigcommerce/storefront-data-hooks/use-price'
|
||||
import { Layout } from '@components/core'
|
||||
import { Button } from '@components/ui'
|
||||
import { Bag, Cross, Check } from '@components/icons'
|
||||
import useCart from '@lib/bigcommerce/cart/use-cart'
|
||||
import usePrice from '@lib/bigcommerce/use-price'
|
||||
import { CartItem } from '@components/cart'
|
||||
import { Text } from '@components/ui'
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { useMemo } from 'react'
|
||||
import type { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
|
||||
import { getConfig } from '@lib/bigcommerce/api'
|
||||
import getAllProducts from '@lib/bigcommerce/api/operations/get-all-products'
|
||||
import getSiteInfo from '@lib/bigcommerce/api/operations/get-site-info'
|
||||
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
|
||||
import getAllProducts from '@bigcommerce/storefront-data-hooks/api/operations/get-all-products'
|
||||
import getSiteInfo from '@bigcommerce/storefront-data-hooks/api/operations/get-site-info'
|
||||
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
|
||||
import rangeMap from '@lib/range-map'
|
||||
import { Layout } from '@components/core'
|
||||
import { Grid, Marquee, Hero } from '@components/ui'
|
||||
@@ -82,8 +82,8 @@ export default function Home({
|
||||
key={node.path}
|
||||
product={node}
|
||||
// The first image is the largest one in the grid
|
||||
imgWidth={i === 0 ? '65vw' : '30vw'}
|
||||
imgHeight={i === 0 ? '45vw' : '22vw'}
|
||||
imgWidth={i === 0 ? 1600 : 820}
|
||||
imgHeight={i === 0 ? 1600 : 820}
|
||||
priority
|
||||
/>
|
||||
))}
|
||||
|
@@ -4,12 +4,12 @@ import type {
|
||||
InferGetStaticPropsType,
|
||||
} from 'next'
|
||||
import { useRouter } from 'next/router'
|
||||
import { getConfig } from '@lib/bigcommerce/api'
|
||||
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||
import getProduct from '@lib/bigcommerce/api/operations/get-product'
|
||||
import { getConfig } from '@bigcommerce/storefront-data-hooks/api'
|
||||
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
|
||||
import getProduct from '@bigcommerce/storefront-data-hooks/api/operations/get-product'
|
||||
import { Layout } from '@components/core'
|
||||
import { ProductView } from '@components/product'
|
||||
import getAllProductPaths from '@lib/bigcommerce/api/operations/get-all-product-paths'
|
||||
import getAllProductPaths from '@bigcommerce/storefront-data-hooks/api/operations/get-all-product-paths'
|
||||
|
||||
export async function getStaticProps({
|
||||
params,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import type { GetStaticPropsContext } from 'next'
|
||||
import { getConfig } from '@lib/bigcommerce/api'
|
||||
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||
import useCustomer from '@lib/bigcommerce/use-customer'
|
||||
import useCustomer from '@bigcommerce/storefront-data-hooks/use-customer'
|
||||
import { Layout } from '@components/core'
|
||||
import { Container, Text } from '@components/ui'
|
||||
|
||||
@@ -22,16 +22,18 @@ export default function Profile() {
|
||||
<Container>
|
||||
<Text variant="pageHeading">My Profile</Text>
|
||||
{data && (
|
||||
<div className="max-w-2xl flex flex-col space-y-5">
|
||||
<div>
|
||||
<Text variant="sectionHeading">Full Name</Text>
|
||||
<span>
|
||||
{data.firstName} {data.lastName}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<Text variant="sectionHeading">Email</Text>
|
||||
<span>{data.email}</span>
|
||||
<div className="grid lg:grid-cols-12">
|
||||
<div className="lg:col-span-8 pr-4">
|
||||
<div>
|
||||
<Text variant="sectionHeading">Full Name</Text>
|
||||
<span>
|
||||
{data.firstName} {data.lastName}
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-5">
|
||||
<Text variant="sectionHeading">Email</Text>
|
||||
<span>{data.email}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
@@ -3,9 +3,9 @@ import type { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
|
||||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
import { getConfig } from '@lib/bigcommerce/api'
|
||||
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||
import getSiteInfo from '@lib/bigcommerce/api/operations/get-site-info'
|
||||
import useSearch from '@lib/bigcommerce/products/use-search'
|
||||
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
|
||||
import getSiteInfo from '@bigcommerce/storefront-data-hooks/api/operations/get-site-info'
|
||||
import useSearch from '@bigcommerce/storefront-data-hooks/products/use-search'
|
||||
import { Layout } from '@components/core'
|
||||
import { ProductCard } from '@components/product'
|
||||
import { Container, Grid, Skeleton } from '@components/ui'
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import type { GetStaticPropsContext } from 'next'
|
||||
import { getConfig } from '@lib/bigcommerce/api'
|
||||
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||
import useWishlist from '@lib/bigcommerce/wishlist/use-wishlist'
|
||||
import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages'
|
||||
import useWishlist from '@bigcommerce/storefront-data-hooks/wishlist/use-wishlist'
|
||||
import { Layout } from '@components/core'
|
||||
import { Heart } from '@components/icons'
|
||||
import { Container, Text } from '@components/ui'
|
||||
|
Reference in New Issue
Block a user