mirror of
https://github.com/vercel/commerce.git
synced 2025-09-07 16:30:17 +00:00
fix: Add promoted item to cart
This commit is contained in:
@@ -3,14 +3,20 @@ import CartModal from 'components/cart/modal';
|
||||
import FacebookIcon from 'components/icons/facebook';
|
||||
import InstagramIcon from 'components/icons/instagram';
|
||||
import KanjiLogo from 'components/icons/kanji';
|
||||
import { Cart } from 'lib/shopify/types';
|
||||
import { Cart, Product } from 'lib/shopify/types';
|
||||
import Link from 'next/link';
|
||||
import FooterMenu from './footer-menu';
|
||||
import NewsletterFooter from './newsletter-footer';
|
||||
|
||||
const { COMPANY_NAME, SITE_NAME } = process.env;
|
||||
|
||||
export default async function Footer({ cart }: { cart?: Cart }) {
|
||||
export default async function Footer({
|
||||
cart,
|
||||
promotedItem
|
||||
}: {
|
||||
cart?: Cart;
|
||||
promotedItem?: Product;
|
||||
}) {
|
||||
const currentYear = new Date().getFullYear();
|
||||
const copyrightDate = 2023 + (currentYear > 2023 ? `-${currentYear}` : '');
|
||||
const copyrightName = COMPANY_NAME || SITE_NAME || '';
|
||||
@@ -89,7 +95,7 @@ export default async function Footer({ cart }: { cart?: Cart }) {
|
||||
|
||||
<div className="flex flex-col space-y-2 pt-24">
|
||||
<div className="flex flex-row justify-between space-x-4">
|
||||
<CartModal cart={cart} />
|
||||
<CartModal cart={cart} promotedItem={promotedItem} />
|
||||
<div className="flex flex-row items-center space-x-6">
|
||||
<Link
|
||||
href="https://www.instagram.com/suginomoribrewery/"
|
||||
|
@@ -4,11 +4,9 @@ import { Transition } from '@headlessui/react';
|
||||
import { ChevronUpIcon } from '@heroicons/react/24/outline';
|
||||
import clsx from 'clsx';
|
||||
import CartModal from 'components/cart/modal';
|
||||
import OpenCart from 'components/cart/open-cart';
|
||||
import LogoNamemark from 'components/icons/namemark';
|
||||
import { Cart, Product } from 'lib/shopify/types';
|
||||
import Link from 'next/link';
|
||||
import { Suspense } from 'react';
|
||||
import { useInView } from 'react-intersection-observer';
|
||||
import { MenuModal } from '../menu/modal';
|
||||
import { LanguageControl, SupportedLocale } from './language-control';
|
||||
@@ -63,12 +61,10 @@ export default function Navbar({
|
||||
</Link>
|
||||
</div>
|
||||
<nav className="flex flex-row items-center space-x-4 px-6">
|
||||
<Suspense fallback={<OpenCart />}>
|
||||
<div className="flex flex-col-reverse items-center justify-center space-y-2 px-2 md:flex-row md:space-x-6">
|
||||
<CartModal cart={cart} promotedItem={promotedItem} />
|
||||
<MenuModal scrolled={!inView} />
|
||||
</div>
|
||||
</Suspense>
|
||||
<div className="flex flex-col-reverse items-center justify-center space-y-2 px-2 md:flex-row md:space-x-6">
|
||||
<CartModal cart={cart} promotedItem={promotedItem} />
|
||||
<MenuModal scrolled={!inView} />
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</Transition>
|
||||
@@ -92,9 +88,7 @@ export default function Navbar({
|
||||
<LanguageControl lang={locale} />
|
||||
</div>
|
||||
<div className="flex flex-col-reverse items-center justify-center space-y-2 rounded md:flex-row md:space-x-6 md:space-y-0">
|
||||
<Suspense fallback={<OpenCart />}>
|
||||
<CartModal cart={cart} promotedItem={promotedItem} />
|
||||
</Suspense>
|
||||
<CartModal cart={cart} promotedItem={promotedItem} />
|
||||
<MenuModal scrolled={!inView} />
|
||||
</div>
|
||||
</nav>
|
||||
|
Reference in New Issue
Block a user