Skip to content

Commit

Permalink
Fix community search results descriptions no max lines (aeharding#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Jun 28, 2023
1 parent 7e98507 commit 1a10c64
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/features/community/CommunitySummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import CommunityLink from "../labels/links/CommunityLink";
import Ago from "../labels/Ago";
import { useBuildGeneralBrowseLink } from "../../helpers/routes";
import { getHandle } from "../../helpers/lemmy";
import InlineMarkdown from "../shared/InlineMarkdown";

const Container = styled(IonItem)`
${maxWidthCss}
Expand All @@ -27,7 +28,11 @@ const Stats = styled.div`

const Description = styled.div`
font-size: 0.9em;
white-space: pre-wrap;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
`;

interface CommunitySummaryProps {
Expand All @@ -52,7 +57,11 @@ export default function CommunitySummary({ community }: CommunitySummaryProps) {
{community.counts.subscribers !== 1 ? "s" : ""} ·{" "}
<Ago date={community.community.published} /> Old{" "}
</Stats>
<Description>{community.community.description}</Description>
{community.community.description && (
<Description>
<InlineMarkdown>{community.community.description}</InlineMarkdown>
</Description>
)}
</Contents>
</Container>
);
Expand Down

0 comments on commit 1a10c64

Please sign in to comment.