Skip to content

Commit d1dfe3b

Browse files
fix links of learning-paths
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
1 parent 3187a67 commit d1dfe3b

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

src/sections/Learn-Layer5/Course-Overview/index.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const CourseOverview = ({ course, chapters, serviceMeshesList, children }) => {
5555

5656
useEffect(() => {
5757
let bookmarkPath = localStorage.getItem("bookmarkpath-" + course.fields.slug.split("/")[3]);
58-
if (bookmarkPath){
58+
if (bookmarkPath) {
5959
setHasBookmark(true);
6060
setBookmarkUrl(bookmarkPath);
6161
}
@@ -93,7 +93,7 @@ const CourseOverview = ({ course, chapters, serviceMeshesList, children }) => {
9393
{hasBookmark && (
9494
<Button
9595
className="start-again-button"
96-
$primary title="Resume"
96+
$primary title="Resume"
9797
$url={bookmarkUrl}
9898
/>
9999
)}
@@ -113,20 +113,27 @@ const CourseOverview = ({ course, chapters, serviceMeshesList, children }) => {
113113
{children}
114114
</SRLWrapper>
115115
<h2 className="course-toc">Table Of Contents</h2>
116-
{course.frontmatter.toc.map((item, index) => (
117-
<Link key={index} to={`${extractedSection}/${item}`} className="chapter-link">
118-
<ChapterCard
119-
chapterNum={index + 1}
120-
chapter={getChapterTitle(item, chapters)}
121-
/>
122-
</Link>
123-
))}
116+
{course.frontmatter.toc.map((item, index) => {
117+
const chapterNode = getChapterTitle(item, chapters);
118+
return (
119+
<Link
120+
key={index}
121+
to={chapterNode ? `/${chapterNode.fields.slug}` : "#"}
122+
className="chapter-link"
123+
>
124+
<ChapterCard
125+
chapterNum={index + 1}
126+
chapter={chapterNode}
127+
/>
128+
</Link>
129+
);
130+
})}
124131
</Col>
125132
<Col $md={12} $lg={4} $xl={5}>
126133
<div className="service-meshes-you-can-learn">
127-
{console.log("lenght of the service mesh array: ", availableServiceMeshes.length) }
128-
{ console.log("array: ",availableServiceMeshes)}
129-
{ serviceMeshImages.length !== 0 && availableServiceMeshes.length != 0 && (
134+
{console.log("lenght of the service mesh array: ", availableServiceMeshes.length)}
135+
{console.log("array: ", availableServiceMeshes)}
136+
{serviceMeshImages.length !== 0 && availableServiceMeshes.length != 0 && (
130137
<>
131138
<h2>Technologies You Can Learn</h2>
132139
<ServiceMeshesAvailable serviceMeshes={availableServiceMeshes} />

src/sections/Learn-Layer5/Courses-List/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const CoursesList = ({ coursesData, learnPath }) => {
3333
{coursesData.map((tutorial, index) => {
3434
return (
3535
<Col $sm={12} key={tutorial.id} name={tutorial.frontmatter.courseTitle}>
36-
<Link to={tutorial.fields.course}>
36+
<Link to={tutorial.fields.slug}>
3737
<ContentCard chapterNum={index + 1} chapter={tutorial} />
3838
</Link>
3939
</Col>

0 commit comments

Comments
 (0)