Truncate descriptions that are over 500 chars

This commit is contained in:
Marquis Kurt 2019-05-24 17:59:35 -04:00
parent 572b34f79e
commit 143ca3dae5
1 changed files with 6 additions and 1 deletions

View File

@ -151,7 +151,12 @@ export class Post extends React.Component<any, IPostState> {
<CardActionArea href={status.card.url} target="_blank" rel="noreferrer">
<CardContent>
<Typography gutterBottom variant="h6" component="h2">{status.card.title}</Typography>
<Typography>{status.card.description || "No description provided. Click with caution."}</Typography>
<Typography>
{
status.card.description.slice(0, 500) + (status.card.description.length > 500? "...": "")
|| "No description provided. Click with caution."
}
</Typography>
</CardContent>
{
status.card.image && status.media_attachments.length <= 0?