From 3bc5452449d492fd7fc9bba28a24acb877fc8dad Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Tue, 27 Mar 2018 15:40:10 +0200 Subject: [Glitch] Display AttachmentList in timelines in compact style when media missing Port 86a9de6753fc425b247699c7822bc8a5d49af043 to glitch-soc --- .../flavours/glitch/components/attachment_list.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/components/attachment_list.js') diff --git a/app/javascript/flavours/glitch/components/attachment_list.js b/app/javascript/flavours/glitch/components/attachment_list.js index 3a28c70f3..ef937fb4c 100644 --- a/app/javascript/flavours/glitch/components/attachment_list.js +++ b/app/javascript/flavours/glitch/components/attachment_list.js @@ -1,5 +1,6 @@ import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; import ImmutablePureComponent from 'react-immutable-pure-component'; const filename = url => url.split('/').pop().split('#')[0].split('?')[0]; @@ -8,10 +9,25 @@ export default class AttachmentList extends ImmutablePureComponent { static propTypes = { media: ImmutablePropTypes.list.isRequired, + compact: PropTypes.bool, }; render () { - const { media } = this.props; + const { media, compact } = this.props; + + if (compact) { + return ( +
+ +
+ ); + } return (
-- cgit