diff --git a/src/components/testimonials/TestimonialCard.tsx b/src/components/testimonials/TestimonialCard.tsx index 5c1d008b..d6536b85 100644 --- a/src/components/testimonials/TestimonialCard.tsx +++ b/src/components/testimonials/TestimonialCard.tsx @@ -9,6 +9,7 @@ interface TestimonialCardProps { content: string; date: string; avatar: string; + link: string; } const TestimonialCard: React.FC = ({ @@ -17,10 +18,22 @@ const TestimonialCard: React.FC = ({ content, date, avatar, + link, }) => { const { colorMode } = useColorMode(); const isDark = colorMode === "dark"; + // Function to format the link display + const formatLinkDisplay = (url: string) => { + try { + const urlObj = new URL(url); + return urlObj.hostname + urlObj.pathname; + } catch { + // If URL parsing fails, return the original link + return url; + } + }; + return ( = ({ {/* Footer with Hashtags and Date */}
+ {/* Hashtags */}
{content.match(/#\w+/g)?.map((hashtag, index) => ( = ({ ))}
- {date} + + {/* Link and Date Row */} +
+ + {formatLinkDisplay(link)} + + {date} +
); }; -export default TestimonialCard; +export default TestimonialCard; \ No newline at end of file diff --git a/src/components/testimonials/TestimonialCarousel.tsx b/src/components/testimonials/TestimonialCarousel.tsx index cc1298f8..b8cddf1a 100644 --- a/src/components/testimonials/TestimonialCarousel.tsx +++ b/src/components/testimonials/TestimonialCarousel.tsx @@ -18,21 +18,24 @@ const testimonials = [ username: "RashiChouhan", content: "Valuable insights shared, productive discussions, and actionable outcomes. Looking forward to implementing the strategies discussed.! #TechCommunity #WomenInTech", date: "May 18, 2024", - avatar: "/icons/adobe.png" + avatar: "/icons/adobe.png", + link: "https://topmate.io/sanjaykv" }, { name: "Namith", username: "namith", content: "Gave remarkable insights on parts i have to improve and gave me new opportunities . cheers~! #TechCommunity #Grateful", date: "April 21, 2023", - avatar: "/icons/google.png" + avatar: "/icons/google.png", + link: "https://topmate.io/sanjaykv" }, { name: "Rajdeep Chakraborty", username: "RajdeepChakraborty", content: "I appreciate Sanjay sir's insights on open source and his suggestions for improving my GitHub profile. I'm excited to hear more and discuss open source further.! #OpenSource #TechCommunity", date: "Oct 18, 2024", - avatar: "/icons/amazon.png" + avatar: "/icons/amazon.png", + link: "https://topmate.io/sanjaykv" } ];