From 40b882ab37d30b8980ebf98f8d72409964eabe66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20G=C4=99siarz?= <126520293+arturgesiarz@users.noreply.github.com> Date: Sun, 11 Jan 2026 11:56:42 +0100 Subject: [PATCH 1/7] Delete payment section --- src/api/order-service.ts | 8 +- src/hooks/useCheckout.ts | 32 +----- src/pages/CartPage.tsx | 5 +- src/pages/CheckoutPage.tsx | 9 -- src/pages/checkout/PaymentMethodSection.tsx | 109 -------------------- src/types/orders.ts | 1 - 6 files changed, 12 insertions(+), 152 deletions(-) delete mode 100644 src/pages/checkout/PaymentMethodSection.tsx diff --git a/src/api/order-service.ts b/src/api/order-service.ts index 0f6c9b9..b2603c3 100644 --- a/src/api/order-service.ts +++ b/src/api/order-service.ts @@ -1,4 +1,8 @@ -import type { OrderCreateRequest, OrderCreateResponse, OrderDetailsResponse } from "../types/orders"; +import type { + OrderCreateRequest, + OrderCreateResponse, + OrderDetailsResponse, +} from "../types/orders"; import { API_BASE_URL, apiCall } from "./utils"; export const fetchUserOrders = async (): Promise => { @@ -80,4 +84,4 @@ export const createOrder = async (order: OrderCreateRequest): Promise { const [shippingModalOpen, setShippingModalOpen] = useState(false); const [invoiceModalOpen, setInvoiceModalOpen] = useState(false); const [wantsInvoice, setWantsInvoice] = useState(savedData?.wantsInvoice || false); - const [paymentMethod, setPaymentMethod] = useState<"card" | "cod">( - savedData?.paymentMethod || "card", - ); const [discountCode, setDiscountCode] = useState(savedData?.discountCode || ""); const [isDiscountApplied, setIsDiscountApplied] = useState(savedData?.isDiscountApplied || false); const [discountError, setDiscountError] = useState(null); @@ -108,9 +104,6 @@ export const useCheckout = (initialOrderId?: string) => { if (newSavedData.wantsInvoice !== undefined && newSavedData.wantsInvoice !== wantsInvoice) { setWantsInvoice(newSavedData.wantsInvoice); } - if (newSavedData.paymentMethod && newSavedData.paymentMethod !== paymentMethod) { - setPaymentMethod(newSavedData.paymentMethod); - } if (newSavedData.discountCode && newSavedData.discountCode !== discountCode) { setDiscountCode(newSavedData.discountCode); } @@ -140,7 +133,6 @@ export const useCheckout = (initialOrderId?: string) => { JSON.stringify(parsed.shippingData) === JSON.stringify(shippingData) && JSON.stringify(parsed.invoiceData) === JSON.stringify(invoiceData) && parsed.wantsInvoice === wantsInvoice && - parsed.paymentMethod === paymentMethod && parsed.discountCode === discountCode && parsed.isDiscountApplied === isDiscountApplied ) { @@ -155,21 +147,12 @@ export const useCheckout = (initialOrderId?: string) => { shippingData, invoiceData, wantsInvoice, - paymentMethod, discountCode, isDiscountApplied, }; sessionStorage.setItem(storageKey, JSON.stringify(dataToSave)); } - }, [ - orderId, - shippingData, - invoiceData, - wantsInvoice, - paymentMethod, - discountCode, - isDiscountApplied, - ]); + }, [orderId, shippingData, invoiceData, wantsInvoice, discountCode, isDiscountApplied]); const subtotal = useMemo( () => cartItems.reduce((sum, item) => sum + item.price * item.quantity, 0), @@ -240,15 +223,8 @@ export const useCheckout = (initialOrderId?: string) => { return; } - if (paymentMethod === "card") { - // Redirect to card payment page with orderId in URL - const paymentId = crypto.randomUUID(); - navigate(`/payment/${paymentId}/${orderId}`); - } else { - // Cash on delivery - redirect directly to confirmation with token - const confirmationToken = crypto.randomUUID(); - navigate(`/order-confirmation/${orderId}/${confirmationToken}`); - } + const paymentId = crypto.randomUUID(); + navigate(`/payment/${paymentId}/${orderId}`); }; const getShippingDataForInvoice = (): @@ -283,7 +259,6 @@ export const useCheckout = (initialOrderId?: string) => { shippingModalOpen, invoiceModalOpen, wantsInvoice, - paymentMethod, discountCode, shippingData, invoiceData, @@ -300,7 +275,6 @@ export const useCheckout = (initialOrderId?: string) => { // Setters setShippingModalOpen, setInvoiceModalOpen, - setPaymentMethod, setDiscountCode, // Handlers diff --git a/src/pages/CartPage.tsx b/src/pages/CartPage.tsx index 460dbfa..d1d055a 100644 --- a/src/pages/CartPage.tsx +++ b/src/pages/CartPage.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useState } from "react"; +import { createOrder } from "../api/order-service.ts"; import { getVariantDetails } from "../api/product-service"; import Breadcrumbs from "../components/common/Breadcrumbs.tsx"; import MainLayout from "../components/layout/MainLayout.tsx"; @@ -27,7 +28,6 @@ import { useTheme, } from "@mui/material"; import { useNavigate } from "react-router-dom"; -import { createOrder } from "../api/order-service.ts"; const SHIPPING_COST = 19.99; const FREE_SHIPPING_THRESHOLD = 500; @@ -299,7 +299,8 @@ const CartPage: React.FC = () => { isReturnable: true, })), }); - const orderId = order.orderId + console.log(order); + const orderId = order.orderId; navigate(`/order/${orderId}`); }; diff --git a/src/pages/CheckoutPage.tsx b/src/pages/CheckoutPage.tsx index 57a1f4d..e935eda 100644 --- a/src/pages/CheckoutPage.tsx +++ b/src/pages/CheckoutPage.tsx @@ -6,7 +6,6 @@ import { useCheckout } from "../hooks/useCheckout.ts"; import DiscountSection from "./checkout/DiscountSection.tsx"; import InvoiceModal from "./checkout/InvoiceModal.tsx"; import OrderSummary from "./checkout/OrderSummary.tsx"; -import PaymentMethodSection from "./checkout/PaymentMethodSection.tsx"; import ShippingModal from "./checkout/ShippingModal.tsx"; import ShippingSection from "./checkout/ShippingSection.tsx"; import { Box, Typography, Container, Grid, Button } from "@mui/material"; @@ -20,7 +19,6 @@ const CheckoutPage: React.FC = () => { shippingModalOpen, invoiceModalOpen, wantsInvoice, - paymentMethod, discountCode, shippingData, invoiceData, @@ -34,7 +32,6 @@ const CheckoutPage: React.FC = () => { canPay, setShippingModalOpen, setInvoiceModalOpen, - setPaymentMethod, setDiscountCode, handleShippingSubmit, handleInvoiceSubmit, @@ -83,12 +80,6 @@ const CheckoutPage: React.FC = () => { onInvoiceChange={handleInvoiceChange} onEditInvoice={() => setInvoiceModalOpen(true)} /> - - - void; -} - -const PaymentMethodSection: React.FC = ({ - paymentMethod, - onPaymentMethodChange, -}) => { - const theme = useTheme(); - - return ( - - - - - Payment Method - - - - - - onPaymentMethodChange(e.target.value as "card" | "cod")} - sx={{ display: "flex", flexDirection: "column", gap: 2 }} - > - } - label={ - - - - Credit Card - - - } - sx={{ mb: 2, width: "100%", m: 0 }} - /> - } - label={ - - - - Cash on Delivery - - - } - sx={{ width: "100%", m: 0 }} - /> - - - - ); -}; - -export default PaymentMethodSection; diff --git a/src/types/orders.ts b/src/types/orders.ts index c9c3335..04fbdbe 100644 --- a/src/types/orders.ts +++ b/src/types/orders.ts @@ -44,7 +44,6 @@ export interface OrderCreateResponse { failedVariants: FailedReservationVariantDto[]; } - export const getStatusLabel = (status: string): string => { return STATUS_LABELS[status as OrderStatus] || status; }; From 4887da287a4c5644f6253bd70b42863aaf726e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20G=C4=99siarz?= <126520293+arturgesiarz@users.noreply.github.com> Date: Sun, 11 Jan 2026 12:52:14 +0100 Subject: [PATCH 2/7] Add free delivery --- src/hooks/useCheckout.ts | 8 +-- src/hooks/usePayment.ts | 9 +--- src/pages/CartPage.tsx | 81 ++++++++-------------------- src/pages/CheckoutPage.tsx | 2 - src/pages/PaymentPage.tsx | 14 ++--- src/pages/checkout/OrderSummary.tsx | 8 ++- src/pages/payment/PaymentSummary.tsx | 8 ++- 7 files changed, 34 insertions(+), 96 deletions(-) diff --git a/src/hooks/useCheckout.ts b/src/hooks/useCheckout.ts index b4532e3..a438c26 100644 --- a/src/hooks/useCheckout.ts +++ b/src/hooks/useCheckout.ts @@ -4,8 +4,6 @@ import type { ShippingFormValues } from "../components/forms/ShippingForm.tsx"; import { useCartContext } from "../contexts/CartContext"; import { useNavigate } from "react-router-dom"; -const SHIPPING_COST = 19.99; -const FREE_SHIPPING_THRESHOLD = 500; const DISCOUNT_CODE = "RABAT20"; const DISCOUNT_PERCENTAGE = 0.2; // 20% @@ -159,10 +157,7 @@ export const useCheckout = (initialOrderId?: string) => { [cartItems], ); - const shipping = useMemo( - () => (subtotal >= FREE_SHIPPING_THRESHOLD ? 0 : SHIPPING_COST), - [subtotal], - ); + const shipping = 0; // Always free shipping const discountAmount = useMemo(() => { if (!isDiscountApplied) return 0; @@ -264,7 +259,6 @@ export const useCheckout = (initialOrderId?: string) => { invoiceData, orderId, subtotal, - shipping, total, totalBeforeDiscount, discountAmount, diff --git a/src/hooks/usePayment.ts b/src/hooks/usePayment.ts index ee96d26..8f449fc 100644 --- a/src/hooks/usePayment.ts +++ b/src/hooks/usePayment.ts @@ -8,9 +8,6 @@ const VALID_CARD = { cvv: "123", }; -const SHIPPING_COST = 19.99; -const FREE_SHIPPING_THRESHOLD = 500; - export interface CardFormValues { cardNumber: string; cardholderName: string; @@ -28,10 +25,7 @@ export const usePayment = () => { [cartItems], ); - const shipping = useMemo( - () => (subtotal >= FREE_SHIPPING_THRESHOLD ? 0 : SHIPPING_COST), - [subtotal], - ); + const shipping = 0; // Always free shipping const total = useMemo(() => subtotal + shipping, [subtotal, shipping]); @@ -85,7 +79,6 @@ export const usePayment = () => { return { subtotal, - shipping, total, paymentError, isProcessing, diff --git a/src/pages/CartPage.tsx b/src/pages/CartPage.tsx index d1d055a..4bed799 100644 --- a/src/pages/CartPage.tsx +++ b/src/pages/CartPage.tsx @@ -29,9 +29,6 @@ import { } from "@mui/material"; import { useNavigate } from "react-router-dom"; -const SHIPPING_COST = 19.99; -const FREE_SHIPPING_THRESHOLD = 500; - const CartProductCard: React.FC<{ item: CartItem; onClick: () => void }> = ({ item, onClick }) => { const { updateProductQuantity, overwriteProductQuantity, removeProduct } = useCartContext(); const theme = useTheme(); @@ -282,7 +279,7 @@ const CartPage: React.FC = () => { } return sum + item.price * item.quantity; }, 0); - const shipping = subtotal >= FREE_SHIPPING_THRESHOLD ? 0 : SHIPPING_COST; + const shipping = 0; // Always free shipping const total = subtotal + shipping; const handleCheckout = async () => { @@ -299,7 +296,6 @@ const CartPage: React.FC = () => { isReturnable: true, })), }); - console.log(order); const orderId = order.orderId; navigate(`/order/${orderId}`); }; @@ -352,56 +348,25 @@ const CartPage: React.FC = () => { ); })} - {FREE_SHIPPING_THRESHOLD - subtotal > 0 && ( - - - - - Free shipping within reach! - - - Add products worth{" "} - {(FREE_SHIPPING_THRESHOLD - subtotal).toFixed(2)} PLN{" "} - more and get free shipping! - - - - )} - - {shipping === 0 && ( - - - - Congratulations! You have free shipping! - - - )} + + + + Free shipping on all orders! + + ) : ( { - {shipping === 0 && } - {shipping === 0 ? "GRATIS" : `${shipping.toFixed(2)} PLN`} + + GRATIS diff --git a/src/pages/CheckoutPage.tsx b/src/pages/CheckoutPage.tsx index e935eda..fbad9ef 100644 --- a/src/pages/CheckoutPage.tsx +++ b/src/pages/CheckoutPage.tsx @@ -23,7 +23,6 @@ const CheckoutPage: React.FC = () => { shippingData, invoiceData, subtotal, - shipping, total, totalBeforeDiscount, discountAmount, @@ -93,7 +92,6 @@ const CheckoutPage: React.FC = () => { { const navigate = useNavigate(); const { orderId } = useParams<{ orderId: string }>(); const { cartItems, clearFullCart } = useCartContext(); - const { - subtotal, - shipping, - total, - paymentError, - isProcessing, - handlePayment, - clearPaymentError, - } = usePayment(); + const { subtotal, total, paymentError, isProcessing, handlePayment, clearPaymentError } = + usePayment(); const cardFormRef = useRef(null); const [isFormValid, setIsFormValid] = useState(false); @@ -116,7 +109,6 @@ const PaymentPage: React.FC = () => { = ({ subtotal, - shipping, total, totalBeforeDiscount, discountAmount = 0, @@ -59,15 +57,15 @@ const OrderSummary: React.FC = ({ - {shipping === 0 && } - {shipping === 0 ? "GRATIS" : `${shipping.toFixed(2)} PLN`} + + GRATIS diff --git a/src/pages/payment/PaymentSummary.tsx b/src/pages/payment/PaymentSummary.tsx index 0165233..cf6aa13 100644 --- a/src/pages/payment/PaymentSummary.tsx +++ b/src/pages/payment/PaymentSummary.tsx @@ -4,7 +4,6 @@ import { Box, Typography, Card, Divider, Button, alpha, useTheme } from "@mui/ma interface PaymentSummaryProps { subtotal: number; - shipping: number; total: number; canPay: boolean; isProcessing: boolean; @@ -13,7 +12,6 @@ interface PaymentSummaryProps { const PaymentSummary: React.FC = ({ subtotal, - shipping, total, canPay, isProcessing, @@ -55,15 +53,15 @@ const PaymentSummary: React.FC = ({ - {shipping === 0 && } - {shipping === 0 ? "GRATIS" : `${shipping.toFixed(2)} PLN`} + + GRATIS From 7bb06974ceaee09ed22bf66a2ca2ad89fa21832b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20G=C4=99siarz?= <126520293+arturgesiarz@users.noreply.github.com> Date: Sun, 11 Jan 2026 12:53:57 +0100 Subject: [PATCH 3/7] Delete some buttons --- src/components/orders/OrderRow.tsx | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/components/orders/OrderRow.tsx b/src/components/orders/OrderRow.tsx index 11c4773..76bf57b 100644 --- a/src/components/orders/OrderRow.tsx +++ b/src/components/orders/OrderRow.tsx @@ -6,7 +6,6 @@ import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; import { Box, - Button, Chip, Collapse, Divider, @@ -147,11 +146,10 @@ const OrderItemsList: React.FC = ({ order }) => { }; interface OrderSummaryProps { - order: OrderDetailsResponse; totalPrice: number; } -const OrderSummary: React.FC = ({ order, totalPrice }) => { +const OrderSummary: React.FC = ({ totalPrice }) => { return ( = ({ order, totalPrice }) => { {totalPrice.toFixed(2)} PLN - - - - {getStatusColor(order.orderStatus) === "error" && ( - - )} - ); }; @@ -200,7 +185,7 @@ const OrderDetails: React.FC = ({ order, totalPrice }) => { - + ); From dd613e29ed3d829a9fdbaed01dd1bc92ab6f45a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20G=C4=99siarz?= <126520293+arturgesiarz@users.noreply.github.com> Date: Sun, 11 Jan 2026 13:31:08 +0100 Subject: [PATCH 4/7] Add button --- src/App.tsx | 5 +---- src/components/orders/OrderRow.tsx | 26 ++++++++++++++++++++++++-- src/hooks/useCheckout.ts | 3 +-- src/pages/CartPage.tsx | 2 +- src/pages/PaymentPage.tsx | 30 +++++++++++++++++++++++++++--- 5 files changed, 54 insertions(+), 12 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 2eb8052..023acab 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -89,10 +89,7 @@ export default function App() { } /> } /> } /> - } - /> + } /> } diff --git a/src/components/orders/OrderRow.tsx b/src/components/orders/OrderRow.tsx index 76bf57b..a0cb41c 100644 --- a/src/components/orders/OrderRow.tsx +++ b/src/components/orders/OrderRow.tsx @@ -4,8 +4,10 @@ import { getStatusColor, getStatusLabel } from "../../types/orders.ts"; import { formatDate } from "../../utils/string.ts"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; +import PaymentIcon from "@mui/icons-material/Payment"; import { Box, + Button, Chip, Collapse, Divider, @@ -18,6 +20,7 @@ import { TableRow, Typography, } from "@mui/material"; +import { useNavigate } from "react-router-dom"; const calculateTotalPrice = (items: OrderItemDetails[]): number => { return items.reduce((sum, item) => sum + item.quantity * item.price, 0); @@ -147,9 +150,14 @@ const OrderItemsList: React.FC = ({ order }) => { interface OrderSummaryProps { totalPrice: number; + orderStatus: string; + orderId: string; } -const OrderSummary: React.FC = ({ totalPrice }) => { +const OrderSummary: React.FC = ({ totalPrice, orderStatus, orderId }) => { + const navigate = useNavigate(); + const isPending = orderStatus === "ORDER_STATUS_PENDING"; + return ( = ({ totalPrice }) => { {totalPrice.toFixed(2)} PLN + {isPending && ( + + )} ); }; @@ -185,7 +207,7 @@ const OrderDetails: React.FC = ({ order, totalPrice }) => { - + ); diff --git a/src/hooks/useCheckout.ts b/src/hooks/useCheckout.ts index a438c26..0ced82f 100644 --- a/src/hooks/useCheckout.ts +++ b/src/hooks/useCheckout.ts @@ -218,8 +218,7 @@ export const useCheckout = (initialOrderId?: string) => { return; } - const paymentId = crypto.randomUUID(); - navigate(`/payment/${paymentId}/${orderId}`); + navigate(`/payment/${orderId}`); }; const getShippingDataForInvoice = (): diff --git a/src/pages/CartPage.tsx b/src/pages/CartPage.tsx index 4bed799..4604edf 100644 --- a/src/pages/CartPage.tsx +++ b/src/pages/CartPage.tsx @@ -267,7 +267,7 @@ const CartProductCard: React.FC<{ item: CartItem; onClick: () => void }> = ({ it }; const CartPage: React.FC = () => { - const { cartItems, loading, error } = useCartContext(); + const { cartItems, loading, error, clearFullCart } = useCartContext(); const theme = useTheme(); const navigate = useNavigate(); diff --git a/src/pages/PaymentPage.tsx b/src/pages/PaymentPage.tsx index d4ddcfc..1f8edc3 100644 --- a/src/pages/PaymentPage.tsx +++ b/src/pages/PaymentPage.tsx @@ -7,7 +7,7 @@ import { useCartContext } from "../contexts/CartContext"; import { usePayment, type CardFormValues } from "../hooks/usePayment.ts"; import PaymentSummary from "./payment/PaymentSummary.tsx"; import CreditCardIcon from "@mui/icons-material/CreditCard"; -import { Box, Typography, Container, Grid, Alert, Card, Button } from "@mui/material"; +import { Box, Typography, Container, Grid, Alert, Card, Button, CircularProgress } from "@mui/material"; import { useNavigate, useParams } from "react-router-dom"; const PaymentPage: React.FC = () => { @@ -18,12 +18,15 @@ const PaymentPage: React.FC = () => { usePayment(); const cardFormRef = useRef(null); const [isFormValid, setIsFormValid] = useState(false); + const [isRedirecting, setIsRedirecting] = useState(false); const handleSubmit = async (values: CardFormValues) => { clearPaymentError(); const success = await handlePayment(values); if (success) { - // Clear cart after successful payment + // Set redirecting flag to prevent showing empty cart message + setIsRedirecting(true); + // Clear cart before navigation await clearFullCart(); // Redirect to order confirmation page with security token if (orderId) { @@ -44,7 +47,28 @@ const PaymentPage: React.FC = () => { } }; - if (cartItems.length === 0) { + // Show loading screen while redirecting after successful payment + if (isRedirecting) { + return ( + + + + + + Processing your payment... + + + Redirecting to confirmation page + + + + + ); + } + + // Don't show empty cart message if we're processing payment or have an orderId + // (user might be returning to pay for a pending order) + if (cartItems.length === 0 && !isProcessing && !orderId) { return ( From bbce17656880af8225e266597922403cd737fbfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20G=C4=99siarz?= <126520293+arturgesiarz@users.noreply.github.com> Date: Sun, 11 Jan 2026 13:31:25 +0100 Subject: [PATCH 5/7] Format --- src/components/orders/OrderRow.tsx | 6 +++++- src/pages/PaymentPage.tsx | 21 +++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/components/orders/OrderRow.tsx b/src/components/orders/OrderRow.tsx index a0cb41c..185a289 100644 --- a/src/components/orders/OrderRow.tsx +++ b/src/components/orders/OrderRow.tsx @@ -207,7 +207,11 @@ const OrderDetails: React.FC = ({ order, totalPrice }) => { - + ); diff --git a/src/pages/PaymentPage.tsx b/src/pages/PaymentPage.tsx index 1f8edc3..d92144a 100644 --- a/src/pages/PaymentPage.tsx +++ b/src/pages/PaymentPage.tsx @@ -7,7 +7,16 @@ import { useCartContext } from "../contexts/CartContext"; import { usePayment, type CardFormValues } from "../hooks/usePayment.ts"; import PaymentSummary from "./payment/PaymentSummary.tsx"; import CreditCardIcon from "@mui/icons-material/CreditCard"; -import { Box, Typography, Container, Grid, Alert, Card, Button, CircularProgress } from "@mui/material"; +import { + Box, + Typography, + Container, + Grid, + Alert, + Card, + Button, + CircularProgress, +} from "@mui/material"; import { useNavigate, useParams } from "react-router-dom"; const PaymentPage: React.FC = () => { @@ -52,7 +61,15 @@ const PaymentPage: React.FC = () => { return ( - + Processing your payment... From 3c11eb9cb00b24f9382817cc0798670536456ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20G=C4=99siarz?= <126520293+arturgesiarz@users.noreply.github.com> Date: Sun, 11 Jan 2026 13:33:39 +0100 Subject: [PATCH 6/7] Lint --- src/pages/CartPage.tsx | 2 +- src/pages/admin/analytics/SalesStatisticsPage.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/CartPage.tsx b/src/pages/CartPage.tsx index 4604edf..4bed799 100644 --- a/src/pages/CartPage.tsx +++ b/src/pages/CartPage.tsx @@ -267,7 +267,7 @@ const CartProductCard: React.FC<{ item: CartItem; onClick: () => void }> = ({ it }; const CartPage: React.FC = () => { - const { cartItems, loading, error, clearFullCart } = useCartContext(); + const { cartItems, loading, error } = useCartContext(); const theme = useTheme(); const navigate = useNavigate(); diff --git a/src/pages/admin/analytics/SalesStatisticsPage.tsx b/src/pages/admin/analytics/SalesStatisticsPage.tsx index 482b680..8cae52d 100644 --- a/src/pages/admin/analytics/SalesStatisticsPage.tsx +++ b/src/pages/admin/analytics/SalesStatisticsPage.tsx @@ -48,6 +48,7 @@ const SalesStatisticsPage: React.FC = () => { setSalesData(null); setStockData(null); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedVariant, dateRange, activeTab]); const loadSalesData = async (variantId: string) => { From 77bae6e8e672b96df8c2dcd366066730a5583a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20G=C4=99siarz?= <126520293+arturgesiarz@users.noreply.github.com> Date: Sun, 11 Jan 2026 15:00:29 +0100 Subject: [PATCH 7/7] Format --- src/pages/admin/analytics/SalesStatisticsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/admin/analytics/SalesStatisticsPage.tsx b/src/pages/admin/analytics/SalesStatisticsPage.tsx index 8cae52d..5a598b5 100644 --- a/src/pages/admin/analytics/SalesStatisticsPage.tsx +++ b/src/pages/admin/analytics/SalesStatisticsPage.tsx @@ -48,7 +48,7 @@ const SalesStatisticsPage: React.FC = () => { setSalesData(null); setStockData(null); } - // eslint-disable-next-line react-hooks/exhaustive-deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedVariant, dateRange, activeTab]); const loadSalesData = async (variantId: string) => {