Skip to content

Commit

Permalink
Development (#279)
Browse files Browse the repository at this point in the history
* update github workflow yaml file

* rename the frontend folder

* create the checkout button

* create dynamic route

* update the routing definition and getmenubyId API call

* Merge branch 'development' of github.com:olasunkanmi-SE/restaurant into development

* remove the styling for menu name

* optimize the components

* conditionally render the checkout component

* remove code smell

* Merge branch 'release' into development

* update the menu item page and clean up the navigation

* create the delete menu repo method, service and controller

* create the delete menu API

* update food menu component to include item id

* update food menu component to include item id

* add the add menu item to cart functionality

* implement add menu items to cart

* fix build errors

* fix code smell

* create the item quantity button component

* update the menu list ui

* implement the add items to cart functionality

* fix code smell

* create the selected items summary

* update cart reducer

* update the add item to cart implementation

* create folder structure for componsnts

* implement the remove from cart functionality

* implement the add to cart functionality

* rename add and remove from cart to add and remove menu from cart

* remove the menuid from foodmenu component

* create the shopping component

* implement display menu quantity, also display only menu items ata a time

* prevent increase in total price if the menu quantity is 1

* fix issues with totalprice calculations

* fix issues with menu items reduction

* fix the bug in shopping cart provider

* remove menu price from global state

* fix bug in remove menu from cart

* fix error in menuItems calculations

* update some names in the shoppingcart context

* add the none button for food items

* update remove item from cart method to calculate total price correctly

* remove unused file

* create the radio button

* calculate order quantity

* remove quantity count from checkout
  • Loading branch information
olasunkanmi-SE committed Apr 20, 2023
1 parent 2e50dbe commit 3635920
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions frontend/src/components/Utilities/Checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,17 @@ const checkoutStyle: CSSProperties = {
height: "40px",
backgroundColor: "#000000",
};
const cartItemsCount: CSSProperties = {
color: "#000",
width: "1.5rem",
height: "1.5rem",
bottom: "0px",
right: "0px",
backgroundColor: "#fff",
textAlign: "center",
marginRight: "11px",
fontWeight: 600,
borderRadius: "10px",
};

export const Checkout = () => {
const { quantity, totalPrice } = useShoppingCart();
return (
<div style={checkoutStyle}>
<Stack className="mt-2" direction="horizontal" gap={3}>
<div>Checkout</div>
<div className="ms-auto">RM {totalPrice}</div>
<div className="ms-auto" style={cartItemsCount}>
{quantity}
<div style={{ marginRight: "10px" }} className="ms-auto">
Total: RM {totalPrice}
</div>
</Stack>
</div>
// <div style={checkoutStyle} className="d-flex justify-content-between">
// <div style={{ marginLeft: "11px" }}>Checkout</div>
// <div style={cartItemsCount}>{quantity}</div>
// </div>
);
};

0 comments on commit 3635920

Please sign in to comment.