99 < h3 class ="product-name "> {{ product.name }}</ h3 >
1010 < p class ="product-description "> {{ product.description }}</ p >
1111 </ div >
12- < span class ="product-price "> {{ totalPrice() }}€</ span >
12+ @if (!inMenu) {
13+ < span class ="product-price "> {{ totalPrice() }}€</ span >
14+ }
1315 </ div >
1416
1517 < button class ="toggle-btn " (click) ="expanded.set(!expanded()) ">
@@ -18,73 +20,84 @@ <h3 class="product-name">{{ product.name }}</h3>
1820 </ button >
1921
2022 @if (expanded()) {
23+ < div class ="backdrop " (click) ="expanded.set(false) "> </ div >
2124 < div class ="customisation ">
2225
23- < div class ="custom-section ">
24- < h4 class ="custom-title "> Ingrédients</ h4 >
25- < div class ="chips ">
26- @for (ingredient of ingredients(); track ingredient.id) {
27- < button
28- class ="chip "
29- [class.active] ="ingredient.included "
30- (click) ="toggleIngredient(ingredient.id) "
31- >
32- {{ ingredient.included ? '✓' : '✕' }} {{ ingredient.name }}
33- </ button >
34- }
26+ @if (ingredients().length > 0){
27+ < div class ="custom-section ">
28+ < h4 class ="custom-title "> Ingrédients</ h4 >
29+ < div class ="chips ">
30+ @for (ingredient of ingredients(); track ingredient.id) {
31+ < button
32+ class ="chip "
33+ [class.active] ="ingredient.included "
34+ (click) ="toggleIngredient(ingredient.id) "
35+ >
36+ {{ ingredient.included ? '✓' : '✕' }} {{ ingredient.name }}
37+ </ button >
38+ }
39+ </ div >
3540 </ div >
36- </ div >
41+ }
3742
38- < div class ="custom-section ">
39- < h4 class ="custom-title "> Taille</ h4 >
40- < div class ="chips ">
41- @for (size of sizes; track size.id) {
42- < button
43- class ="chip "
44- [class.active] ="size.selected "
45- (click) ="toggleSize(size.id) "
46- >
47- {{ size.name }}
48- @if (size.price > 0) { < span class ="chip-price-add "> +{{ size.price.toFixed(2) }}€</ span > }
49- @if (size.price < 0 ) { < span class ="chip-price-rem "> {{ size.price.toFixed(2) }}€</ span > }
50- </ button >
51- }
43+ @if (sizes.length > 0){
44+ < div class ="custom-section ">
45+ < h4 class ="custom-title "> Taille</ h4 >
46+ < div class ="chips ">
47+ @for (size of sizes; track size.id) {
48+ < button
49+ class ="chip "
50+ [class.active] ="size.selected "
51+ (click) ="toggleSize(size.id) "
52+ >
53+ {{ size.name }}
54+ @if (size.price > 0) { < span class ="chip-price-add "> +{{ size.price.toFixed(2) }}€</ span > }
55+ @if (size.price < 0 ) { < span class ="chip-price-rem "> {{ size.price.toFixed(2) }}€</ span > }
56+ </ button >
57+ }
58+ </ div >
5259 </ div >
53- </ div >
60+ }
5461
55- < div class ="custom-section ">
56- < h4 class ="custom-title "> Suppléments</ h4 >
57- < div class ="chips ">
58- @for (extra of supplements; track extra.id) {
59- < button
60- class ="chip "
61- [class.active] ="extra.selected "
62- (click) ="toggleExtra(extra.id) "
63- >
64- {{ extra.name }}
65- @if (extra.price > 0) { < span class ="chip-price "> +{{ extra.price.toFixed(2) }}€</ span > }
66- </ button >
67- }
62+ @if (supplements.length > 0){
63+ < div class ="custom-section ">
64+ < h4 class ="custom-title "> Suppléments</ h4 >
65+ < div class ="chips ">
66+ @for (extra of supplements; track extra.id) {
67+ < button
68+ class ="chip "
69+ [class.active] ="extra.selected "
70+ (click) ="toggleExtra(extra.id) "
71+ >
72+ {{ extra.name }}
73+ @if (extra.price > 0) { < span class ="chip-price "> +{{ extra.price.toFixed(2) }}€</ span > }
74+ </ button >
75+ }
76+ </ div >
6877 </ div >
69- </ div >
78+ }
7079
71- < div class ="custom-section ">
72- < h4 class ="custom-title "> Sauces</ h4 >
73- < div class ="chips ">
74- @for (sauce of sauces; track sauce.id) {
75- < button
76- class ="chip "
77- [class.active] ="sauce.selected "
78- (click) ="toggleExtra(sauce.id) "
79- >
80- {{ sauce.name }}
81- </ button >
82- }
80+ @if (sauces.length > 0){
81+ < div class ="custom-section ">
82+ < h4 class ="custom-title "> Sauces</ h4 >
83+ < div class ="chips ">
84+ @for (sauce of sauces; track sauce.id) {
85+ < button
86+ class ="chip "
87+ [class.active] ="sauce.selected "
88+ (click) ="toggleExtra(sauce.id) "
89+ >
90+ {{ sauce.name }}
91+ </ button >
92+ }
93+ </ div >
8394 </ div >
84- </ div >
95+ }
8596
8697 </ div >
8798 }
88- < button class ="btn-fire "> Ajouter au panier — {{ totalPrice() }}€</ button >
99+ @if (!inMenu) {
100+ < button class ="btn-fire "> Ajouter au panier — {{ totalPrice() }}€</ button >
101+ }
89102
90103</ article >
0 commit comments