From f534f4869ecb52cb48f3e68e42752d8f81d7a710 Mon Sep 17 00:00:00 2001 From: ash lea Date: Sun, 10 Mar 2019 15:34:51 -0400 Subject: add local setting to auto reveal media behind cw --- app/javascript/flavours/glitch/components/media_gallery.js | 3 ++- app/javascript/flavours/glitch/components/status.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/media_gallery.js b/app/javascript/flavours/glitch/components/media_gallery.js index 1fa25ee4e..28af21812 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.js +++ b/app/javascript/flavours/glitch/components/media_gallery.js @@ -238,7 +238,8 @@ export default class MediaGallery extends React.PureComponent { }; componentWillReceiveProps (nextProps) { - if (!is(nextProps.media, this.props.media)) { + console.log(nextProps.revealed); + if (!is(nextProps.media, this.props.media) || nextProps.revealed === true) { this.setState({ visible: nextProps.revealed === undefined ? (displayMedia !== 'hide_all' && !nextProps.sensitive || displayMedia === 'show_all') : nextProps.revealed }); } } diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 31f4f1ddd..c8bf75f79 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -466,6 +466,7 @@ export default class Status extends ImmutablePureComponent { onOpenVideo={this.handleOpenVideo} width={this.props.cachedMediaWidth} cacheWidth={this.props.cacheMediaWidth} + revealed={settings.getIn(['media', 'reveal_behind_cw']) && !!status.get('spoiler_text') ? true : undefined} />)} ); @@ -483,6 +484,7 @@ export default class Status extends ImmutablePureComponent { onOpenMedia={this.props.onOpenMedia} cacheWidth={this.props.cacheMediaWidth} defaultWidth={this.props.cachedMediaWidth} + revealed={settings.getIn(['media', 'reveal_behind_cw']) && !!status.get('spoiler_text') ? true : undefined} /> )} -- cgit From 9c620fc5c80ff0f2aa600069dfdf868e150b0799 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 11 Mar 2019 11:32:21 +0100 Subject: [Glitch] Add support for poll ending notifications Port front-end parts of 3a92885a860df12b12d8356faf179a3fc63be6f2 to glitch-soc --- .../flavours/glitch/actions/notifications.js | 2 +- .../flavours/glitch/components/status_prepend.js | 9 ++++++++- .../notifications/components/notification.js | 21 +++++++++++++++++++++ app/javascript/flavours/glitch/reducers/settings.js | 3 +++ 4 files changed, 33 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/actions/notifications.js b/app/javascript/flavours/glitch/actions/notifications.js index f89b4cb36..dd4f5fd44 100644 --- a/app/javascript/flavours/glitch/actions/notifications.js +++ b/app/javascript/flavours/glitch/actions/notifications.js @@ -106,7 +106,7 @@ const excludeTypesFromSettings = state => state.getIn(['settings', 'notification const excludeTypesFromFilter = filter => { - const allTypes = ImmutableList(['follow', 'favourite', 'reblog', 'mention']); + const allTypes = ImmutableList(['follow', 'favourite', 'reblog', 'mention', 'poll']); return allTypes.filterNot(item => item === filter).toJS(); }; diff --git a/app/javascript/flavours/glitch/components/status_prepend.js b/app/javascript/flavours/glitch/components/status_prepend.js index 4e329f546..d1a7c5833 100644 --- a/app/javascript/flavours/glitch/components/status_prepend.js +++ b/app/javascript/flavours/glitch/components/status_prepend.js @@ -62,6 +62,13 @@ export default class StatusPrepend extends React.PureComponent { values={{ name : link }} /> ); + case 'poll': + return ( + + ); } return null; } @@ -75,7 +82,7 @@ export default class StatusPrepend extends React.PureComponent {
diff --git a/app/javascript/flavours/glitch/features/notifications/components/notification.js b/app/javascript/flavours/glitch/features/notifications/components/notification.js index daafe3507..5c5bbf604 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/notification.js +++ b/app/javascript/flavours/glitch/features/notifications/components/notification.js @@ -108,6 +108,27 @@ export default class Notification extends ImmutablePureComponent { withDismiss /> ); + case 'poll': + return ( +