diff --git a/src/components/testimonials/TestimonialCard.tsx b/src/components/testimonials/TestimonialCard.tsx index d6536b85..b12f4297 100644 --- a/src/components/testimonials/TestimonialCard.tsx +++ b/src/components/testimonials/TestimonialCard.tsx @@ -1,3 +1,4 @@ +// prettier-ignore import React from "react"; import { motion } from "framer-motion"; import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar"; @@ -23,13 +24,11 @@ const TestimonialCard: React.FC = ({ 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; } }; @@ -39,66 +38,104 @@ const TestimonialCard: React.FC = ({ initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} - className={`rounded-2xl p-6 shadow-lg hover:shadow-xl transition-shadow duration-300 h-[250px] flex flex-col justify-between ${ + className={`rounded-2xl p-6 shadow-md hover:shadow-lg transition-all duration-300 flex flex-col justify-between h-full ${ isDark ? "bg-[#1a1a1a] text-white" : "bg-white text-gray-900" }`} > - {/* Header with Avatar and Name */} -
- - - CN - -
-

+ {/* Header */} +
+
+
+ {avatar ? ( + {name} + ) : ( + + {name?.charAt(0)?.toUpperCase() ?? "U"} + + )} +
+
+ +
+

{name}

-

+

@{username}

{/* Content */} -

- {content} +

+ {content.length > 111 ? content.slice(0, 111) + "..." : content}

- {/* Footer with Hashtags and Date */} + {/* Footer */}
{/* Hashtags */} -
- {content.match(/#\w+/g)?.map((hashtag, index) => ( - - {hashtag} - - ))} -
+ {content.match(/#\w+/g) && ( +
+ {content + .match(/#\w+/g) + ?.slice(0, 3) + .map((tag, i) => ( + + {tag} + + ))} +
+ )} - {/* Link and Date Row */} + {/* Link and Date */}
- {formatLinkDisplay(link)} - {date} + + {date} +
); }; -export default TestimonialCard; \ No newline at end of file +export default TestimonialCard; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 12665676..9f74b606 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -88,7 +88,7 @@ export default function Home(): ReactNode {

-
+
{showTopmate && (