-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create courses cart page for students dashboard
- Loading branch information
1 parent
a6bc17d
commit 732aede
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> )} | ||
|
||
</> | ||
|
||
|
||
)} |