mirror of
https://github.com/vercel/commerce.git
synced 2025-05-12 20:57:51 +00:00
use getAllMetaObjects for collection page
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
parent
eec6518905
commit
fd01a50866
@ -1,16 +1,16 @@
|
|||||||
import { InformationCircleIcon } from '@heroicons/react/24/outline';
|
import { InformationCircleIcon } from '@heroicons/react/24/outline';
|
||||||
|
import ActivateWarranty from 'components/orders/activate-warranty';
|
||||||
import MobileOrderActions from 'components/orders/mobile-order-actions';
|
import MobileOrderActions from 'components/orders/mobile-order-actions';
|
||||||
import OrdersHeader from 'components/orders/orders-header';
|
import OrdersHeader from 'components/orders/orders-header';
|
||||||
import Price from 'components/price';
|
import Price from 'components/price';
|
||||||
|
import { Button } from 'components/ui';
|
||||||
import { getCustomerOrders } from 'lib/shopify';
|
import { getCustomerOrders } from 'lib/shopify';
|
||||||
import { isBeforeToday, toPrintDate } from 'lib/utils';
|
import { toPrintDate } from 'lib/utils';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { Button } from 'components/ui';
|
|
||||||
import dynamic from 'next/dynamic';
|
|
||||||
|
|
||||||
const OrderConfirmation = dynamic(() => import('components/orders/order-confirmation'));
|
const OrderConfirmation = dynamic(() => import('components/orders/order-confirmation'));
|
||||||
const ActivateWarranty = dynamic(() => import('components/orders/activate-warranty'));
|
|
||||||
|
|
||||||
export default async function AccountPage() {
|
export default async function AccountPage() {
|
||||||
const orders = await getCustomerOrders();
|
const orders = await getCustomerOrders();
|
||||||
@ -64,9 +64,7 @@ export default async function AccountPage() {
|
|||||||
<span className="sr-only">{order.normalizedId}</span>
|
<span className="sr-only">{order.normalizedId}</span>
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
{!isBeforeToday(order?.warrantyActivationDeadline?.value) && (
|
<ActivateWarranty order={order} />
|
||||||
<ActivateWarranty order={order} />
|
|
||||||
)}
|
|
||||||
{!order.orderConfirmation && <OrderConfirmation order={order} />}
|
{!order.orderConfirmation && <OrderConfirmation order={order} />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { getMenu, getMetaobjects } from 'lib/shopify';
|
import { getAllMetaobjects, getMenu } from 'lib/shopify';
|
||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
import FiltersList from './filters-list';
|
import FiltersList from './filters-list';
|
||||||
|
|
||||||
@ -14,9 +14,9 @@ const YMMFiltersContainer = ({ children }: { children: ReactNode }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const YMMFilters = async () => {
|
const YMMFilters = async () => {
|
||||||
const yearsData = getMetaobjects('make_model_year_composite');
|
const yearsData = getAllMetaobjects('make_model_year_composite');
|
||||||
const modelsData = getMetaobjects('make_model_composite');
|
const modelsData = getAllMetaobjects('make_model_composite');
|
||||||
const makesData = getMetaobjects('make');
|
const makesData = getAllMetaobjects('make');
|
||||||
|
|
||||||
const [years, models, makes] = await Promise.all([yearsData, modelsData, makesData]);
|
const [years, models, makes] = await Promise.all([yearsData, modelsData, makesData]);
|
||||||
const menu = await getMenu('main-menu');
|
const menu = await getMenu('main-menu');
|
||||||
@ -33,7 +33,7 @@ const YMMFilters = async () => {
|
|||||||
export const YMMFiltersPlaceholder = () => {
|
export const YMMFiltersPlaceholder = () => {
|
||||||
return (
|
return (
|
||||||
<YMMFiltersContainer>
|
<YMMFiltersContainer>
|
||||||
<div className="flex grow animate-pulse flex-col items-center gap-3 md:flex-row">
|
<div className="flex grow animate-pulse flex-col items-center gap-3 @md:flex-row">
|
||||||
<div className="h-9 w-full rounded bg-gray-100" />
|
<div className="h-9 w-full rounded bg-gray-100" />
|
||||||
<div className="h-9 w-full rounded bg-gray-100" />
|
<div className="h-9 w-full rounded bg-gray-100" />
|
||||||
<div className="h-9 w-full rounded bg-gray-100" />
|
<div className="h-9 w-full rounded bg-gray-100" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user