Test suspense in dynamic content manager

This commit is contained in:
Henrik Larsson
2023-08-10 15:16:45 +02:00
parent 6088aa98b9
commit 04477fe83a
34 changed files with 410 additions and 310 deletions

View File

@@ -1,6 +1,6 @@
'use client';
import { PlusIcon } from '@radix-ui/react-icons';
import { PlusIcon } from '@heroicons/react/24/outline';
import clsx from 'clsx';
import { addItem } from 'components/cart/actions';
import LoadingDots from 'components/loading-dots';

View File

@@ -1,10 +1,10 @@
import { XMarkIcon } from '@heroicons/react/24/outline';
import clsx from 'clsx';
import CloseIcon from 'components/icons/close';
export default function CloseCart({ className }: { className?: string }) {
return (
<div className="relative flex h-11 w-11 items-center justify-center rounded-md border border-neutral-200 text-black transition-colors dark:border-neutral-700 dark:text-white">
<CloseIcon className={clsx('h-6 transition-all ease-in-out hover:scale-110 ', className)} />
<XMarkIcon className={clsx('h-6 transition-all ease-in-out hover:scale-110 ', className)} />
</div>
);
}

View File

@@ -1,7 +1,7 @@
import CloseIcon from 'components/icons/close';
import LoadingDots from 'components/loading-dots';
import { useRouter } from 'next/navigation';
import { XMarkIcon } from '@heroicons/react/24/outline';
import clsx from 'clsx';
import { removeItem } from 'components/cart/actions';
import type { CartItem } from 'lib/shopify/types';
@@ -38,7 +38,7 @@ export default function DeleteItemButton({ item }: { item: CartItem }) {
{isPending ? (
<LoadingDots className="bg-white" />
) : (
<CloseIcon className="hover:text-accent-3 mx-[1px] h-4 w-4 text-white " />
<XMarkIcon className="hover:text-accent-3 mx-[1px] h-4 w-4 text-white " />
)}
</button>
);

View File

@@ -1,10 +1,9 @@
import { useRouter } from 'next/navigation';
import { useTransition } from 'react';
import { MinusIcon, PlusIcon } from '@heroicons/react/24/outline';
import clsx from 'clsx';
import { removeItem, updateItemQuantity } from 'components/cart/actions';
import MinusIcon from 'components/icons/minus';
import PlusIcon from 'components/icons/plus';
import LoadingDots from 'components/loading-dots';
import type { CartItem } from 'lib/shopify/types';

View File

@@ -1,7 +1,7 @@
'use client';
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet';
import ShoppingBagIcon from 'components/icons/shopping-bag';
import { ShoppingBagIcon } from '@heroicons/react/24/outline';
import Price from 'components/price';
import { DEFAULT_OPTION } from 'lib/constants';
import type { Cart } from 'lib/shopify/types';

View File

@@ -1,5 +1,5 @@
import { ShoppingBagIcon } from '@heroicons/react/24/outline';
import clsx from 'clsx';
import ShoppingBagIcon from 'components/icons/shopping-bag';
export default function OpenCart({
className,
@@ -9,10 +9,10 @@ export default function OpenCart({
quantity?: number;
}) {
return (
<div className="relative flex h-11 w-11 items-center justify-center rounded-md border border-ui-border text-high-contrast transition-colors">
<div className="relative flex h-11 w-11 items-center justify-center text-high-contrast">
<ShoppingBagIcon
className={clsx(
'h-4 stroke-current transition-all ease-in-out hover:scale-110 ',
'h-5 stroke-current transition-all ease-in-out hover:scale-110 ',
className
)}
/>