@codesinger0/shared-components 1.1.81 → 1.1.83
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.
|
@@ -3,14 +3,19 @@ import { motion, AnimatePresence } from 'framer-motion';
|
|
|
3
3
|
import { ShoppingCart } from 'lucide-react';
|
|
4
4
|
import { useCart } from '../../context/CartContext';
|
|
5
5
|
|
|
6
|
-
const FloatingCartButton = (
|
|
6
|
+
const FloatingCartButton = ({
|
|
7
|
+
absolute = true,
|
|
8
|
+
icon: CustomIcon = ShoppingCart,
|
|
9
|
+
bgColor = 'bg-orange-500',
|
|
10
|
+
hoverColor = 'hover:brightness-90'
|
|
11
|
+
}) => {
|
|
7
12
|
const { totalItems, toggleCart } = useCart();
|
|
8
13
|
|
|
9
14
|
return (
|
|
10
|
-
<div className=
|
|
15
|
+
<div className={`${absolute ? 'fixed bottom-6 right-6' : 'relative'} z-30`}>
|
|
11
16
|
<motion.button
|
|
12
17
|
onClick={toggleCart}
|
|
13
|
-
className=
|
|
18
|
+
className={`relative ${bgColor} text-white p-4 rounded-full shadow-lg ${hoverColor} transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-opacity-50`}
|
|
14
19
|
style={{
|
|
15
20
|
transform: 'translate3d(0, 0, 0)',
|
|
16
21
|
WebkitTransform: 'translate3d(0, 0, 0)',
|
|
@@ -21,7 +26,7 @@ const FloatingCartButton = () => {
|
|
|
21
26
|
animate={{ scale: 1 }}
|
|
22
27
|
transition={{ type: "spring", stiffness: 300, damping: 25 }}
|
|
23
28
|
>
|
|
24
|
-
<
|
|
29
|
+
<CustomIcon size={26} />
|
|
25
30
|
{/* Badge */}
|
|
26
31
|
<AnimatePresence>
|
|
27
32
|
{totalItems > 0 && (
|
|
@@ -42,6 +42,7 @@ const OrderForm = ({
|
|
|
42
42
|
addToast, // Inject toast function
|
|
43
43
|
cartItems,
|
|
44
44
|
totalPrice,
|
|
45
|
+
businessName,
|
|
45
46
|
paymentLinkCreationURL,
|
|
46
47
|
scrollContainerRef
|
|
47
48
|
}) => {
|
|
@@ -137,6 +138,7 @@ const OrderForm = ({
|
|
|
137
138
|
|
|
138
139
|
// Map cart items to products data format
|
|
139
140
|
const productsData = orderData.items.map((item) => ({
|
|
141
|
+
businessName,
|
|
140
142
|
catalogNumber: item.id,
|
|
141
143
|
name: item.name,
|
|
142
144
|
price: isUserClubMember ? item.price * (1 - clubDiscountPercentage / 100) : item.price,
|
|
@@ -162,6 +164,7 @@ const OrderForm = ({
|
|
|
162
164
|
'Content-Type': 'application/json'
|
|
163
165
|
},
|
|
164
166
|
body: JSON.stringify({
|
|
167
|
+
businessName: 'confectioneryShop',
|
|
165
168
|
operation: 'createPaymentLink',
|
|
166
169
|
customerName: orderData.customerName,
|
|
167
170
|
customerPhone: orderData.customerPhone,
|