Disable the federation dropdown when editing posts

You're not allowed to change post visibility on an edit so the dropdown is misleading.
This commit is contained in:
Darius Kazemi 2022-12-31 01:06:59 -08:00
parent e1df6bc049
commit 7548424b02
2 changed files with 4 additions and 2 deletions

View File

@ -276,7 +276,7 @@ class ComposeForm extends ImmutablePureComponent {
<PollButtonContainer />
<PrivacyDropdownContainer disabled={this.props.isEditing} />
<SpoilerButtonContainer />
<FederationDropdownContainer />
<FederationDropdownContainer disabled={this.props.isEditing} />
<LanguageDropdown />
</div>

View File

@ -154,6 +154,7 @@ export default class FederationDropdown extends React.PureComponent {
onModalClose: PropTypes.func,
value: PropTypes.bool.isRequired,
onChange: PropTypes.func.isRequired,
disabled: PropTypes.bool,
intl: PropTypes.object.isRequired,
};
@ -214,7 +215,7 @@ export default class FederationDropdown extends React.PureComponent {
}
render () {
const { value, intl } = this.props;
const { value, intl, disabled } = this.props;
const { open, placement } = this.state;
const valueOption = this.options.find(item => item.value === value);
@ -232,6 +233,7 @@ export default class FederationDropdown extends React.PureComponent {
inverted
onClick={this.handleToggle}
style={{ height: null, lineHeight: '27px' }}
disabled={disabled}
/>
</div>