diff --git a/src/lib/components/Buttons/Close/index.svelte b/src/lib/components/Buttons/Close/index.svelte
index 204e6c63..7a81c895 100644
--- a/src/lib/components/Buttons/Close/index.svelte
+++ b/src/lib/components/Buttons/Close/index.svelte
@@ -4,7 +4,7 @@
export let onClick;
export let contained;
- export let color = '';
+ export let color = 'text-blue-700 bg-blue-200 dark:bg-gray-500';
export let size = 'large';
@@ -12,6 +12,7 @@
{#if size === 'large'}
{:else}
-
+
{/if}
+
diff --git a/src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte b/src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte
new file mode 100644
index 00000000..745b81ed
--- /dev/null
+++ b/src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte
@@ -0,0 +1,40 @@
+
+
+
+
+
Add By
+ {#each tabs as item (item.value)}
+
+ {/each}
+
+
+ {#if currentTab === 1}
+
+ {:else}
+
+ {/if}
+
+
diff --git a/src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte b/src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte
new file mode 100644
index 00000000..ce254b0b
--- /dev/null
+++ b/src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte
@@ -0,0 +1,88 @@
+
+
+{#if isLoaded == false}
+
+{:else if isBig && isUploaded == false}
+
+

+
+
+ Oops 😬, couldn’t upload video
+
+
+ Sorry we video wasn’t uploaded. The file size is too big,
maximum size is 20 MB. Try again!
+
+
+
+
+{:else if isWrongFormat && isUploaded == false}
+
+

+
+
+ Oops 😬, couldn’t upload video
+
+
+ Sorry we video wasn’t uploaded, the file format isn’t supported.
Upload MP4, MOV and AVI
+ files.
+
+
+
+
+{:else}
+
+
+
+
+
+

+
+ Video.png
+
+
+
+
+
+
+{/if}
diff --git a/src/lib/components/Course/components/Lesson/Materials/Video/YoutubeVideo.svelte b/src/lib/components/Course/components/Lesson/Materials/Video/YoutubeVideo.svelte
new file mode 100644
index 00000000..587f83e9
--- /dev/null
+++ b/src/lib/components/Course/components/Lesson/Materials/Video/YoutubeVideo.svelte
@@ -0,0 +1,79 @@
+
+
+
+
($isLessonDirty = true)}
+ placeholder="https://www.youtube.com/watch?v="
+ errorMessage={error}
+ />
+
+
+
+ Added : {($lesson?.materials?.video_url && $lesson.materials.video_url.trim().split(',').length) || 0} Videos
+
+
+ {#each $lesson?.materials?.video_url && $lesson.materials.video_url
+ .trim()
+ .split(',') as videoLink, index}
+
+
+ {videoLink}
+
+
+ removeVideo(index)}>
+
+
+
+ {/each}
+
diff --git a/src/lib/components/Course/components/Lesson/Materials/Video/constants.js b/src/lib/components/Course/components/Lesson/Materials/Video/constants.js
new file mode 100644
index 00000000..bfe0e734
--- /dev/null
+++ b/src/lib/components/Course/components/Lesson/Materials/Video/constants.js
@@ -0,0 +1,14 @@
+import Link from 'carbon-icons-svelte/lib/Link.svelte';
+import Video from 'carbon-icons-svelte/lib/Video.svelte';
+export const videoTabs = [
+ {
+ value: 1,
+ title: 'Youtube Link',
+ icon: Link
+ },
+ {
+ value: 2,
+ title: 'Video',
+ icon: Video
+ }
+];
diff --git a/src/lib/components/Course/components/Lesson/Materials/index.svelte b/src/lib/components/Course/components/Lesson/Materials/index.svelte
index 5b78221d..a9f22bf7 100644
--- a/src/lib/components/Course/components/Lesson/Materials/index.svelte
+++ b/src/lib/components/Course/components/Lesson/Materials/index.svelte
@@ -1,11 +1,13 @@
-
+
+
+
+
@@ -186,37 +236,48 @@
- {#if mode === MODES.edit}
- ($isLessonDirty = true)}
- />
- {:else if !!$lesson.materials.video_url && $lesson.materials.video_url.includes('youtube')}
- {#each $lesson.materials.video_url.split(',') as url}
-
-
-
- {/each}
+ {#if mode === MODES.edit && videoUrls.length}
+
+ {/if}
+
+ {#if videoUrls.length}
+
+ {#each videoUrls as url, index}
+
+ {#if url.includes('youtube')}
+
+ {:else}
+
+ {/if}
+
+ {/each}
+
{:else}
-
-

-
No videos yet
-
- Share your knowledge with the world by creating engaging videos. Add your video link
- now.
-
-
+
+
+ No youtube video added for this lesson yet
+
+
+ Share your knowledge with the world by creating engaging lessons.
+ Start by clicking on New Lesson button.
+
+
{/if}
diff --git a/src/lib/components/Course/components/Lesson/store/lessons.ts b/src/lib/components/Course/components/Lesson/store/lessons.ts
index 604e315f..92a94ccd 100644
--- a/src/lib/components/Course/components/Lesson/store/lessons.ts
+++ b/src/lib/components/Course/components/Lesson/store/lessons.ts
@@ -1,18 +1,21 @@
import { writable } from 'svelte/store';
import type { Writable, Updater } from 'svelte/store';
import { createLesson, updateLesson, deleteLesson } from '$lib/utils/services/courses';
-
import type { Lesson, Course } from '$lib/utils/types';
+export const uploadCourseVideoStore = writable({
+ isModalOpen: false
+});
+
export const lessons: Writable = writable([]);
export const lesson = writable({
id: null,
totalExercises: 0,
is_complete: false,
materials: {
- note: null,
- slide_url: null,
- video_url: null
+ note: '',
+ slide_url: '',
+ video_url: ''
},
exercises: []
});
@@ -92,7 +95,23 @@ export async function handleUpdateLessonMaterials(lesson: any, lessonId: Lesson[
...lesson.materials
};
+ delete materials.profile;
delete materials.totalExercises;
return await updateLesson(materials, lessonId);
}
+
+export const deleteLessonVideo = (index: any) => {
+ lesson.update((currentLesson) => {
+ const links = currentLesson.materials.video_url.split(',').map((link) => link.trim());
+ links.splice(index, 1);
+ const updatedVideoUrl = links.join(',').trim();
+ return {
+ ...currentLesson,
+ materials: {
+ ...currentLesson.materials,
+ video_url: updatedVideoUrl
+ }
+ };
+ });
+};
diff --git a/src/lib/components/Course/components/Navigation/index.svelte b/src/lib/components/Course/components/Navigation/index.svelte
index 5956a86a..f961d3ff 100644
--- a/src/lib/components/Course/components/Navigation/index.svelte
+++ b/src/lib/components/Course/components/Navigation/index.svelte
@@ -172,7 +172,7 @@
-->
-
+
{#each navItems as navItem}
{#if !navItem.show || (typeof navItem.show === 'function' && navItem.show())}
+ export let color = 'currentColor';
+
+
+
diff --git a/src/lib/components/Icons/CourseIcon.svelte b/src/lib/components/Icons/CourseIcon.svelte
index 2734037b..82d5b0be 100644
--- a/src/lib/components/Icons/CourseIcon.svelte
+++ b/src/lib/components/Icons/CourseIcon.svelte
@@ -1,5 +1,5 @@
diff --git a/src/lib/components/Icons/ExerciseIcon.svelte b/src/lib/components/Icons/ExerciseIcon.svelte
index 8f808bbe..2007e968 100644
--- a/src/lib/components/Icons/ExerciseIcon.svelte
+++ b/src/lib/components/Icons/ExerciseIcon.svelte
@@ -1,3 +1,7 @@
+
+
diff --git a/src/lib/components/Icons/ReviewsIcon.svelte b/src/lib/components/Icons/ReviewsIcon.svelte
new file mode 100644
index 00000000..fc52e81f
--- /dev/null
+++ b/src/lib/components/Icons/ReviewsIcon.svelte
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/lib/components/LMS/SideBar.svelte b/src/lib/components/LMS/SideBar.svelte
index a14e34cc..cea38ffb 100644
--- a/src/lib/components/LMS/SideBar.svelte
+++ b/src/lib/components/LMS/SideBar.svelte
@@ -1,11 +1,12 @@
diff --git a/src/lib/components/Modal/index.svelte b/src/lib/components/Modal/index.svelte
index a4617276..12d21f03 100644
--- a/src/lib/components/Modal/index.svelte
+++ b/src/lib/components/Modal/index.svelte
@@ -22,29 +22,33 @@
{#if open}
-
+
+
{/if}