-
🔥 AKCIJA SE ZAVRŠAVA!
-
Popust od 5% važi još:
+
+
+
+
AKCIJA SE ZAVRŠAVA!
+
+ Popust od {maxSalePercentage}% važi još:
+
@@ -89,10 +100,6 @@ export function SaleCountdown() {
sek
-
-
- Poruči sada i uštedi na Bambu Lab filamentima!
-
);
diff --git a/src/components/SaleManager.tsx b/src/components/SaleManager.tsx
index e02fdbc..a06d38b 100644
--- a/src/components/SaleManager.tsx
+++ b/src/components/SaleManager.tsx
@@ -14,13 +14,17 @@ export function SaleManager({ filaments, selectedFilaments, onSaleUpdate }: Sale
const [saleStartDate, setSaleStartDate] = useState('');
const [saleEndDate, setSaleEndDate] = useState('');
const [enableSale, setEnableSale] = useState(true);
- const [applyToAll, setApplyToAll] = useState(false);
const [loading, setLoading] = useState(false);
const handleSaleUpdate = async () => {
+ if (selectedFilaments.size === 0) {
+ alert('Molimo izaberite filamente za primenu popusta');
+ return;
+ }
+
setLoading(true);
try {
- const filamentIds = applyToAll ? undefined : Array.from(selectedFilaments);
+ const filamentIds = Array.from(selectedFilaments);
try {
await filamentService.updateBulkSale({
@@ -45,7 +49,6 @@ export function SaleManager({ filaments, selectedFilaments, onSaleUpdate }: Sale
setSaleStartDate('');
setSaleEndDate('');
setEnableSale(true);
- setApplyToAll(false);
} catch (error) {
console.error('Error updating sale:', error);
alert('Greška pri ažuriranju popusta');
@@ -79,23 +82,9 @@ export function SaleManager({ filaments, selectedFilaments, onSaleUpdate }: Sale
-
-
- {!applyToAll && (
-
- Izabrano: {selectedFilaments.size} filament{selectedFilaments.size === 1 ? '' : 'a'}
-
- )}
+
+ Izabrano: {selectedFilaments.size} filament{selectedFilaments.size === 1 ? '' : 'a'}
+
@@ -166,7 +155,7 @@ export function SaleManager({ filaments, selectedFilaments, onSaleUpdate }: Sale
diff --git a/src/styles/index.css b/src/styles/index.css
index 0809d07..40af6cb 100644
--- a/src/styles/index.css
+++ b/src/styles/index.css
@@ -28,4 +28,18 @@
.no-transitions * {
transition: none !important;
}
+}
+
+/* Shimmer animation for sale banner */
+@keyframes shimmer {
+ 0% {
+ transform: translateX(-100%);
+ }
+ 100% {
+ transform: translateX(200%);
+ }
+}
+
+.animate-shimmer {
+ animation: shimmer 3s ease-in-out infinite;
}
\ No newline at end of file