From: David Yip Date: Fri, 17 Nov 2017 20:28:16 +0000 (-0600) Subject: Merge remote-tracking branch 'lambadalambda/feature/configurable-status-size' into... X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=dc16d73bf5f3e7db54e4f21848f40cff3d9172ca;p=mastodon.git Merge remote-tracking branch 'lambadalambda/feature/configurable-status-size' into glitchsoc/feature/configurable-status-size --- dc16d73bf5f3e7db54e4f21848f40cff3d9172ca diff --cc app/javascript/mastodon/features/compose/components/compose_form.js index 13a41f23f,1d0126dbe..aaca45493 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@@ -18,7 -18,9 +18,10 @@@ import { isMobile } from '../../../is_m import ImmutablePureComponent from 'react-immutable-pure-component'; import { length } from 'stringz'; import { countableText } from '../util/counter'; +import ComposeAttachOptions from '../../../../glitch/components/compose/attach_options/index'; + import initialState from '../../../initial_state'; + + const maxChars = initialState.max_toot_chars; const messages = defineMessages({ placeholder: { id: 'compose_form.placeholder', defaultMessage: 'What is on your mind?' }, @@@ -155,58 -147,16 +158,58 @@@ export default class ComposeForm extend render () { const { intl, onPaste, showSearch } = this.props; const disabled = this.props.is_submitting; - const text = [this.props.spoiler_text, countableText(this.props.text)].join(''); + const maybeEye = (this.props.advanced_options && this.props.advanced_options.do_not_federate) ? ' 👁️' : ''; + const text = [this.props.spoiler_text, countableText(this.props.text), maybeEye].join(''); + + const secondaryVisibility = this.props.settings.get('side_arm'); + let showSideArm = secondaryVisibility !== 'none'; let publishText = ''; + let publishText2 = ''; + let title = ''; + let title2 = ''; + + const privacyIcons = { + none: '', + public: 'globe', + unlisted: 'unlock-alt', + private: 'lock', + direct: 'envelope', + }; + + title = `${intl.formatMessage(messages.publish)}: ${intl.formatMessage({ id: `privacy.${this.props.privacy}.short` })}`; + + if (showSideArm) { + // Enhanced behavior with dual toot buttons + publishText = ( + + { + + }{intl.formatMessage(messages.publish)} + + ); - if (this.props.privacy === 'private' || this.props.privacy === 'direct') { - publishText = {intl.formatMessage(messages.publish)}; + title2 = `${intl.formatMessage(messages.publish)}: ${intl.formatMessage({ id: `privacy.${secondaryVisibility}.short` })}`; + publishText2 = ( + + ); } else { - publishText = this.props.privacy !== 'unlisted' ? intl.formatMessage(messages.publishLoud, { publish: intl.formatMessage(messages.publish) }) : intl.formatMessage(messages.publish); + // Original vanilla behavior - no icon if public or unlisted + if (this.props.privacy === 'private' || this.props.privacy === 'direct') { + publishText = {intl.formatMessage(messages.publish)}; + } else { + publishText = this.props.privacy !== 'unlisted' ? intl.formatMessage(messages.publishLoud, { publish: intl.formatMessage(messages.publish) }) : intl.formatMessage(messages.publish); + } } - const submitDisabled = disabled || this.props.is_uploading || length(text) > 500 || (text.length !== 0 && text.trim().length === 0); ++ const submitDisabled = disabled || this.props.is_uploading || length(text) > maxChars || (text.length !== 0 && text.trim().length === 0); + return (
@@@ -245,35 -195,17 +248,35 @@@
-
-
- - - - -
+
+ + +
+ + + +
-
-
-
+
-
++
+
+ { + showSideArm ? +