Skrytí podniku U Motlíků
This commit is contained in:
		
							parent
							
								
									86af490e94
								
							
						
					
					
						commit
						4d2ec529bb
					
				@ -355,7 +355,7 @@ function App() {
 | 
			
		||||
    } else {
 | 
			
		||||
      content = <h3>Chyba načtení dat</h3>
 | 
			
		||||
    }
 | 
			
		||||
    return <Col md={12} lg={4} className='mt-3'>
 | 
			
		||||
    return <Col md={12} lg={6} className='mt-3'>
 | 
			
		||||
      <h3>{name}</h3>
 | 
			
		||||
      {menu?.lastUpdate && <small>Poslední aktualizace: {getHumanDateTime(new Date(menu.lastUpdate))}</small>}
 | 
			
		||||
      {content}
 | 
			
		||||
@ -403,12 +403,10 @@ function App() {
 | 
			
		||||
        {data.isWeekend ? <h4>Užívejte víkend :)</h4> : <>
 | 
			
		||||
          <Alert variant={'primary'}>
 | 
			
		||||
            <img src='hat.png' style={{ position: "absolute", width: "100px", rotate: "-45deg", left: -32, top: -40 }} />
 | 
			
		||||
            <img src='tree.png' style={{ position: "absolute", height: "140px", right: 0, top: 0 }} />
 | 
			
		||||
            <img src='tree.png' style={{ position: "absolute", height: "90px", right: 0, top: 0 }} />
 | 
			
		||||
            Poslední změny:
 | 
			
		||||
            <ul>
 | 
			
		||||
              <li>Vánoční atmosféra</li>
 | 
			
		||||
              <li>Nově na <a href="https://react.dev/blog/2024/12/05/react-19" target='blank'>React 19</a></li>
 | 
			
		||||
              <li>Nově sestavováno pomocí <a href="https://vite.dev" target='blank'>Vite</a> ⚡</li>
 | 
			
		||||
              <li>Odstranění podniku U Motlíků</li>
 | 
			
		||||
            </ul>
 | 
			
		||||
          </Alert>
 | 
			
		||||
          {dayIndex != null &&
 | 
			
		||||
@ -420,7 +418,7 @@ function App() {
 | 
			
		||||
          }
 | 
			
		||||
          <Row className='food-tables'>
 | 
			
		||||
            {food[Restaurants.SLADOVNICKA] && renderFoodTable('Sladovnická', food[Restaurants.SLADOVNICKA])}
 | 
			
		||||
            {food[Restaurants.UMOTLIKU] && renderFoodTable('U Motlíků', food[Restaurants.UMOTLIKU])}
 | 
			
		||||
            {/* {food[Restaurants.UMOTLIKU] && renderFoodTable('U Motlíků', food[Restaurants.UMOTLIKU])} */}
 | 
			
		||||
            {food[Restaurants.TECHTOWER] && renderFoodTable('TechTower', food[Restaurants.TECHTOWER])}
 | 
			
		||||
          </Row>
 | 
			
		||||
          <div className='content-wrapper'>
 | 
			
		||||
 | 
			
		||||
@ -59,7 +59,7 @@ export async function getData(date?: Date): Promise<ClientData> {
 | 
			
		||||
    let clientData: ClientData = { ...data };
 | 
			
		||||
    clientData.menus = {
 | 
			
		||||
        [Restaurants.SLADOVNICKA]: await getRestaurantMenu(Restaurants.SLADOVNICKA, date),
 | 
			
		||||
        [Restaurants.UMOTLIKU]: await getRestaurantMenu(Restaurants.UMOTLIKU, date),
 | 
			
		||||
        // [Restaurants.UMOTLIKU]: await getRestaurantMenu(Restaurants.UMOTLIKU, date),
 | 
			
		||||
        [Restaurants.TECHTOWER]: await getRestaurantMenu(Restaurants.TECHTOWER, date),
 | 
			
		||||
    }
 | 
			
		||||
    clientData = await addVolatileData(clientData);
 | 
			
		||||
@ -142,19 +142,19 @@ export async function getRestaurantMenu(restaurant: Restaurants, date?: Date): P
 | 
			
		||||
                    console.error("Selhalo načtení jídel pro podnik Sladovnická", e);
 | 
			
		||||
                }
 | 
			
		||||
                break;
 | 
			
		||||
            case Restaurants.UMOTLIKU:
 | 
			
		||||
                try {
 | 
			
		||||
                    const uMotlikuFood = await getMenuUMotliku(firstDay, mock);
 | 
			
		||||
                    for (let i = 0; i < uMotlikuFood.length; i++) {
 | 
			
		||||
                        menus[i][restaurant]!.food = uMotlikuFood[i];
 | 
			
		||||
                        if (uMotlikuFood[i].length === 1 && uMotlikuFood[i][0].name.toLowerCase() === 'zavřeno') {
 | 
			
		||||
                            menus[i][restaurant]!.closed = true;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                } catch (e: any) {
 | 
			
		||||
                    console.error("Selhalo načtení jídel pro podnik U Motlíků", e);
 | 
			
		||||
                }
 | 
			
		||||
                break;
 | 
			
		||||
            // case Restaurants.UMOTLIKU:
 | 
			
		||||
            //     try {
 | 
			
		||||
            //         const uMotlikuFood = await getMenuUMotliku(firstDay, mock);
 | 
			
		||||
            //         for (let i = 0; i < uMotlikuFood.length; i++) {
 | 
			
		||||
            //             menus[i][restaurant]!.food = uMotlikuFood[i];
 | 
			
		||||
            //             if (uMotlikuFood[i].length === 1 && uMotlikuFood[i][0].name.toLowerCase() === 'zavřeno') {
 | 
			
		||||
            //                 menus[i][restaurant]!.closed = true;
 | 
			
		||||
            //             }
 | 
			
		||||
            //         }
 | 
			
		||||
            //     } catch (e: any) {
 | 
			
		||||
            //         console.error("Selhalo načtení jídel pro podnik U Motlíků", e);
 | 
			
		||||
            //     }
 | 
			
		||||
            //     break;
 | 
			
		||||
            case Restaurants.TECHTOWER:
 | 
			
		||||
                try {
 | 
			
		||||
                    const techTowerFood = await getMenuTechTower(firstDay, mock);
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
/** Výčtový typ pro restaurace, pro které umíme získat a parsovat obědové menu. */
 | 
			
		||||
export enum Restaurants {
 | 
			
		||||
    SLADOVNICKA = 'sladovnicka',
 | 
			
		||||
    UMOTLIKU = 'uMotliku',
 | 
			
		||||
    // UMOTLIKU = 'uMotliku',
 | 
			
		||||
    TECHTOWER = 'techTower',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -110,7 +110,7 @@ export interface Food {
 | 
			
		||||
// TODO tohle je dost špatné pojmenování, vzhledem k tomu co to obsahuje
 | 
			
		||||
export enum Locations {
 | 
			
		||||
    SLADOVNICKA = 'Sladovnická',
 | 
			
		||||
    UMOTLIKU = 'U Motlíků',
 | 
			
		||||
    // UMOTLIKU = 'U Motlíků',
 | 
			
		||||
    TECHTOWER = 'TechTower',
 | 
			
		||||
    SPSE = 'SPŠE',
 | 
			
		||||
    PIZZA = 'Pizza day',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user