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} +
+ upload error + +

+ 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} +
+ upload error + +

+ Oops 😬, couldn’t upload video +

+

+ Sorry we video wasn’t uploaded, the file format isn’t supported.
Upload MP4, MOV and AVI + files. +

+
+ +
+{:else} +
+
+
+ +
+ coursevideo +
+

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} -
-