mirror of
https://github.com/vercel/commerce.git
synced 2025-05-19 16:07:01 +00:00
separate menus
This commit is contained in:
parent
724f2bbcc0
commit
0cbd56de8b
@ -2,7 +2,7 @@ import Link from 'next/link';
|
|||||||
|
|
||||||
import FooterMenu from 'components/layout/footer-menu';
|
import FooterMenu from 'components/layout/footer-menu';
|
||||||
import LogoSquare from 'components/logo-square';
|
import LogoSquare from 'components/logo-square';
|
||||||
import { getMenu } from 'lib/shopify';
|
import { getFooterMenu, getMenu } from 'lib/shopify';
|
||||||
import { Suspense } from 'react';
|
import { Suspense } from 'react';
|
||||||
|
|
||||||
// const { COMPANY_NAME, SITE_NAME } = process.env;
|
// const { COMPANY_NAME, SITE_NAME } = process.env;
|
||||||
@ -14,7 +14,7 @@ export default async function Footer() {
|
|||||||
const currentYear = new Date().getFullYear();
|
const currentYear = new Date().getFullYear();
|
||||||
const copyrightDate = 2023 + (currentYear > 2023 ? `-${currentYear}` : '');
|
const copyrightDate = 2023 + (currentYear > 2023 ? `-${currentYear}` : '');
|
||||||
const skeleton = 'w-full h-6 animate-pulse rounded bg-neutral-200 dark:bg-neutral-700';
|
const skeleton = 'w-full h-6 animate-pulse rounded bg-neutral-200 dark:bg-neutral-700';
|
||||||
const menu = await getMenu('next-js-frontend-footer-menu');
|
const menu = await getFooterMenu('next-js-frontend-footer-menu');
|
||||||
const copyrightName = COMPANY_NAME || SITE_NAME || '';
|
const copyrightName = COMPANY_NAME || SITE_NAME || '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -155,6 +155,32 @@ export async function getCollections(): Promise<Collection[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getMenu = async (handle: string): Promise<Menu[]> => {
|
export const getMenu = async (handle: string): Promise<Menu[]> => {
|
||||||
|
const res = mockFetchResponse({
|
||||||
|
menu: {
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
title: 'All',
|
||||||
|
path: '/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Summer',
|
||||||
|
path: '/search/summer-collection'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Winter',
|
||||||
|
path: '/search/winter-collection'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Europe',
|
||||||
|
path: '/search/europe-collection'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return res.body.data.menu.items;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getFooterMenu = async (handle: string): Promise<Menu[]> => {
|
||||||
const res = mockFetchResponse({
|
const res = mockFetchResponse({
|
||||||
menu: {
|
menu: {
|
||||||
items: [
|
items: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user