From 1fa03e026adbf0c45bd4384b58a93ddc9838b5ec Mon Sep 17 00:00:00 2001 From: kibi! Date: Sun, 14 Jan 2018 14:13:24 -0800 Subject: Fixes onboarding modal (#318) --- .../composer/options/dropdown/content/index.js | 6 +-- .../glitch/features/composer/options/index.js | 48 +++++++++++----------- 2 files changed, 26 insertions(+), 28 deletions(-) (limited to 'app/javascript/flavours/glitch/features/composer/options') diff --git a/app/javascript/flavours/glitch/features/composer/options/dropdown/content/index.js b/app/javascript/flavours/glitch/features/composer/options/dropdown/content/index.js index 28bdfc0db..b3a472999 100644 --- a/app/javascript/flavours/glitch/features/composer/options/dropdown/content/index.js +++ b/app/javascript/flavours/glitch/features/composer/options/dropdown/content/index.js @@ -96,7 +96,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent transform: `scale(${scaleX}, ${scaleY})`, }} > - {items.map( + {items ? items.map( ({ name, ...rest @@ -110,7 +110,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent options={rest} /> ) - )} + ) : null} )} @@ -127,7 +127,7 @@ ComposerOptionsDropdownContent.propTypes = { name: PropTypes.string.isRequired, on: PropTypes.bool, text: PropTypes.node, - })).isRequired, + })), onChange: PropTypes.func, onClose: PropTypes.func, style: PropTypes.object, diff --git a/app/javascript/flavours/glitch/features/composer/options/index.js b/app/javascript/flavours/glitch/features/composer/options/index.js index 954508c11..c129622bc 100644 --- a/app/javascript/flavours/glitch/features/composer/options/index.js +++ b/app/javascript/flavours/glitch/features/composer/options/index.js @@ -292,31 +292,29 @@ export default class ComposerOptions extends React.PureComponent { onClick={onToggleSpoiler} title={intl.formatMessage(messages.spoiler)} /> - {advancedOptions ? ( - !!value)} - disabled={disabled} - icon='ellipsis-h' - items={[ - { - meta: , - name: 'do_not_federate', - on: advancedOptions.get('do_not_federate'), - text: , - }, - { - meta: , - name: 'threaded_mode', - on: advancedOptions.get('threaded_mode'), - text: , - }, - ]} - onChange={onChangeAdvancedOption} - onModalClose={onModalClose} - onModalOpen={onModalOpen} - title={intl.formatMessage(messages.advanced_options_icon_title)} - /> - ) : null} + !!value)} + disabled={disabled} + icon='ellipsis-h' + items={advancedOptions ? [ + { + meta: , + name: 'do_not_federate', + on: advancedOptions.get('do_not_federate'), + text: , + }, + { + meta: , + name: 'threaded_mode', + on: advancedOptions.get('threaded_mode'), + text: , + }, + ] : null} + onChange={onChangeAdvancedOption} + onModalClose={onModalClose} + onModalOpen={onModalOpen} + title={intl.formatMessage(messages.advanced_options_icon_title)} + /> ); } -- cgit