|
|
@ -15,6 +15,8 @@ import { countableText } from 'flavours/glitch/util/counter';
|
|
|
|
import OptionsContainer from '../containers/options_container';
|
|
|
|
import OptionsContainer from '../containers/options_container';
|
|
|
|
import Publisher from './publisher';
|
|
|
|
import Publisher from './publisher';
|
|
|
|
import TextareaIcons from './textarea_icons';
|
|
|
|
import TextareaIcons from './textarea_icons';
|
|
|
|
|
|
|
|
import { maxChars } from 'flavours/glitch/util/initial_state';
|
|
|
|
|
|
|
|
import CharacterCounter from './character_counter';
|
|
|
|
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
const messages = defineMessages({
|
|
|
|
placeholder: { id: 'compose_form.placeholder', defaultMessage: 'What is on your mind?' },
|
|
|
|
placeholder: { id: 'compose_form.placeholder', defaultMessage: 'What is on your mind?' },
|
|
|
@ -298,6 +300,8 @@ class ComposeForm extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
|
|
|
|
let disabledButton = isSubmitting || isUploading || isChangingUpload || (!text.trim().length && !anyMedia);
|
|
|
|
let disabledButton = isSubmitting || isUploading || isChangingUpload || (!text.trim().length && !anyMedia);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const countText = `${spoilerText}${countableText(text)}${advancedOptions && advancedOptions.get('do_not_federate') ? ' 👁️' : ''}`;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className='composer'>
|
|
|
|
<div className='composer'>
|
|
|
|
<WarningContainer />
|
|
|
|
<WarningContainer />
|
|
|
@ -347,6 +351,7 @@ class ComposeForm extends ImmutablePureComponent {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</AutosuggestTextarea>
|
|
|
|
</AutosuggestTextarea>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className='composer--options-wrapper'>
|
|
|
|
<OptionsContainer
|
|
|
|
<OptionsContainer
|
|
|
|
advancedOptions={advancedOptions}
|
|
|
|
advancedOptions={advancedOptions}
|
|
|
|
disabled={isSubmitting}
|
|
|
|
disabled={isSubmitting}
|
|
|
@ -357,9 +362,13 @@ class ComposeForm extends ImmutablePureComponent {
|
|
|
|
sensitive={sensitive || (spoilersAlwaysOn && spoilerText && spoilerText.length > 0)}
|
|
|
|
sensitive={sensitive || (spoilersAlwaysOn && spoilerText && spoilerText.length > 0)}
|
|
|
|
spoiler={spoilersAlwaysOn ? (spoilerText && spoilerText.length > 0) : spoiler}
|
|
|
|
spoiler={spoilersAlwaysOn ? (spoilerText && spoilerText.length > 0) : spoiler}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div className='compose--counter-wrapper'>
|
|
|
|
|
|
|
|
<CharacterCounter text={countText} max={maxChars} />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<Publisher
|
|
|
|
<Publisher
|
|
|
|
countText={`${spoilerText}${countableText(text)}${advancedOptions && advancedOptions.get('do_not_federate') ? ' 👁️' : ''}`}
|
|
|
|
countText={countText}
|
|
|
|
disabled={disabledButton}
|
|
|
|
disabled={disabledButton}
|
|
|
|
onSecondarySubmit={handleSecondarySubmit}
|
|
|
|
onSecondarySubmit={handleSecondarySubmit}
|
|
|
|
onSubmit={handleSubmit}
|
|
|
|
onSubmit={handleSubmit}
|
|
|
|