From ff478383f4aae9eae6b162714938d6546de5aac6 Mon Sep 17 00:00:00 2001 From: Akash Jaiswal Date: Sat, 1 Mar 2025 10:46:25 +0530 Subject: [PATCH] feat: social media link on chapters Signed-off-by: Akash Jaiswal --- frontend/src/components/Card.tsx | 7 +++--- frontend/src/components/CardDetailsPage.tsx | 4 ---- frontend/src/utils/urlIconMappings.ts | 25 ++++++++++++++++++++- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/Card.tsx b/frontend/src/components/Card.tsx index 118ab91de..194071194 100644 --- a/frontend/src/components/Card.tsx +++ b/frontend/src/components/Card.tsx @@ -1,10 +1,11 @@ import { HStack, Link } from '@chakra-ui/react' -import { FontAwesomeIcon, FontAwesomeIconProps } from '@fortawesome/react-fontawesome' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { useState, useEffect } from 'react' import { CardProps } from 'types/card' import { desktopViewMinWidth } from 'utils/constants' import { Icons } from 'utils/data' import { TooltipRecipe } from 'utils/theme' +import { getSocialIcon } from 'utils/urlIconMappings' import { cn } from 'utils/utility' import FontAwesomeIconWrapper from 'wrappers/FontAwesomeIconWrapper' import ActionButton from 'components/ActionButton' @@ -100,7 +101,6 @@ const Card = ({ )} {/* Render project summary using Markdown */} -
0 @@ -152,12 +152,11 @@ const Card = ({ alignItems="center" gap={2} > - + ))} )} - {/* Action Button */}
diff --git a/frontend/src/components/CardDetailsPage.tsx b/frontend/src/components/CardDetailsPage.tsx index bb40436d0..3d89c0d5a 100644 --- a/frontend/src/components/CardDetailsPage.tsx +++ b/frontend/src/components/CardDetailsPage.tsx @@ -41,7 +41,6 @@ const DetailsCard = ({

{summary}

-
)}
- {(type === 'project' || type === 'repository') && (
}
)} - - {(type === 'project' || type === 'repository') && ( <> { if (hostname.includes('youtube')) return faYoutube if (hostname.includes('meetup')) return faMeetup if (hostname.includes('slack')) return faSlack - + if (hostname.includes('facebook')) return faFacebook + if (hostname.includes('telegram') || hostname.includes('t.me')) return faTelegram + if (hostname.includes('google')) return faGoogle + if (hostname.includes('bsky')) return faBluesky + if (hostname.includes('whatsapp')) return faWhatsapp + if (hostname.includes('tiktok')) return faTiktok + if (hostname.includes('github')) return faGithub + if (hostname.includes('slideshare')) return faSlideshare + if (hostname.includes('speakerdeck')) return faSpeakerDeck + if (hostname.includes('vimeo')) return faVimeo + if (hostname.includes('twitch')) return faTwitch + if (hostname.includes('medium')) return faMedium if (hostname === 'x.com' || hostname.endsWith('.x.com') || hostname.includes('twitter')) { return faXTwitter }