From 8c8d8d5732fbb294aa596d4f8ed273de99f5c0b0 Mon Sep 17 00:00:00 2001 From: Jonas Hinterdorfer Date: Mon, 16 Jun 2025 09:17:20 +0200 Subject: [PATCH] removed the title and modified the change calcluator --- src/pages/ChangeCalculatorPage.tsx | 12 ++++++++++-- src/pages/HomePage.tsx | 3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/pages/ChangeCalculatorPage.tsx b/src/pages/ChangeCalculatorPage.tsx index 1f3b6c0..fa330cc 100644 --- a/src/pages/ChangeCalculatorPage.tsx +++ b/src/pages/ChangeCalculatorPage.tsx @@ -34,7 +34,8 @@ const ChangeCalculatorPage: React.FC = () => { useEffect(() => { const total = moneyItems.reduce((sum, item) => sum + item.value * item.count, 0); setCustomerTotal(total); - setChangeAmount(Math.max(0, total - cartTotal)); + // Allow negative values when customer hasn't paid enough + setChangeAmount(total - cartTotal); }, [moneyItems, cartTotal]); const handleDenominationClick = (index: number) => { @@ -90,7 +91,14 @@ const ChangeCalculatorPage: React.FC = () => {
Restgeld: - {changeAmount.toFixed(2)} € + + {changeAmount.toFixed(2)} € +
diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index 8a6b9fa..7d2db8f 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -39,8 +39,7 @@ const HomePage: React.FC = () => { -

{activeTab === 'food' ? 'Essen' : 'Getränke'}

- -- 2.45.2