0 && (
-
+ window.fireEvent({
+ category: 'TopicResourceClick',
+ action: `Click: ${parsedUrl.hostname}`,
+ label: `${resourceType} / ${resourceId} / ${topicId} / ${link.url}`,
+ });
+ }
+ }}
+ />
+
+ );
+ })}
+
+ >
+ )}
+
+ {paidResourcesForTopic.length > 0 && (
+ <>
+
+
+
+ {paidResourcesForTopic.map((resource) => {
+ return (
+ -
+
+
+ );
+ })}
+
+ >
)}
{/* Contribution */}
- {canSubmitContribution && !hasEnoughLinks && contributionUrl && hasContent && (
-
-
-
- Find more resources using these pre-filled search queries:
-
-
-
-
- Google
-
-
-
- YouTube
-
+ {canSubmitContribution &&
+ !hasEnoughLinks &&
+ contributionUrl &&
+ hasContent && (
+
+
+
+ Find more resources using these pre-filled search
+ queries:
+
+
-
-
- This popup should be a brief introductory paragraph for the topic and a few links
- to good articles, videos, or any other self-vetted resources. Please consider
- submitting a PR to improve this content.
-
-
-
- Help us Improve this Content
-
-
- )}
+
+ This popup should be a brief introductory paragraph for
+ the topic and a few links to good articles, videos, or any
+ other self-vetted resources. Please consider submitting a
+ PR to improve this content.
+
+
+
+ Help us Improve this Content
+
+
+ )}
{resourceId === 'devops' && (
@@ -528,4 +588,4 @@ export function TopicDetail(props: TopicDetailProps) {
);
-}
\ No newline at end of file
+}
diff --git a/src/components/TopicDetail/TopicDetailLink.tsx b/src/components/TopicDetail/TopicDetailLink.tsx
new file mode 100644
index 000000000..9d4b01978
--- /dev/null
+++ b/src/components/TopicDetail/TopicDetailLink.tsx
@@ -0,0 +1,57 @@
+import { cn } from '../../lib/classname.ts';
+import type { AllowedLinkTypes } from '../CustomRoadmap/CustomRoadmap.tsx';
+
+const linkTypes: Record
= {
+ article: 'bg-yellow-300',
+ course: 'bg-green-400',
+ opensource: 'bg-black text-white',
+ 'roadmap.sh': 'bg-black text-white',
+ roadmap: 'bg-black text-white',
+ podcast: 'bg-purple-300',
+ video: 'bg-purple-300',
+ website: 'bg-blue-300',
+ official: 'bg-blue-600 text-white',
+ feed: 'bg-[#ce3df3] text-white',
+};
+
+const paidLinkTypes: Record = {
+ course: 'bg-yellow-300',
+};
+
+type TopicDetailLinkProps = {
+ url: string;
+ onClick?: () => void;
+ type: AllowedLinkTypes;
+ title: string;
+ isPaid?: boolean;
+};
+
+export function TopicDetailLink(props: TopicDetailLinkProps) {
+ const { url, onClick, type, title, isPaid = false } = props;
+
+ return (
+
+
+ {type === 'opensource' ? (
+ <>
+ {url.includes('github') && 'GitHub'}
+ {url.includes('gitlab') && 'GitLab'}
+ >
+ ) : (
+ type
+ )}
+
+ {title}
+
+ );
+}
diff --git a/src/pages/[roadmapId]/courses.astro b/src/pages/[roadmapId]/courses.astro
index a1726b405..d7a606f85 100644
--- a/src/pages/[roadmapId]/courses.astro
+++ b/src/pages/[roadmapId]/courses.astro
@@ -7,7 +7,6 @@ import RoadmapHeader from '../../components/RoadmapHeader.astro';
import { FolderKanbanIcon } from 'lucide-react';
import { EmptyProjects } from '../../components/Projects/EmptyProjects';
import ShareIcons from '../../components/ShareIcons/ShareIcons.astro';
-import { TopicDetail } from '../../components/TopicDetail/TopicDetail';
import { UserProgressModal } from '../../components/UserProgress/UserProgressModal';
import BaseLayout from '../../layouts/BaseLayout.astro';
import { getProjectsByRoadmapId } from '../../lib/project';
diff --git a/src/pages/[roadmapId]/index.astro b/src/pages/[roadmapId]/index.astro
index 4aa157968..184bb9eed 100644
--- a/src/pages/[roadmapId]/index.astro
+++ b/src/pages/[roadmapId]/index.astro
@@ -96,6 +96,7 @@ const projects = await getProjectsByRoadmapId(roadmapId);
();
export const totalRoadmapNodes = atom();
+