diff --git a/components/ui/product-card/product-card.tsx b/components/ui/product-card/product-card.tsx index a70aabf62..fb73aa980 100644 --- a/components/ui/product-card/product-card.tsx +++ b/components/ui/product-card/product-card.tsx @@ -1,35 +1,25 @@ -'use client' +'use client'; -import Price from 'components/product/price' -import Text from 'components/ui/text' -import type { Product } from 'lib/storm/types/product' -import { cn } from 'lib/utils' -import dynamic from 'next/dynamic' -import Link from 'next/link' -import { FC } from 'react' +import Price from 'components/product/price'; +import Text from 'components/ui/text'; +import type { Product } from 'lib/storm/types/product'; +import { cn } from 'lib/utils'; +import dynamic from 'next/dynamic'; +import Link from 'next/link'; +import { FC } from 'react'; -const WishlistButton = dynamic( - () => import('components/ui/wishlist-button') -) +const WishlistButton = dynamic(() => import('components/ui/wishlist-button')); -const SanityImage = dynamic(() => import('components/ui/sanity-image')) +const SanityImage = dynamic(() => import('components/ui/sanity-image')); interface Props { - className?: string - product: Product - variant?: 'default' + className?: string; + product: Product; + variant?: 'default'; } -const ProductCard: FC = ({ - product, - className, - variant = 'default', -}) => { - - const rootClassName = cn( - 'w-full group relative overflow-hidden', - className - ) +const ProductCard: FC = ({ product, className, variant = 'default' }) => { + const rootClassName = cn('w-full group relative overflow-hidden', className); return ( = ({ locale={product.locale} > {variant === 'default' && ( -
- +
-
+
{product?.images && ( = ({ )}
-
- +
+ {product.title}
)} - ) -} + ); +}; -export default ProductCard +export default ProductCard; diff --git a/package.json b/package.json index 4b5cc1e39..b94cbed87 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,8 @@ "eslint-plugin-unicorn": "^45.0.2", "lint-staged": "^13.1.1", "postcss": "^8.4.21", - "prettier": "^2.8.4", - "prettier-plugin-tailwindcss": "^0.2.2", + "prettier": "^2.8.7", + "prettier-plugin-tailwindcss": "^0.2.7", "tailwindcss": "^3.2.6", "typescript": "4.9.5" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7bf872351..750a5b30b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,8 +35,8 @@ specifiers: next-intl: ^2.13.1 next-sanity: ^4.2.0 postcss: ^8.4.21 - prettier: ^2.8.4 - prettier-plugin-tailwindcss: ^0.2.2 + prettier: ^2.8.7 + prettier-plugin-tailwindcss: ^0.2.7 react: 18.2.0 react-cookie: ^4.1.1 react-dom: 18.2.0 diff --git a/prettier.config.js b/prettier.config.js index da6e3b298..d392a6dda 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -6,5 +6,7 @@ module.exports = { tabWidth: 2, // pnpm doesn't support plugin autoloading // https://github.com/tailwindlabs/prettier-plugin-tailwindcss#installation - plugins: [require('prettier-plugin-tailwindcss')] + plugins: [require('prettier-plugin-tailwindcss')], + pluginSearchDirs: ["."], + tailwindConfig: './tailwind.config.js', };