fix: graf cena per zdroj nahrazen koláčem
feat: stránka doplnit údaje předělána na samostatnou stránku jídel + přidáno přejmenování
This commit is contained in:
1 parent
b880b36edd
commit
efed5e6e86
30 files changed
+514
-153
No files matched your search
@@ -7,7 +7,7 @@ import {
|
||||
MealSuggestion, MealTemplate, MealType, addMeal, applyMealTemplate, getMealHistory, getMealTemplates,
|
||||
} from "../../../../types";
|
||||
import { MEAL_TYPES_IN_ORDER, MEAL_TYPE_ICONS, MEAL_TYPE_NAMES, TemplateTab } from "../../enums";
|
||||
import { describeMealSuggestion, describeMealTemplate, normalizeSearch, parseMultiplierInput } from "../../Utils";
|
||||
import { describeMealSuggestion, describeMealTemplate, getMealKey, normalizeSearch, parseMultiplierInput } from "../../Utils";
|
||||
import { SABLONY_URL } from "../../routes";
|
||||
|
||||
type Props = {
|
||||
@@ -188,7 +188,7 @@ const ApplyMealModal = ({ isOpen, date, onClose, onApplied }: Readonly<Props>) =
|
||||
<div className="apply-template-group">
|
||||
<h3 className="apply-template-group-title">Dříve snědené</h3>
|
||||
{historyList.map(item => (
|
||||
<div className="workout-row" key={item.name}>
|
||||
<div className="workout-row" key={getMealKey(item)}>
|
||||
<div className="workout-info">
|
||||
<div className="workout-name">{item.name}</div>
|
||||
<div className="workout-items">
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
import { MEAL_TYPES_IN_ORDER, MEAL_TYPE_ICONS, MEAL_TYPE_NAMES, NUTRIENTS_IN_ORDER } from "../../enums";
|
||||
import {
|
||||
applyMultiplier, deriveAmounts, formatCalories, formatMultiplier, formatMultiplierInput, formatPriceInput,
|
||||
formatWeight, normalizeSearch, parseIntInput, parseMultiplierInput, parseNutrientInput,
|
||||
formatWeight, getMealKey, parseIntInput, parseMultiplierInput, parseNutrientInput,
|
||||
parsePriceInput,
|
||||
} from "../../Utils";
|
||||
import CalorieLookup from "../CalorieLookup";
|
||||
@@ -253,7 +253,7 @@ export default function MealModal({ isOpen, date, entry, onClose, onSaved }: Rea
|
||||
recipes={recipes}
|
||||
// Upravované jídlo samo sebe nenabízí
|
||||
history={entry
|
||||
? history.filter(item => normalizeSearch(item.name) !== normalizeSearch(entry.name))
|
||||
? history.filter(item => getMealKey(item) !== getMealKey(entry))
|
||||
: history}
|
||||
query={form.name}
|
||||
onPickRecipe={recipe => applyRecipe(recipe)}
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
} from "../../../../types";
|
||||
import { MEAL_TYPES_IN_ORDER, MEAL_TYPE_ICONS, MEAL_TYPE_NAMES } from "../../enums";
|
||||
import {
|
||||
deriveAmounts, formatCalories, formatMultiplier, formatPrice, formatPriceInput, formatWeight, normalizeSearch,
|
||||
deriveAmounts, formatCalories, formatMultiplier, formatPrice, formatPriceInput, formatWeight, getMealKey,
|
||||
parseIntInput, parsePriceInput,
|
||||
} from "../../Utils";
|
||||
import MealSplitRow from "../MealSplitRow";
|
||||
@@ -273,8 +273,7 @@ const MealSplitModal = ({ isOpen, entry, onClose, onSaved }: Readonly<Props>) =>
|
||||
<MealSuggestions
|
||||
recipes={recipes}
|
||||
// Rozdělované jídlo samo sebe nenabízí
|
||||
history={history.filter(item =>
|
||||
normalizeSearch(item.name) !== normalizeSearch(entry.name))}
|
||||
history={history.filter(item => getMealKey(item) !== getMealKey(entry))}
|
||||
query={split.name}
|
||||
onPickRecipe={recipe => applyRecipe(recipe)}
|
||||
onPickHistory={suggestion => applyHistory(suggestion)}
|
||||
|
||||
Reference in new issue
Block a user