From 81b21b5f9f8a532f0a1e00a1407efd017ab7fb85 Mon Sep 17 00:00:00 2001 From: carddev81 Date: Wed, 29 Jan 2025 21:41:50 -0600 Subject: [PATCH] fix: add clamptext component for long titles and descriptions per #675 --- frontend/src/Components/LibraryCard.tsx | 23 +++++++++++-------- frontend/src/Components/VideoCard.tsx | 15 ++++++------ .../src/Components/cards/HelpfulLinkCard.tsx | 10 +++++--- .../Components/dashboard/TopContentList.tsx | 5 ++-- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/frontend/src/Components/LibraryCard.tsx b/frontend/src/Components/LibraryCard.tsx index ecbd4a83..f4153738 100644 --- a/frontend/src/Components/LibraryCard.tsx +++ b/frontend/src/Components/LibraryCard.tsx @@ -12,6 +12,7 @@ import { FlagIcon as FlagIconOutline, MagnifyingGlassIcon } from '@heroicons/react/24/outline'; +import ClampedText from './ClampedText'; export default function LibraryCard({ library, @@ -79,18 +80,20 @@ export default function LibraryCard({ alt={`${library.title} thumbnail`} /> -

{library.title}

+ + {library.title} +
- {!route.pathname.includes('knowledge-insights') && ( -
- -
- )} + {!route.pathname.includes('knowledge-insights') && ( +
+ +
+ )}
void handleToggleAction('favorite', e)}> {!route.pathname.includes('knowledge-insights') && ( )} -
+
{`${video.title}
-

+ {video.title} -

+

{video.channel_title} - {toMinutes(video.duration)}

-

+ {videoIsAvailable(video) ? video?.description : getVideoErrorMessage(video) ?? `Video currently unavailable. - May be in the process of downloading, Please check back later`} -

+ May be in the process of downloading, Please check back later`} + {AdminRoles.includes(role) && (videoIsAvailable(video) ? ( -

{link.title}

-

{link.description}

- + + {link.title} + + + {link.description} + {AdminRoles.includes(role) && ( -

+ Explore other content offered -

+
)}