From 2198000607c6478d51784a526b472434efe17c63 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Mon, 3 Feb 2020 13:21:16 -0600 Subject: button to add the spiderman discard option to polls --- .../flavours/glitch/features/compose/components/poll_form.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/compose/components/poll_form.js b/app/javascript/flavours/glitch/features/compose/components/poll_form.js index a47b3799d..8c8a3b4be 100644 --- a/app/javascript/flavours/glitch/features/compose/components/poll_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/poll_form.js @@ -11,7 +11,8 @@ import { pollLimits } from 'flavours/glitch/util/initial_state'; const messages = defineMessages({ option_placeholder: { id: 'compose_form.poll.option_placeholder', defaultMessage: 'Choice {number}' }, - add_option: { id: 'compose_form.poll.add_option', defaultMessage: 'Add a choice' }, + add_option: { id: 'compose_form.poll.add_option', defaultMessage: 'Add choice' }, + add_spiderman: { id: 'compose_form.poll.add_spiderman', defaultMessage: 'Add spiderman' }, remove_option: { id: 'compose_form.poll.remove_option', defaultMessage: 'Remove this choice' }, poll_duration: { id: 'compose_form.poll.duration', defaultMessage: 'Poll duration' }, single_choice: { id: 'compose_form.poll.single_choice', defaultMessage: 'Allow one choice' }, @@ -57,7 +58,7 @@ class Option extends React.PureComponent { this.props.onSuggestionSelected(tokenStart, token, value, ['poll', 'options', this.props.index]); } - render () { + render() { const { isPollMultiple, title, index, intl } = this.props; return ( @@ -110,6 +111,10 @@ class PollForm extends ImmutablePureComponent { this.props.onAddOption(''); }; + handleAddSpiderman = () => { + this.props.onAddOption('spiderman'); + } + handleSelectDuration = e => { this.props.onChangeSettings(e.target.value, this.props.isMultiple); }; @@ -118,7 +123,7 @@ class PollForm extends ImmutablePureComponent { this.props.onChangeSettings(this.props.expiresIn, e.target.value === 'true'); }; - render () { + render() { const { options, expiresIn, isMultiple, onChangeOption, onRemoveOption, intl, ...other } = this.props; if (!options) { @@ -133,6 +138,7 @@ class PollForm extends ImmutablePureComponent { )} -- cgit