Skip to content
Permalink
Browse files

Truncate descriptions that are over 500 chars

  • Loading branch information...
alicerunsonfedora committed May 24, 2019
1 parent 572b34f commit 143ca3dae574fe1357591819eec59900e947bb0b
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/components/Post/Post.tsx
@@ -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?

0 comments on commit 143ca3d

Please sign in to comment.
You can’t perform that action at this time.