Skip to content

Commit

Permalink
Add scrimba banner
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranahmedse committed Sep 27, 2024
1 parent 0ebf479 commit 9aae8b5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/TopicDetail/TopicDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ export function TopicDetail(props: TopicDetailProps) {
return resource.topicIds.includes(normalizedTopicId);
});

const hasPaidScrimbaLinks = paidResourcesForTopic.some(
(resource) => resource?.url?.toLowerCase().indexOf('scrimba') !== -1,
);

return (
<div className={'relative z-[90]'}>
<div
Expand Down Expand Up @@ -486,6 +490,19 @@ export function TopicDetail(props: TopicDetailProps) {
})}
</ul>

{hasPaidScrimbaLinks && (
<div className="relative -mb-1 ml-3 mt-4 rounded-md border border-yellow-300 bg-yellow-100 px-2.5 py-2 text-sm text-yellow-800">
<div className="flex items-center gap-2">
<Coins className="h-4 w-4 text-yellow-700" />
<span>
Scrimba is offering{' '}
<span className={'font-semibold'}>20% off</span> on
all courses for roadmap.sh users.
</span>
</div>
</div>
)}

{showPaidResourceDisclaimer && (
<PaidResourceDisclaimer
onClose={() => {
Expand Down

0 comments on commit 9aae8b5

Please sign in to comment.