Skip to content

Commit

Permalink
style: fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
sltsheryl committed Jan 12, 2024
1 parent 720460f commit dd4aa09
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion components/navbar/UserDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ const UserDropdown = () => {
);
};

export default UserDropdown;
export default UserDropdown;
6 changes: 0 additions & 6 deletions pages/apply-vouchers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ const ApplyVouchers = () => {

useEffect(() => {
const courseList = JSON.parse(localStorage.getItem('Cart'));
console.log(courseList);
const numPriceCourseList = courseList.map(course => {
course.price = parseInt(course.price).toFixed(2);
return course;
});
console.log(numPriceCourseList);
setCartCourses(numPriceCourseList);
}, []);

Expand Down Expand Up @@ -85,7 +83,6 @@ const VoucherEntry = ({ course, cartCourses, setCartCourses }) => {
const updatedCartCourses = prevCartCourses.map(c => {
if (c.id === course.id) {
const newPrice = parseFloat(c.price) - voucherSaving;
console.log(`Old price: ${c.price}, Voucher saving: ${voucherSaving}, New price: ${newPrice.toFixed(2)}`);
return {
...c,
price: newPrice.toFixed(2),
Expand All @@ -94,13 +91,10 @@ const VoucherEntry = ({ course, cartCourses, setCartCourses }) => {
return c;
});

console.log(updatedCartCourses);

return updatedCartCourses;
});
};


return (
<tr style={{ borderTop: '15px solid transparent' }} className='flex items-center justify-center gap-20'>
<td>
Expand Down

0 comments on commit dd4aa09

Please sign in to comment.