diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-10-29 14:44:04 +0100 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-10-30 17:51:06 +0100 |
commit | ac9780b8449527a6a7ab5e2031eeb37f7f2291e7 (patch) | |
tree | ce5dac4c0a802688f0c3f8f208ce310b1617f9f9 /app/javascript/flavours/glitch/components | |
parent | 7f24242ef6d3e6b64f9116dedc3ad60048b4c1bc (diff) |
[Glitch] Include preview cards in status entity in REST API
Port 795f0107d23c1c9bd039f6449fa1e094ab7653a7 to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r-- | app/javascript/flavours/glitch/components/status.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 449532ea4..3a22f165b 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -7,6 +7,7 @@ import StatusIcons from './status_icons'; import StatusContent from './status_content'; import StatusActionBar from './status_action_bar'; import AttachmentList from './attachment_list'; +import Card from '../features/status/components/card'; import { injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { MediaGallery, Video } from 'flavours/glitch/util/async-components'; @@ -477,6 +478,15 @@ export default class Status extends ImmutablePureComponent { if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) { background = attachments.getIn([0, 'preview_url']); } + } else if (status.get('card')) { + media = ( + <Card + onOpenMedia={this.props.onOpenMedia} + card={status.get('card')} + compact + /> + ); + //TODO: set mediaIcon? } // Here we prepare extra data-* attributes for CSS selectors. |