diff --git a/app/javascript/mastodon/features/compose/components/circle_dropdown.js b/app/javascript/mastodon/features/compose/components/circle_dropdown.js index b70997c3b7d9f5..ed32e179646d5c 100644 --- a/app/javascript/mastodon/features/compose/components/circle_dropdown.js +++ b/app/javascript/mastodon/features/compose/components/circle_dropdown.js @@ -9,7 +9,9 @@ import { createSelector } from 'reselect'; const messages = defineMessages({ circle_unselect: { id: 'circle.unselect', defaultMessage: '(Select circle)' }, + circle_reply: { id: 'circle.reply', defaultMessage: '(Reply to circle context)' }, circle_open_circle_column: { id: 'circle.open_circle_column', defaultMessage: 'Open circle column' }, + circle_add_new_circle: { id: 'circle.add_new_circle', defaultMessage: '(Add new circle)' }, circle_select: { id: 'circle.select', defaultMessage: 'Select circle' }, }); @@ -39,6 +41,7 @@ class CircleDropdown extends React.PureComponent { circles: ImmutablePropTypes.list, value: PropTypes.string.isRequired, visible: PropTypes.bool.isRequired, + limitedReply: PropTypes.bool.isRequired, onChange: PropTypes.func.isRequired, onOpenCircleColumn: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, @@ -53,19 +56,23 @@ class CircleDropdown extends React.PureComponent { }; render () { - const { circles, value, visible, intl } = this.props; + const { circles, value, visible, limitedReply, intl } = this.props; return (
- {/* eslint-disable-next-line jsx-a11y/no-onchange */} - + {circles.isEmpty() && !limitedReply ? + + : + /* eslint-disable-next-line jsx-a11y/no-onchange */ + + }
); } diff --git a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js index ac235029e07288..2d08a68af69638 100644 --- a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js +++ b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js @@ -31,7 +31,6 @@ class PrivacyDropdownMenu extends React.PureComponent { style: PropTypes.object, items: PropTypes.array.isRequired, value: PropTypes.string.isRequired, - enableValues: PropTypes.array.isRequired, placement: PropTypes.string.isRequired, onClose: PropTypes.func.isRequired, onChange: PropTypes.func.isRequired, @@ -122,7 +121,7 @@ class PrivacyDropdownMenu extends React.PureComponent { render () { const { mounted } = this.state; - const { style, items, placement, value, enableValues } = this.props; + const { style, items, placement, value } = this.props; return ( @@ -132,7 +131,6 @@ class PrivacyDropdownMenu extends React.PureComponent { // react-overlays
{items.map(item => ( - enableValues.includes(item.value) &&
@@ -161,7 +159,6 @@ class PrivacyDropdown extends React.PureComponent { onModalOpen: PropTypes.func, onModalClose: PropTypes.func, value: PropTypes.string.isRequired, - limitedReply: PropTypes.bool.isRequired, onChange: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, }; @@ -247,11 +244,10 @@ class PrivacyDropdown extends React.PureComponent { } render () { - const { value, limitedReply, intl } = this.props; + const { value, intl } = this.props; const { open, placement } = this.state; const valueOption = this.options.find(item => item.value === value); - const enableValues = limitedReply ? ['limited', 'direct'] : ['public', 'unlisted', 'private', 'limited', 'direct']; return (
@@ -275,7 +271,6 @@ class PrivacyDropdown extends React.PureComponent { { return { value: value, - visible: state.getIn(['compose', 'privacy']) === 'limited' && state.getIn(['compose', 'reply_status', 'visibility']) !== 'limited', + visible: state.getIn(['compose', 'privacy']) === 'limited', + limitedReply: state.getIn(['compose', 'privacy']) === 'limited' && state.getIn(['compose', 'reply_status', 'visibility']) === 'limited', }; }; diff --git a/app/javascript/mastodon/features/compose/containers/privacy_dropdown_container.js b/app/javascript/mastodon/features/compose/containers/privacy_dropdown_container.js index 5afb6d89c7306d..0ddf531d3173f1 100644 --- a/app/javascript/mastodon/features/compose/containers/privacy_dropdown_container.js +++ b/app/javascript/mastodon/features/compose/containers/privacy_dropdown_container.js @@ -7,7 +7,6 @@ import { isUserTouching } from '../../../is_mobile'; const mapStateToProps = state => ({ isModalOpen: state.get('modal').modalType === 'ACTIONS', value: state.getIn(['compose', 'privacy']), - limitedReply: state.getIn(['compose', 'reply_status', 'visibility']) === 'limited', }); const mapDispatchToProps = dispatch => ({ diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 99b5a4c8448e25..5f025b74219d1c 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -57,7 +57,9 @@ "bundle_modal_error.close": "Close", "bundle_modal_error.message": "Something went wrong while loading this component.", "bundle_modal_error.retry": "Try again", + "circle.add_new_circle": "(Add new circle)", "circle.open_circle_column": "Open circle column", + "circle.reply": "(Reply to circle context)", "circle.select": "Select circle", "circle.unselect": "(Select circle)", "column.blocks": "Blocked users", diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 3d1a99eab1958c..910bf7d7174487 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -7056,6 +7056,7 @@ noscript { box-sizing: border-box; font-size: 14px; line-height: 14px; + text-align: left; color: $inverted-text-color; display: inline-block; width: 100%; diff --git a/app/javascript/styles/mastodon/rtl.scss b/app/javascript/styles/mastodon/rtl.scss index 50acb8dcd43b78..a836cb1667798c 100644 --- a/app/javascript/styles/mastodon/rtl.scss +++ b/app/javascript/styles/mastodon/rtl.scss @@ -422,6 +422,7 @@ body.rtl { } .circle-dropdown__menu { + text-align: right; padding: 9px 4px 9px 30px; }