diff --git a/app/[locale]/apps/_components/AppCard.tsx b/app/[locale]/apps/_components/AppCard.tsx index b9014244d69..bc499bd1a63 100644 --- a/app/[locale]/apps/_components/AppCard.tsx +++ b/app/[locale]/apps/_components/AppCard.tsx @@ -70,14 +70,15 @@ const AppCard = ({

{showDescription && ( + > + {app.description} + )} diff --git a/app/[locale]/apps/_components/AppsHighlight.tsx b/app/[locale]/apps/_components/AppsHighlight.tsx index 75454ff7de5..df2181a400b 100644 --- a/app/[locale]/apps/_components/AppsHighlight.tsx +++ b/app/[locale]/apps/_components/AppsHighlight.tsx @@ -39,13 +39,14 @@ const AppsHighlight = ({ apps, matomoCategory }: AppsHighlightProps) => {
+ > + {app.description} +
, + "children" | "className" + > { maxLines?: number - showMoreText?: string - showLessText?: string - className?: string matomoEvent?: MatomoEventOptions } const TruncatedText = ({ - text, maxLines = 2, - showMoreText = "Show more", - showLessText = "Show less", - className = "", + className, + children, matomoEvent, }: TruncatedTextProps) => { + const { t } = useTranslation("common") const [isExpanded, setIsExpanded] = useState(false) - const lineClampClass = { - 1: "line-clamp-1", - 2: "line-clamp-2", - 3: "line-clamp-3", - 4: "line-clamp-4", - } - return (

- {text} + {children}

) diff --git a/src/intl/en/common.json b/src/intl/en/common.json index 193cac62783..d01c7751e00 100644 --- a/src/intl/en/common.json +++ b/src/intl/en/common.json @@ -435,6 +435,7 @@ "set-up-local-env": "Set up local environment", "sharding": "Sharding", "show-all": "Show all", + "show-more": "Show more", "show-less": "Show less", "single-slot-finality": "Single-slot finality", "site-description": "Ethereum is a global, decentralized platform for money and new kinds of applications. On Ethereum, you can write code that controls money, and build applications accessible anywhere in the world.", diff --git a/src/lib/constants.ts b/src/lib/constants.ts index fd69ee33964..53fec483759 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -249,3 +249,10 @@ export const SIZE_CLASS_MAPPING = { 16: "size-16", 24: "size-24", } as const + +export const LINE_CLAMP_CLASS_MAPPING = { + 1: "line-clamp-1", + 2: "line-clamp-2", + 3: "line-clamp-3", + 4: "line-clamp-4", +} as const