[feature] Always show content warning: use existing glitch feature (#1)
The modifications you made are somewhat janky; for instance, editing a toot with an existing content warning makes the UI look very weird and doesn't quite work. Glitch already has a feature for this, so simply turn it on by default. This should do the same thing. Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/1 Co-authored-by: julia <midnight@trainwit.ch> Co-committed-by: julia <midnight@trainwit.ch>
This commit is contained in:
@@ -79,6 +79,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
spoilersAlwaysOn: PropTypes.bool,
|
||||
mediaDescriptionConfirmation: PropTypes.bool,
|
||||
preselectOnReply: PropTypes.bool,
|
||||
onChangeSpoilerness: PropTypes.func,
|
||||
onChangeVisibility: PropTypes.func,
|
||||
onMediaDescriptionConfirm: PropTypes.func,
|
||||
};
|
||||
@@ -291,6 +292,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
intl,
|
||||
isSubmitting,
|
||||
layout,
|
||||
onChangeSpoilerness,
|
||||
onClearSuggestions,
|
||||
onFetchSuggestions,
|
||||
onPaste,
|
||||
@@ -298,8 +300,10 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
sensitive,
|
||||
showSearch,
|
||||
sideArm,
|
||||
spoiler,
|
||||
spoilerText,
|
||||
suggestions,
|
||||
spoilersAlwaysOn,
|
||||
isEditing,
|
||||
} = this.props;
|
||||
|
||||
@@ -311,12 +315,13 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
|
||||
<ReplyIndicatorContainer />
|
||||
|
||||
<div className={'spoiler-input spoiler-input--visible'} ref={this.setRef}>
|
||||
<div className={`spoiler-input ${spoiler ? 'spoiler-input--visible' : ''}`} ref={this.setRef} aria-hidden={!this.props.spoiler}>
|
||||
<AutosuggestInput
|
||||
placeholder={intl.formatMessage(messages.spoiler_placeholder)}
|
||||
value={spoilerText}
|
||||
onChange={this.handleChangeSpoiler}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
disabled={!spoiler}
|
||||
ref={this.handleRefSpoilerText}
|
||||
suggestions={suggestions}
|
||||
onSuggestionsFetchRequested={onFetchSuggestions}
|
||||
@@ -359,9 +364,11 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
<OptionsContainer
|
||||
advancedOptions={advancedOptions}
|
||||
disabled={isSubmitting}
|
||||
onToggleSpoiler={spoilersAlwaysOn ? null : onChangeSpoilerness}
|
||||
onUpload={onPaste}
|
||||
isEditing={isEditing}
|
||||
sensitive={sensitive || (spoilerText && spoilerText.length > 0)}
|
||||
sensitive={sensitive || (spoilersAlwaysOn && spoilerText && spoilerText.length > 0)}
|
||||
spoiler={spoilersAlwaysOn ? (spoilerText && spoilerText.length > 0) : spoiler}
|
||||
/>
|
||||
<div className='character-counter__wrapper'>
|
||||
<CharacterCounter text={countText} max={maxChars} />
|
||||
|
||||
Reference in New Issue
Block a user