From c8036538d95d2dc62b169b3368b80eae46a49a4e Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Fri, 4 Aug 2023 18:36:41 -0500 Subject: [PATCH] Why is prettier borked --- app/error.tsx | 14 +++++-- components/cart/actions.ts | 8 ++-- components/cart/add-to-cart.tsx | 68 ++++++++++++++++----------------- package.json | 2 +- pnpm-lock.yaml | 14 +++---- 5 files changed, 57 insertions(+), 49 deletions(-) diff --git a/app/error.tsx b/app/error.tsx index c4735fbcb..e0a7416a3 100644 --- a/app/error.tsx +++ b/app/error.tsx @@ -2,10 +2,18 @@ export default function Error({ reset }: { reset: () => void }) { return ( -
+

Oh no!

-

There was an issue with our storefront. This could be a temporary issue, please try your action again.

- +

+ There was an issue with our storefront. This could be a temporary issue, please try your + action again. +

+
); } diff --git a/components/cart/actions.ts b/components/cart/actions.ts index c623668b7..3fb013194 100644 --- a/components/cart/actions.ts +++ b/components/cart/actions.ts @@ -18,13 +18,13 @@ export const addItem = async (variantId: string | undefined): Promise => try { await removeFromCart(cartId, [lineId]); } catch (e) { - return 'Error removing item from cart' + return 'Error removing item from cart'; } }; @@ -64,6 +64,6 @@ export const updateItemQuantity = async ({ } ]); } catch (e) { - return 'Error updating item quantity' + return 'Error updating item quantity'; } }; diff --git a/components/cart/add-to-cart.tsx b/components/cart/add-to-cart.tsx index eedbe1fee..f9d21c0fd 100644 --- a/components/cart/add-to-cart.tsx +++ b/components/cart/add-to-cart.tsx @@ -26,43 +26,43 @@ export function AddToCart({ ); const selectedVariantId = variant?.id || defaultVariantId; const title = !availableForSale - ? 'Out of stock' - : !selectedVariantId - ? 'Please select options' - : undefined; - + ? 'Out of stock' + : !selectedVariantId + ? 'Please select options' + : undefined; + return ( - + + router.refresh(); + }); + }} + className={clsx( + 'relative flex w-full items-center justify-center rounded-full bg-blue-600 p-4 tracking-wide text-white hover:opacity-90', + { + 'cursor-not-allowed opacity-60 hover:opacity-60': !availableForSale || !selectedVariantId, + 'cursor-not-allowed': isPending + } + )} + > +
+ {!isPending ? : } +
+ {availableForSale ? 'Add To Cart' : 'Out Of Stock'} + ); } diff --git a/package.json b/package.json index cd27bc6a9..ced3d26a4 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "eslint-plugin-unicorn": "^48.0.0", "lint-staged": "^13.2.3", "postcss": "^8.4.27", - "prettier": "^3.0.0", + "prettier": "3.0.1", "prettier-plugin-tailwindcss": "^0.4.1", "tailwindcss": "^3.3.3", "typescript": "5.1.6" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9d74accad..67dc0e88d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,11 +61,11 @@ devDependencies: specifier: ^8.4.27 version: 8.4.27 prettier: - specifier: ^3.0.0 - version: 3.0.0 + specifier: 3.0.1 + version: 3.0.1 prettier-plugin-tailwindcss: specifier: ^0.4.1 - version: 0.4.1(prettier@3.0.0) + version: 0.4.1(prettier@3.0.1) tailwindcss: specifier: ^3.3.3 version: 3.3.3 @@ -2630,7 +2630,7 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier-plugin-tailwindcss@0.4.1(prettier@3.0.0): + /prettier-plugin-tailwindcss@0.4.1(prettier@3.0.1): resolution: {integrity: sha512-hwn2EiJmv8M+AW4YDkbjJ6HlZCTzLyz1QlySn9sMuKV/Px0fjwldlB7tol8GzdgqtkdPtzT3iJ4UzdnYXP25Ag==} engines: {node: '>=12.17.0'} peerDependencies: @@ -2682,11 +2682,11 @@ packages: prettier-plugin-twig-melody: optional: true dependencies: - prettier: 3.0.0 + prettier: 3.0.1 dev: true - /prettier@3.0.0: - resolution: {integrity: sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==} + /prettier@3.0.1: + resolution: {integrity: sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==} engines: {node: '>=14'} hasBin: true dev: true