π¨βπΌ The muffin shop wants a simple dashboard for a single order so the team can
double-check totals before handing it off.
π This example uses React + Vite, but everything React-related is already done
for you. You only need the workshop skills: numbers, strings, booleans,
variables, functions, if/else, switch statements, loops, and
never.π¨ Open
and complete the following tasks:
- Format money with a template literal.
- Add the
(GF)label for gluten-free items. - Sum the subtotal with a loop.
- Apply the member discount.
- Calculate tax and tip.
- Calculate the final total.
- Return the pickup fee with a switch statement.
- Return the pickup label with a switch statement.
- Format the special note when it's empty.
- Log the ready message.
- Implement
assertNever.
π° Toggle
memberStatus or pickupMethod in to
see different outputs.
Try next
- π¨ Add another
OrderItemand watch the totals change. - π¨ Add a
rushOrderboolean and increase the tip when it is true. - π¨ Add a
itemCounthelper that uses a loop to count total quantity. - π¨ Add a
happyHourboolean and reduce the muffin price when true. - π¨ Add a
memberMessagestring inapp.tsxusing anifcheck. - π° Change
specialNoteto a real note and confirm the fallback logic.