diff --git a/src/components/courses/courseDetails/CourseContentDetails.jsx b/src/components/courses/courseDetails/CourseContentDetails.jsx index 97fc3eb..18284c1 100644 --- a/src/components/courses/courseDetails/CourseContentDetails.jsx +++ b/src/components/courses/courseDetails/CourseContentDetails.jsx @@ -6,23 +6,38 @@ import CourseRequirementSection from "./CourseRequirementSection"; import CourseInstructorDetails from "./CourseInstructorDetails"; import CourseDetails from "./CourseDetails"; import { MdAttachMoney } from "react-icons/md"; - -const CourseContentDetails = ({ - title, - description, - duration, - totalReviews, - averageRating, - updatedAt, - language, - learningObjectives, - videos, - instructor, - prerequisites, - financialAid, - paymentModel, -}) => { +import { useEffect, useState } from "react"; +import PaymentDetailsModal from "./PaymentDetailsModal"; +const CourseContentDetails = ({ course }) => { + const { + title, + description, + duration, + totalReviews, + averageRating, + updatedAt, + language, + learningObjectives, + videos, + prerequisites, + financialAid, + paymentModel, + } = course; + const instructor = course.instructor[0]; const formatUpdatedDate = new Date(updatedAt).toLocaleDateString(); + const [isLargeScreen, setIsLargeScreen] = useState(false); + + useEffect(() => { + const handleResize = () => { + setIsLargeScreen(window.innerWidth > 970); + }; + handleResize(); + window.addEventListener("resize", handleResize); + return () => { + window.removeEventListener("resize", handleResize); + }; + }, []); + return (
{description}
+ {!isLargeScreen && ( +