Skip to content

Commit

Permalink
Display fallback link card thumbnail when none is given (mastodon#9715)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and hiyuki2578 committed Oct 2, 2019
1 parent cdb5a46 commit 0d4e4d7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/javascript/mastodon/features/status/components/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ export default class Card extends React.PureComponent {
{thumbnail}
</div>
);
} else {
embed = (
<div className='status-card__image'>
<i className='fa fa-file-text' />
</div>
);
}

return (
Expand Down
9 changes: 9 additions & 0 deletions app/javascript/styles/mastodon/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2587,6 +2587,15 @@ a.status-card {
flex: 0 0 100px;
background: lighten($ui-base-color, 8%);
position: relative;

.fa {
font-size: 21px;
position: absolute;
transform-origin: 50% 50%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}

.status-card.horizontal {
Expand Down

0 comments on commit 0d4e4d7

Please sign in to comment.