Skip to content

Commit

Permalink
create courses cart page for students dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
amitamrutiya committed Nov 8, 2023
1 parent a6bc17d commit 732aede
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions frontend/src/components/core/Dashboard/Cart/Cart.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useSelector } from "react-redux"
import RenderCartCourses from "./RenderCartCourses"
import RenderTotalAmount from "./RenderTotalAmount"


export default function Cart() {

const { total, totalItems } = useSelector((state) => state.cart)

return (
<>
<h1 className="mb-14 text-3xl font-medium text-richblack-5">Cart</h1>
<p className="border-b border-b-richblack-400 pb-2 font-semibold text-richblack-400"> {totalItems} Courses in Cart </p>

{total > 0 ? (
<div className="mt-8 flex flex-col-reverse items-start gap-x-10 gap-y-6 lg:flex-row">
<RenderCartCourses />
<RenderTotalAmount />
</div>
) : (<p className="mt-14 text-center text-3xl text-richblack-100"> Your cart is empty </p> )}

</>


)}

0 comments on commit 732aede

Please sign in to comment.