sforkowany z mirror/soapbox
Remove ReplyMentionsContainer
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>next-virtuoso-proof
rodzic
da09365055
commit
4f358b9632
|
@ -1,7 +1,6 @@
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
const Select = React.forwardRef((props, ref) => {
|
const Select = React.forwardRef<HTMLSelectElement>((props, ref) => {
|
||||||
const { children, ...filteredProps } = props;
|
const { children, ...filteredProps } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -15,8 +14,4 @@ const Select = React.forwardRef((props, ref) => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
Select.propTypes = {
|
|
||||||
children: PropTypes.node,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Select;
|
export default Select;
|
|
@ -14,6 +14,7 @@ import AutosuggestInput from '../../../components/autosuggest_input';
|
||||||
import AutosuggestTextarea from '../../../components/autosuggest_textarea';
|
import AutosuggestTextarea from '../../../components/autosuggest_textarea';
|
||||||
import { Button } from '../../../components/ui';
|
import { Button } from '../../../components/ui';
|
||||||
import { isMobile } from '../../../is_mobile';
|
import { isMobile } from '../../../is_mobile';
|
||||||
|
import ReplyMentions from '../components/reply_mentions';
|
||||||
import Warning from '../components/warning';
|
import Warning from '../components/warning';
|
||||||
import EmojiPickerDropdown from '../containers/emoji_picker_dropdown_container';
|
import EmojiPickerDropdown from '../containers/emoji_picker_dropdown_container';
|
||||||
import MarkdownButtonContainer from '../containers/markdown_button_container';
|
import MarkdownButtonContainer from '../containers/markdown_button_container';
|
||||||
|
@ -22,7 +23,6 @@ import PollFormContainer from '../containers/poll_form_container';
|
||||||
import PrivacyDropdownContainer from '../containers/privacy_dropdown_container';
|
import PrivacyDropdownContainer from '../containers/privacy_dropdown_container';
|
||||||
import QuotedStatusContainer from '../containers/quoted_status_container';
|
import QuotedStatusContainer from '../containers/quoted_status_container';
|
||||||
import ReplyIndicatorContainer from '../containers/reply_indicator_container';
|
import ReplyIndicatorContainer from '../containers/reply_indicator_container';
|
||||||
import ReplyMentions from '../containers/reply_mentions_container';
|
|
||||||
import ScheduleButtonContainer from '../containers/schedule_button_container';
|
import ScheduleButtonContainer from '../containers/schedule_button_container';
|
||||||
import ScheduleFormContainer from '../containers/schedule_form_container';
|
import ScheduleFormContainer from '../containers/schedule_form_container';
|
||||||
import SpoilerButtonContainer from '../containers/spoiler_button_container';
|
import SpoilerButtonContainer from '../containers/spoiler_button_container';
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
import { connect } from 'react-redux';
|
|
||||||
|
|
||||||
import { openModal } from 'soapbox/actions/modals';
|
|
||||||
import { statusToMentionsAccountIdsArray } from 'soapbox/reducers/compose';
|
|
||||||
import { makeGetStatus } from 'soapbox/selectors';
|
|
||||||
import { getFeatures } from 'soapbox/utils/features';
|
|
||||||
|
|
||||||
import ReplyMentions from '../components/reply_mentions';
|
|
||||||
|
|
||||||
const makeMapStateToProps = () => {
|
|
||||||
const getStatus = makeGetStatus();
|
|
||||||
|
|
||||||
return state => {
|
|
||||||
const instance = state.get('instance');
|
|
||||||
const { explicitAddressing } = getFeatures(instance);
|
|
||||||
|
|
||||||
if (!explicitAddressing) {
|
|
||||||
return {
|
|
||||||
explicitAddressing: false,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const status = getStatus(state, { id: state.getIn(['compose', 'in_reply_to']) });
|
|
||||||
|
|
||||||
if (!status) {
|
|
||||||
return {
|
|
||||||
isReply: false,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const to = state.getIn(['compose', 'to']);
|
|
||||||
|
|
||||||
const me = state.get('me');
|
|
||||||
const account = state.getIn(['accounts', me]);
|
|
||||||
|
|
||||||
const parentTo = statusToMentionsAccountIdsArray(status, account);
|
|
||||||
|
|
||||||
return {
|
|
||||||
to,
|
|
||||||
parentTo,
|
|
||||||
isReply: true,
|
|
||||||
explicitAddressing: true,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
|
||||||
onOpenMentionsModal() {
|
|
||||||
dispatch(openModal('REPLY_MENTIONS'));
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(makeMapStateToProps, mapDispatchToProps)(ReplyMentions);
|
|
Ładowanie…
Reference in New Issue