bigbuffet-rw/app/soapbox/features/compose/containers/reply_mentions_container.js
marcin mikołajczak 807b3c7e5b Use stack for modals
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-30 18:53:47 +01:00

45 lines
1 KiB
JavaScript

import { connect } from 'react-redux';
import { openModal } from 'soapbox/actions/modal';
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']);
return {
to,
isReply: true,
explicitAddressing: true,
};
};
};
const mapDispatchToProps = dispatch => ({
onOpenMentionsModal() {
dispatch(openModal('REPLY_MENTIONS'));
},
});
export default connect(makeMapStateToProps, mapDispatchToProps)(ReplyMentions);