Skip to content

Commit 4487f0c

Browse files
authored
solve issue (#26)
solve issue (#26)
2 parents 3ffbc7a + 0765dfc commit 4487f0c

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

src/assets/react.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/YouTubeEmbed.jsx renamed to src/components/Embeder.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22

3-
const YouTubeEmbed = ({ videoId }) => {
4-
const videoUrl = `https://www.youtube.com/embed/${videoId}`;
3+
const Embeder= ({ videoId }) => {
4+
const videoUrl = `${videoId}`;
55

66
return (
77
<div
@@ -30,4 +30,4 @@ const YouTubeEmbed = ({ videoId }) => {
3030
);
3131
};
3232

33-
export default YouTubeEmbed;
33+
export default Embeder;

src/data/courseData.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@ const courses = {
44
author: 'Dev Gautam Kumar',
55
image: 'https://dummyimage.com/600x400/00BCD4/fff&text=ZSH+Setup', // Cyan
66
description: 'Enhance your terminal experience with OH MY ZSH.',
7-
ytb_vid: 'dCdX5v3IU60',
7+
embed_link: 'https://www.youtube.com/embed/dCdX5v3IU60',
88
contentFile: 'course1.md',
99
},
1010
'course 2: getting started with cli': {
1111
title: 'Course 2: Getting Started with CLI',
1212
author: 'Dev Gautam Kumar',
1313
image: 'https://dummyimage.com/600x400/FF9800/fff&text=CLI+PART+1', // Orange
1414
description: 'Kick your journey with CLI',
15-
ytb_vid: 'B4b9pX1lqU4',
15+
embed_link: 'https://www.youtube.com/embed/B4b9pX1lqU4',
16+
contentFile: 'course2.md',
17+
},
18+
'course 3: getting started with cli': {
19+
title: 'Course 3: Introduction to Bourne Shell',
20+
author: 'Dev Gautam Kumar',
21+
image: 'https://dummyimage.com/600x400/fff&text=B0urn3+$h3ll', // Orange
22+
description: 'Get started with Shell Scripts',
23+
embed_link: 'https://www.canva.com/design/DAGS2jSbGgI/NHrTUX9491PY9e31licHrA/view?embed',
1624
contentFile: 'course2.md',
1725
},
1826
};

src/pages/CourseDetail.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
22
import { useParams } from 'react-router-dom';
33
import courses from '@/data/courseData';
44
import { marked } from 'marked';
5-
import YouTubeEmbed from '@/components/YouTubeEmbed';
5+
import YouTubeEmbed from '@/components/Embeder';
66

77
function CourseDetail() {
88
const { courseName } = useParams();
@@ -23,11 +23,11 @@ function CourseDetail() {
2323
console.error('Error fetching the markdown file:', error)
2424
);
2525
}, [course.contentFile]);
26-
26+
console.table(course)
2727
return (
2828
<div className="container mt-5">
2929
<h1>{course.title}</h1>
30-
<YouTubeEmbed videoId={course.ytb_vid}></YouTubeEmbed>
30+
<YouTubeEmbed videoId={course.embed_link}></YouTubeEmbed>
3131
<p>{course.description}</p>
3232
<div dangerouslySetInnerHTML={{ __html: content }} />
3333
</div>

0 commit comments

Comments
 (0)