From 3817126ac09b04174888150901efc2cc2aa31f56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20H=C3=A1jek?= <mikrop@centrum.cz>
Date: Wed, 19 Feb 2025 20:39:27 +0100
Subject: [PATCH] =?UTF-8?q?V=C3=BDb=C4=9Br=20restaurace=20kliknut=C3=ADm?=
 =?UTF-8?q?=20na=20jej=C3=AD=20n=C3=A1zev?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 client/src/App.tsx | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/client/src/App.tsx b/client/src/App.tsx
index 56fa12e..26cb66f 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -189,7 +189,7 @@ function App() {
     }
   }, [auth?.login, easterEgg?.duration, easterEgg?.url, eggImage]);
 
-  const doAddClickFoodChoice = async (location: Locations, foodIndex: number) => {
+  const doAddClickFoodChoice = async (location: Locations, foodIndex?: number) => {
     const locationKey = Object.keys(Locations).find(key => Locations[key as keyof typeof Locations] === location) as LocationKey;
     if (auth?.login) {
       await errorHandler(() => addChoice(locationKey, foodIndex, dayIndex));
@@ -338,7 +338,7 @@ function App() {
     }
   }
 
-  const renderFoodTable = (name: string, location: Locations, menu: DayMenu) => {
+  const renderFoodTable = (location: Locations, menu: DayMenu) => {
     let content;
     if (menu?.closed) {
       content = <h3>Zavřeno</h3>
@@ -359,7 +359,7 @@ function App() {
       content = <h3>Chyba načtení dat</h3>
     }
     return <Col md={12} lg={3} className='mt-3'>
-      <h3>{name}</h3>
+      <h3 style={{ cursor: 'pointer' }} onClick={() => doAddClickFoodChoice(location, undefined)}>{location}</h3>
       {menu?.lastUpdate && <small>Poslední aktualizace: {getHumanDateTime(new Date(menu.lastUpdate))}</small>}
       {content}
     </Col>
@@ -421,11 +421,11 @@ function App() {
             </div>
           }
           <Row className='food-tables'>
-            {food[Restaurants.SLADOVNICKA] && renderFoodTable('Sladovnická', Locations.SLADOVNICKA, food[Restaurants.SLADOVNICKA])}
-            {/* {food[Restaurants.UMOTLIKU] && renderFoodTable('U Motlíků', food[Restaurants.UMOTLIKU])} */}
-            {food[Restaurants.TECHTOWER] && renderFoodTable('TechTower', Locations.TECHTOWER, food[Restaurants.TECHTOWER])}
-            {food[Restaurants.ZASTAVKAUMICHALA] && renderFoodTable('Zastávka u Michala', Locations.ZASTAVKAUMICHALA, food[Restaurants.ZASTAVKAUMICHALA])}
-            {food[Restaurants.SENKSERIKOVA] && renderFoodTable('Pivovarský šenk Šeříková', Locations.SENKSERIKOVA, food[Restaurants.SENKSERIKOVA])}
+            {food[Restaurants.SLADOVNICKA] && renderFoodTable(Locations.SLADOVNICKA, food[Restaurants.SLADOVNICKA])}
+            {/* {food[Restaurants.UMOTLIKU] && renderFoodTable(food[Restaurants.UMOTLIKU])} */}
+            {food[Restaurants.TECHTOWER] && renderFoodTable(Locations.TECHTOWER, food[Restaurants.TECHTOWER])}
+            {food[Restaurants.ZASTAVKAUMICHALA] && renderFoodTable(Locations.ZASTAVKAUMICHALA, food[Restaurants.ZASTAVKAUMICHALA])}
+            {food[Restaurants.SENKSERIKOVA] && renderFoodTable(Locations.SENKSERIKOVA, food[Restaurants.SENKSERIKOVA])}
           </Row>
           <div className='content-wrapper'>
             <div className='content'>