about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/ui/components/boost_modal.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-06-07 18:38:07 +0200
committerThibG <thib@sitedethib.com>2019-06-10 16:24:09 +0200
commitccfb48d3eb354e5cdce24dc975ea8a3fb2a1c80e (patch)
tree4a17c968d682981d7d661ade73b82a9bb78077db /app/javascript/flavours/glitch/features/ui/components/boost_modal.js
parentd61a6271c68ecca1745f2683d25ec58573dd2819 (diff)
Add option to display a warning before boosting toots lacking media descriptions
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/components/boost_modal.js')
-rw-r--r--app/javascript/flavours/glitch/features/ui/components/boost_modal.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/boost_modal.js b/app/javascript/flavours/glitch/features/ui/components/boost_modal.js
index ce7ec2479..81bd1e576 100644
--- a/app/javascript/flavours/glitch/features/ui/components/boost_modal.js
+++ b/app/javascript/flavours/glitch/features/ui/components/boost_modal.js
@@ -25,6 +25,7 @@ export default class BoostModal extends ImmutablePureComponent {
     status: ImmutablePropTypes.map.isRequired,
     onReblog: PropTypes.func.isRequired,
     onClose: PropTypes.func.isRequired,
+    missingMediaDescription: PropTypes.bool,
     intl: PropTypes.object.isRequired,
   };
 
@@ -52,7 +53,7 @@ export default class BoostModal extends ImmutablePureComponent {
   }
 
   render () {
-    const { status, intl } = this.props;
+    const { status, missingMediaDescription, intl } = this.props;
     const buttonText = status.get('reblogged') ? messages.cancel_reblog : messages.reblog;
 
     return (
@@ -78,7 +79,13 @@ export default class BoostModal extends ImmutablePureComponent {
         </div>
 
         <div className='boost-modal__action-bar'>
-          <div><FormattedMessage id='boost_modal.combo' defaultMessage='You can press {combo} to skip this next time' values={{ combo: <span>Shift + <i className='fa fa-retweet' /></span> }} /></div>
+          <div>
+            { missingMediaDescription ?
+                <FormattedMessage id='boost_modal.missing_description' defaultMessage='This toot contains some media without description' />
+              :
+                <FormattedMessage id='boost_modal.combo' defaultMessage='You can press {combo} to skip this next time' values={{ combo: <span>Shift + <i className='fa fa-retweet' /></span> }} />
+            }
+          </div>
           <Button text={intl.formatMessage(buttonText)} onClick={this.handleReblog} ref={this.setRef} />
         </div>
       </div>