mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
chore: use lectures naming
This commit is contained in:
parent
d7f1e6f94a
commit
7237a4de49
36 changed files with 404 additions and 403 deletions
|
|
@ -12,7 +12,7 @@ import { styled } from "styled-components";
|
|||
|
||||
interface Editor {
|
||||
content: string;
|
||||
element: any;
|
||||
lecture: any;
|
||||
//course: any;
|
||||
}
|
||||
|
||||
|
|
@ -31,11 +31,11 @@ function Canva(props: Editor) {
|
|||
}),
|
||||
ImageBlock.configure({
|
||||
editable: isEditable,
|
||||
element: props.element,
|
||||
lecture: props.lecture,
|
||||
}),
|
||||
VideoBlock.configure({
|
||||
editable: true,
|
||||
element: props.element,
|
||||
lecture: props.lecture,
|
||||
}),
|
||||
Youtube.configure({
|
||||
controls: true,
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import { getBackendUrl } from "@services/config";
|
|||
import React from "react";
|
||||
import styled from "styled-components";
|
||||
|
||||
function VideoLecture({ element, course }: { element: any; course: any }) {
|
||||
function VideoLecture({ lecture, course }: { lecture: any; course: any }) {
|
||||
function getChapterName() {
|
||||
let chapterName = "";
|
||||
let chapterId = element.chapter_id;
|
||||
let chapterId = lecture.chapter_id;
|
||||
course.chapters.forEach((chapter: any) => {
|
||||
if (chapter.chapter_id === chapterId) {
|
||||
chapterName = chapter.name;
|
||||
|
|
@ -18,10 +18,10 @@ function VideoLecture({ element, course }: { element: any; course: any }) {
|
|||
<VideoLectureLayout>
|
||||
<VideoTitle>
|
||||
<p>Chapter : {getChapterName()}</p>
|
||||
{element.name}
|
||||
{lecture.name}
|
||||
</VideoTitle>
|
||||
<VideoPlayerWrapper>
|
||||
<video controls src={`${getBackendUrl()}content/uploads/video/${element.content.video.element_id}/${element.content.video.filename}`}></video>
|
||||
<video controls src={`${getBackendUrl()}content/uploads/video/${lecture.content.video.lecture_id}/${lecture.content.video.filename}`}></video>
|
||||
</VideoPlayerWrapper>
|
||||
</VideoLectureLayout>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue