Work with displaying content

This commit is contained in:
Henrik Larsson
2023-05-03 23:16:19 +02:00
parent 603bd2b880
commit a9ad63d056
14 changed files with 421 additions and 72 deletions

View File

@@ -4,7 +4,7 @@ import clsx from 'clsx';
import { useRouter, useSearchParams } from 'next/navigation';
import { useEffect, useState, useTransition } from 'react';
import LoadingDots from 'components/loading-dots';
import LoadingDots from 'components/ui/loading-dots';
import { ProductVariant } from 'lib/shopify/types';
export function AddToCart({

View File

@@ -1,17 +1,19 @@
const Price = ({
amount,
currencyCode = 'USD',
currencyCode,
...props
}: {
amount: string;
currencyCode: string;
currencyCode: string | 'SEK' | 'GPB';
} & React.ComponentProps<'p'>) => (
<p suppressHydrationWarning={true} {...props}>
{`${new Intl.NumberFormat(undefined, {
style: 'currency',
currency: currencyCode,
currencyDisplay: 'narrowSymbol'
}).format(parseFloat(amount))} ${currencyCode}`}
</p>
);