mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Wishlist
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import '@assets/main.css'
|
||||
import 'keen-slider/keen-slider.min.css'
|
||||
import '@assets/chrome-bug.css'
|
||||
import 'keen-slider/keen-slider.min.css'
|
||||
|
||||
import { FC, useEffect } from 'react'
|
||||
import type { AppProps } from 'next/app'
|
||||
|
||||
import { ManagedUIContext } from '@components/ui/context'
|
||||
import { Head } from '@components/common'
|
||||
import { ManagedUIContext } from '@components/ui/context'
|
||||
|
||||
const Noop: FC = ({ children }) => <>{children}</>
|
||||
|
||||
|
@@ -1,28 +1,43 @@
|
||||
import { useEffect } from 'react'
|
||||
import { useRouter } from 'next/router'
|
||||
import type { GetStaticPropsContext } from 'next'
|
||||
import { getConfig } from '@framework/api'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
import useWishlist from '@framework/wishlist/use-wishlist'
|
||||
import { Layout } from '@components/common'
|
||||
|
||||
import { Heart } from '@components/icons'
|
||||
import { Layout } from '@components/common'
|
||||
import { Text, Container } from '@components/ui'
|
||||
import { WishlistCard } from '@components/wishlist'
|
||||
import { defaultPageProps } from '@lib/defaults'
|
||||
import { getConfig } from '@framework/api'
|
||||
import { useCustomer } from '@framework/customer'
|
||||
import { WishlistCard } from '@components/wishlist'
|
||||
import useWishlist from '@framework/wishlist/use-wishlist'
|
||||
import getAllPages from '@framework/common/get-all-pages'
|
||||
import frameworkConfig from '@framework/config.json'
|
||||
|
||||
export async function getStaticProps({
|
||||
preview,
|
||||
locale,
|
||||
}: GetStaticPropsContext) {
|
||||
// Disabling page if Feature is not available
|
||||
if (!frameworkConfig.features.wishlist) {
|
||||
return {
|
||||
notFound: true,
|
||||
}
|
||||
}
|
||||
|
||||
const config = getConfig({ locale })
|
||||
const { pages } = await getAllPages({ config, preview })
|
||||
return {
|
||||
props: { ...defaultPageProps, pages },
|
||||
props: {
|
||||
pages,
|
||||
...defaultPageProps,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default function Wishlist() {
|
||||
const { data: customer } = useCustomer()
|
||||
const { data, isLoading, isEmpty } = useWishlist()
|
||||
const router = useRouter()
|
||||
|
||||
return (
|
||||
<Container>
|
||||
|
Reference in New Issue
Block a user