Skip to content

Commit 9db461e

Browse files
committed
Fixed Link error
1 parent 725cb66 commit 9db461e

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

src/components/Roadmap/index.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState } from "react";
22
import "./Roadmap.css";
3-
3+
import Link from "@docusaurus/Link";
44

55
interface TechCategory {
66
id: number;
@@ -280,13 +280,7 @@ const Roadmap: React.FC = () => {
280280
);
281281
};
282282

283-
const handleButtonClick = (link: string) => {
284-
if(link === "https://roadmap.sh/react") {
285-
window.open(link, "_blank");
286-
}
287-
}
288-
289-
const filteredCategories = techCategories
283+
const filteredCategories = techCategories
290284
.map((category) => ({
291285
...category,
292286
technologies: category.technologies.filter((tech) =>
@@ -319,12 +313,9 @@ const Roadmap: React.FC = () => {
319313
<ul className="roadmap-cards">
320314
{category.technologies.map((tech) => (
321315
<li key={tech.id} className="roadmap-card">
322-
<a href={tech.link} onClick= {(e) => {
323-
e.preventDefault();
324-
handleButtonClick(tech.link); }}
325-
className="roadmap-link">
316+
<Link to={tech.link}>
326317
{tech.name}
327-
</a>
318+
</Link>
328319
</li>
329320
))}
330321
</ul>

src/data/roadmaps/html.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const htmlRoadmapData = [
22
{
33
title: "HTML Basics",
44
items: [
5-
{ text: "Introduction to HTML", link: "/docs/html/intro-HTML", status: "todo" },
5+
{ text: "Introduction to HTML", link: "/docs/html/intro-html/", status: "todo" },
66
{ text: "HTML Documents Structure", link: "#", status: "todo" },
77
{ text: "Basic HTML Tags", link: "#", status: "todo" },
88
{ text: "Attributes in HTML", link: "#", status: "todo" },

0 commit comments

Comments
 (0)