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 }) => {
70
70
addToCart ( ) ;
71
71
} ;
72
72
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
+
73
77
return (
74
78
< >
75
79
< button
76
80
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 } ` }
80
82
>
81
83
KJØP
82
84
</ button >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " nextjs-woocommerce" ,
3
- "version" : " 1.0.12 " ,
3
+ "version" : " 1.0.13 " ,
4
4
"description" : " NextJS WooCommerce webshop" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments