From f12dc7b562f056b74fc11e629de73b556031880c Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Thu, 7 May 2026 13:17:45 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20celkov=C3=A1=20=C4=8D=C3=A1stka=20objed?= =?UTF-8?q?n=C3=A1vky,=20proklik=20na=20str=C3=A1nku=20s=20objedn=C3=A1vka?= =?UTF-8?q?mi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.tsx | 7 ++++++- client/src/pages/OrderGroupsPage.tsx | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index f803895..a1f2bf6 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -13,7 +13,8 @@ import './App.scss'; import { faCircleCheck, faNoteSticky, faTrashCan, faComment } from '@fortawesome/free-regular-svg-icons'; import { useSettings } from './context/settings'; import Footer from './components/Footer'; -import { faBasketShopping, faChainBroken, faChevronLeft, faChevronRight, faGear, faMoneyBillTransfer, faSatelliteDish, faSearch, faTriangleExclamation } from '@fortawesome/free-solid-svg-icons'; +import { faArrowUpRightFromSquare, faBasketShopping, faChainBroken, faChevronLeft, faChevronRight, faGear, faMoneyBillTransfer, faSatelliteDish, faSearch, faTriangleExclamation } from '@fortawesome/free-solid-svg-icons'; +import { useNavigate } from 'react-router-dom'; import Loader from './components/Loader'; import { getHumanDateTime, isInTheFuture, formatDateString } from './Utils'; import NoteModal from './components/modals/NoteModal'; @@ -59,6 +60,7 @@ const EASTER_EGG_DEFAULT_DURATION = 0.75; function App() { const auth = useAuth(); const settings = useSettings(); + const navigate = useNavigate(); const [easterEgg, _] = useEasterEgg(auth); const [isConnected, setIsConnected] = useState(false); const [data, setData] = useState(); @@ -732,6 +734,9 @@ function App() { markAsBuyer(); }} icon={faBasketShopping} className={isBuyer ? 'buyer-icon' : 'action-icon'} style={{ cursor: 'pointer' }} /> } + {login === auth.login && locationKey === LunchChoice.OBJEDNAVAM && + navigate('/objednani')} icon={faArrowUpRightFromSquare} className='action-icon' style={{ cursor: 'pointer' }} /> + } {login !== auth.login && locationKey === LunchChoice.OBJEDNAVAM && isBuyer && { copyNote(userPayload.note!); diff --git a/client/src/pages/OrderGroupsPage.tsx b/client/src/pages/OrderGroupsPage.tsx index e42cd1c..657424d 100644 --- a/client/src/pages/OrderGroupsPage.tsx +++ b/client/src/pages/OrderGroupsPage.tsx @@ -459,6 +459,18 @@ export default function OrderGroupsPage() { ); })} + {(() => { + const groupTotal = memberEntries.reduce((sum, [, m]) => sum + getMemberTotal(m), 0); + return groupTotal > 0 ? ( + + + Celkem za skupinu: + {groupTotal / 100} Kč + + + + ) : null; + })()} {/* Souhrn poplatků a slevy */}