Skip to content

Commit

Permalink
fix: Removed price label if no price exists
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Groß <mail@gross-johannes.de>
  • Loading branch information
jo-gross committed Feb 21, 2024
1 parent d8abd5a commit 0dec065
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion components/cocktails/CompactCocktailRecipeInstruction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export function CompactCocktailRecipeInstruction(props: CompactCocktailRecipeIns
{props.cocktailRecipe.name == '' ? '<Name>' : props.cocktailRecipe.name}
</div>
{props.showPrice == true ? (
<div className={'col-span-1 text-right text-xl font-bold'}>{props.specialPrice ?? props.cocktailRecipe.price ?? '-'}</div>
<div className={'col-span-1 text-right text-xl font-bold'}>
{(props.specialPrice ?? props.cocktailRecipe.price) != undefined ? props.specialPrice ?? props.cocktailRecipe.price + ' €' : ''}
</div>
) : (
<></>
)}
Expand Down
10 changes: 9 additions & 1 deletion components/modals/CocktailDetailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,15 @@ export function CocktailDetailModal(props: CocktailDetailModalProps) {
)}
</>
<h2 className={'card-title flex-1'}>
{props.cocktail.name} - <span className={'font-bold'}>{props.cocktail.price ?? '-'}</span>
{props.cocktail.name}
{props.cocktail.price != undefined ? (
<>
{' - '}
<span className={'font-bold'}>{props.cocktail.price + ' €'}</span>
</>
) : (
<></>
)}
</h2>
</div>
<div className={'grid grid-cols-2 gap-4'}>
Expand Down

0 comments on commit 0dec065

Please sign in to comment.