File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -70,13 +70,15 @@ const AddToCartButton = ({ product }) => {
7070 addToCart ( ) ;
7171 } ;
7272
73+ // Separate out conditions here for increased readability
74+ const fadeInButton = addToCartLoading && `animate__animated animate__fadeOutUp` ;
75+ const fadeOutButton = showAddToCart && `animate__animated animate__fadeInDown` ;
76+
7377 return (
7478 < >
7579 < button
7680 onClick = { handleAddToCartClick }
77- className = { `px-4 py-2 font-bold bg-white border border-gray-400 border-solid rounded hover:bg-gray-400 ${
78- addToCartLoading && `animate__animated animate__fadeOutUp`
79- } ${ showAddToCart && `animate__animated animate__fadeInDown` } `}
81+ className = { `px-4 py-2 font-bold bg-white border border-gray-400 border-solid rounded hover:bg-gray-400 ${ fadeInButton } ${ fadeOutButton } ` }
8082 >
8183 KJØP
8284 </ button >
Original file line number Diff line number Diff line change 11{
22 "name" : " nextjs-woocommerce" ,
3- "version" : " 1.0.12 " ,
3+ "version" : " 1.0.13 " ,
44 "description" : " NextJS WooCommerce webshop" ,
55 "main" : " index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments