@codesinger0/shared-components 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,13 +31,6 @@ const LargeItemCard = ({
31
31
  {/* Background Section with Text Content */}
32
32
  <div className="glass-card relative" style={{ minHeight: '48vh', overflow: 'visible' }}>
33
33
 
34
- {/* Sold Out Badge */}
35
- {amountAvailable !== undefined && amountAvailable <= 0 && (
36
- <div className="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-20 bg-red-500 text-white px-8 py-3 rounded-lg text-xl font-bold shadow-2xl">
37
- {soldOutLabel}
38
- </div>
39
- )}
40
-
41
34
  <div className="max-w-7xl mx-auto px-6 pt-16">
42
35
  <div className="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center">
43
36
 
@@ -86,13 +79,20 @@ const LargeItemCard = ({
86
79
  )}
87
80
 
88
81
  <div className="py-4 mb-4">
89
- <RoundButton
90
- variant="primary"
91
- onClick={onButtonClick}
92
- disabled={amountAvailable !== undefined && amountAvailable <= 0}
93
- >
94
- {buttonLabel}
95
- </RoundButton>
82
+ {/* Sold Out Badge */}
83
+ {amountAvailable !== undefined && amountAvailable <= 0 ? (
84
+ <div className="inline-block z-20 bg-red-500 text-white px-8 py-3 rounded-lg text-lg font-bold shadow-2xl">
85
+ {soldOutLabel}
86
+ </div>
87
+ ) : (
88
+ <RoundButton
89
+ variant="primary"
90
+ onClick={onButtonClick}
91
+ disabled={amountAvailable !== undefined && amountAvailable <= 0}
92
+ >
93
+ {buttonLabel}
94
+ </RoundButton>
95
+ )}
96
96
  </div>
97
97
 
98
98
  {/* Icons Section */}
@@ -9,7 +9,7 @@ const SmallItemCard = ({
9
9
  description,
10
10
  price,
11
11
  discountPrice,
12
- amountAvailable,
12
+ amountAvailable,
13
13
  availableLabel = 'נותרו במלאי',
14
14
  soldOutLabel = 'אזל במלאי',
15
15
  className = '',
@@ -28,10 +28,17 @@ const SmallItemCard = ({
28
28
  onAddToCart()
29
29
  }
30
30
 
31
+ const handleCardClickWrapper = (event) => {
32
+ if (amountAvailable !== undefined && amountAvailable <= 0) {
33
+ return
34
+ }
35
+ onClick(event)
36
+ }
37
+
31
38
  return (
32
39
  <div
33
40
  className={`glass-card cursor-pointer transition-all duration-300 hover:scale-104 ${className}`}
34
- onClick={onClick}
41
+ onClick={handleCardClickWrapper}
35
42
  dir="rtl"
36
43
  {...props}
37
44
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codesinger0/shared-components",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Shared React components for customer projects",
5
5
  "main": "dist/index.js",
6
6
  "files": [