From a26e542bee912d5d408566a8a783b65f8a82f36f Mon Sep 17 00:00:00 2001 From: Pkpedram Date: Fri, 28 Jan 2022 19:40:18 +0330 Subject: [PATCH] Pedram Fixed Course Chapter (Version 1.0.0) --- src/components/CourseChapter/index.css | 16 ++++++++ src/components/CourseChapter/index.js | 51 +++++++++++++++++++------- 2 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 src/components/CourseChapter/index.css diff --git a/src/components/CourseChapter/index.css b/src/components/CourseChapter/index.css new file mode 100644 index 0000000..1db20f6 --- /dev/null +++ b/src/components/CourseChapter/index.css @@ -0,0 +1,16 @@ +.hasScrollbar::-webkit-scrollbar { + width:7.5px; + background-color: rgba(0,0,0,0.08); + border-radius: 5px; + height: 50px; + margin-top: 200px; +} + +.hasScrollbar::-webkit-scrollbar-thumb{ + background:#196EC0; + border-radius: 10px; +} +.hasScrollbar::-webkit-scrollbar-track { + + border-radius: 10px; +} \ No newline at end of file diff --git a/src/components/CourseChapter/index.js b/src/components/CourseChapter/index.js index 8c024ed..e368420 100644 --- a/src/components/CourseChapter/index.js +++ b/src/components/CourseChapter/index.js @@ -1,13 +1,14 @@ import React, { useState } from "react"; +import './index.css'; const CourseChapter = ({ chapters }) => { const [selectedLesson, setSelectedLesson] = useState(null); return ( -
+
{/* top */}
@@ -22,6 +23,9 @@ const CourseChapter = ({ chapters }) => { {/* divider */}
{/* course title */} +
{chapters.map((chapter, index) => (
@@ -31,7 +35,7 @@ const CourseChapter = ({ chapters }) => { {/* course lessons */} {chapter.lessons.map((lesson, i) => (
{/* right div dot dot */} @@ -42,13 +46,13 @@ const CourseChapter = ({ chapters }) => {
{
{/* left div content */}
setSelectedLesson(lesson)} > {/* top */} -
+

{lesson.title}

{lesson.duration} @@ -84,8 +88,8 @@ const CourseChapter = ({ chapters }) => { >
{/* bottom */} {lesson.play} @@ -94,6 +98,7 @@ const CourseChapter = ({ chapters }) => { ))}
))} +
{/* blue left border */}
@@ -133,6 +138,24 @@ CourseChapter.defaultProps = { play: "نمایش", passed: false, }, + { + title: "زمین سبز و آسمان آبی", + duration: "56:09", + play: "نمایش", + passed: false, + }, + { + title: "زمین سبز و آسمان آبی", + duration: "56:09", + play: "نمایش", + passed: false, + }, + { + title: "زمین سبز و آسمان آبی", + duration: "56:09", + play: "نمایش", + passed: false, + }, ], }, ],