Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix community search results descriptions no max lines #37

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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