From ec2daae71ca03b414fa41a07e13e9653b0dff0a4 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Fri, 30 Jun 2017 02:15:18 -0700 Subject: [PATCH] Media display improvements - built in fullwidth styling - letterbox settings toggle - media no longer counts towards height when making toot-collapsing measurements --- .../mastodon/components/media_gallery.js | 12 +- app/javascript/mastodon/components/status.js | 23 +++- .../mastodon/components/video_player.js | 17 ++- .../status/components/detailed_status.js | 24 +++- .../mastodon/features/status/index.js | 5 +- .../features/ui/components/settings_modal.js | 24 +++- .../mastodon/locales/defaultMessages.json | 10 +- app/javascript/mastodon/locales/en.json | 4 +- .../mastodon/reducers/local_settings.js | 3 + app/javascript/styles/components.scss | 51 ++++++--- app/javascript/styles/custom.scss | 103 ------------------ 11 files changed, 132 insertions(+), 144 deletions(-) diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js index 2cb1ce51c..fe462d245 100644 --- a/app/javascript/mastodon/components/media_gallery.js +++ b/app/javascript/mastodon/components/media_gallery.js @@ -15,6 +15,7 @@ class Item extends React.PureComponent { attachment: ImmutablePropTypes.map.isRequired, index: PropTypes.number.isRequired, size: PropTypes.number.isRequired, + letterbox: PropTypes.bool, onClick: PropTypes.func.isRequired, autoPlayGif: PropTypes.bool.isRequired, }; @@ -31,7 +32,7 @@ class Item extends React.PureComponent { } render () { - const { attachment, index, size } = this.props; + const { attachment, index, size, letterbox } = this.props; let width = 50; let height = 100; @@ -101,7 +102,7 @@ class Item extends React.PureComponent { onClick={this.handleClick} target='_blank' > - + ); } else if (attachment.get('type') === 'gifv') { @@ -110,7 +111,7 @@ class Item extends React.PureComponent { thumbnail = (