diff --git a/package.json b/package.json index b7ab039..c52fd7d 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "react-input-range": "^1.3.0", "react-leaflet": "^3.2.5", "react-leaflet-draw": "^0.19.8", + "react-monaco-editor": "^0.48.0", "react-multi-date-picker": "^3.3.0", "react-qr-code": "^2.0.7", "react-redux": "^7.2.6", diff --git a/src/components/Accordion/AccordionDesign1/index.js b/src/components/Accordion/AccordionDesign1/index.js index 604d5d6..9fdd181 100644 --- a/src/components/Accordion/AccordionDesign1/index.js +++ b/src/components/Accordion/AccordionDesign1/index.js @@ -3,9 +3,9 @@ import CircleInCircle from "../../MiniComponents/CircleInCircle"; import Button from "../../ButtonDesign/Button"; import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd"; -const AccordionDesign1 = ({ items, vod }) => { +const AccordionDesign1 = ({ courses, vod }) => { const [activeAccordion, setActiveAccordion] = useState(null); - const [accordions, updateAccordion] = useState(items); + const [accordions, updateAccordion] = useState(courses); function handleOnDragEnd(result) { if (!result.destination) return; @@ -19,18 +19,18 @@ const AccordionDesign1 = ({ items, vod }) => { return ( - + {(provided) => (
- {items.map((item, index) => ( + {courses.map((course, index) => ( {(provided) => ( @@ -47,13 +47,13 @@ const AccordionDesign1 = ({ items, vod }) => { {/* parent */}
setActiveAccordion( - activeAccordion === item ? null : item + activeAccordion === course ? null : course ) } > @@ -61,23 +61,23 @@ const AccordionDesign1 = ({ items, vod }) => { parentClassName={"bg-secondary w-4 h-4 "} childClassName={false} /> -

{item.title}

+

{course.title}

{vod && (

دقیقه: - {item.min} + {course.min}

ویدیو: - {item.video} + {course.video}

)} { />
{/* child */} - {activeAccordion === item && - item.subItems.map((subItem, i) => ( + {activeAccordion === course && + course.lessons.map((lesson, i) => (
{vod === !true && ( @@ -106,14 +106,14 @@ const AccordionDesign1 = ({ items, vod }) => {
-

{subItem.name}

+

{lesson.name}

{vod ? ( <>

دقیقه: - {item.min} + {course.min}