Pastiche is my favorite dessert place in Providence. Sometimes I get takeout orders with friends. I always find it hard to make recommendation to people, since everyone has different taste and I genuinely find everything at Pastiche so delicious!
On Pastiche's current online ordering site, users can only browse information about the cake after clicking on each individual icon. On my redesigned website, users can browse information about each cake all in one page, add cake to favorite, sort the display by name or price, and filter the display by different flavors or allergy.
The website is built using React. The next section talks about some key points about how the website is set up.
In the main file App.js, sorting and filtering buttons are displayed and their corresponding onclick functions are set. The onclick function changes the states of the menu. UpdateMenu is then called to make sure the overall menu is updated correctly based on the buttons clicked. After that, each item in menu is mapped to a BakeryItem and rendered.
There are 5 variables that use states: cart, menu, order, filterList and allergyList. Users can change the state of order by clicking on the radio buttons "price" and "name"; change the state of filterList by clicking on the checkbox buttons "chocolate", "fruity", "coffee", and "something else"; change the state of allergyList by clicking on the checkbox buttons "gluten-free" and "nut-free". Clicking on these buttons mentioned above would also change the state of menu. When users click on "add to favorite" or "remove from favorite", state of cart is changed.