Možnost označení objednávajícího
This commit is contained in:
@@ -13,12 +13,12 @@ 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 { faChainBroken, faChevronLeft, faChevronRight, faGear, faSatelliteDish, faSearch } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faBasketShopping, faChainBroken, faChevronLeft, faChevronRight, faGear, faSatelliteDish, faSearch } from '@fortawesome/free-solid-svg-icons';
|
||||
import Loader from './components/Loader';
|
||||
import { getHumanDateTime, isInTheFuture } from './Utils';
|
||||
import NoteModal from './components/modals/NoteModal';
|
||||
import { useEasterEgg } from './context/eggs';
|
||||
import { ClientData, Food, PizzaOrder, DepartureTime, PizzaDayState, Restaurant, RestaurantDayMenu, RestaurantDayMenuMap, LunchChoice, UserLunchChoice, PizzaVariant, getData, getEasterEggImage, addPizza, removePizza, updatePizzaDayNote, createPizzaDay, deletePizzaDay, lockPizzaDay, unlockPizzaDay, finishOrder, finishDelivery, addChoice, jdemeObed, removeChoices, removeChoice, updateNote, changeDepartureTime } from '../../types';
|
||||
import { ClientData, Food, PizzaOrder, DepartureTime, PizzaDayState, Restaurant, RestaurantDayMenu, RestaurantDayMenuMap, LunchChoice, UserLunchChoice, PizzaVariant, getData, getEasterEggImage, addPizza, removePizza, updatePizzaDayNote, createPizzaDay, deletePizzaDay, lockPizzaDay, unlockPizzaDay, finishOrder, finishDelivery, addChoice, jdemeObed, removeChoices, removeChoice, updateNote, changeDepartureTime, setBuyer } from '../../types';
|
||||
import { getLunchChoiceName } from './enums';
|
||||
// import FallingLeaves, { LEAF_PRESETS, LEAF_COLOR_THEMES } from './FallingLeaves';
|
||||
// import './FallingLeaves.scss';
|
||||
@@ -284,6 +284,12 @@ function App() {
|
||||
}
|
||||
}
|
||||
|
||||
const markAsBuyer = async () => {
|
||||
if (auth?.login) {
|
||||
await setBuyer();
|
||||
}
|
||||
}
|
||||
|
||||
const pizzaSuggestions = useMemo(() => {
|
||||
if (!data?.pizzaList) {
|
||||
return [];
|
||||
@@ -454,9 +460,9 @@ function App() {
|
||||
<img alt="" src='snowman.png' style={{ position: "absolute", height: "110px", right: 10, top: 5 }} />
|
||||
Poslední změny:
|
||||
<ul>
|
||||
<li>Oprava parsování Sladovnické</li>
|
||||
<li>Oprava parsování cen TechTower</li>
|
||||
<li>Oprava parsování Sladovnické a TechTower</li>
|
||||
<li>Zimní atmosféra</li>
|
||||
<li>Možnost označit se jako objednávající u volby "budu objednávat"</li>
|
||||
</ul>
|
||||
</Alert>
|
||||
{dayIndex != null &&
|
||||
@@ -534,6 +540,7 @@ function App() {
|
||||
const userPayload = entry[1];
|
||||
const userChoices = userPayload?.selectedFoods;
|
||||
const trusted = userPayload?.trusted || false;
|
||||
const isBuyer = userPayload?.isBuyer || false;
|
||||
return <tr key={entry[0]}>
|
||||
<td>
|
||||
{trusted && <span className='trusted-icon' title='Uživatel ověřený doménovým přihlášením'>
|
||||
@@ -542,6 +549,17 @@ function App() {
|
||||
{login}
|
||||
{userPayload.departureTime && <small> ({userPayload.departureTime})</small>}
|
||||
{userPayload.note && <span style={{ fontSize: 'small' }}> ({userPayload.note})</span>}
|
||||
{/* TODO narovnat styly pomocí class */}
|
||||
{login === auth.login && canChangeChoice && locationKey === LunchChoice.OBJEDNAVAM && <span title='Označit/odznačit se jako objednávající'>
|
||||
<FontAwesomeIcon onClick={() => {
|
||||
markAsBuyer();
|
||||
}} icon={faBasketShopping} color={isBuyer ? '#dbba00' : 'rgb(0, 89, 255)'} style={{marginLeft: '10px', padding: 0, cursor: 'pointer'}} />
|
||||
</span>}
|
||||
{login !== auth.login && locationKey === LunchChoice.OBJEDNAVAM && isBuyer && <span title='Objednávající'>
|
||||
<FontAwesomeIcon onClick={() => {
|
||||
copyNote(userPayload.note!);
|
||||
}} icon={faBasketShopping} color='#dbba00' style={{marginLeft: '10px', padding: 0}} />
|
||||
</span>}
|
||||
{login !== auth.login && canChangeChoice && userPayload?.note?.length && <span title='Převzít poznámku'>
|
||||
<FontAwesomeIcon onClick={() => {
|
||||
copyNote(userPayload.note!);
|
||||
|
||||
Reference in New Issue
Block a user