This repository has been archived on 2023-07-01. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js
Eugen Rochko 5e67858fbc [Glitch] Add editing for published statuses
Port 63002cde03 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2022-02-10 19:10:20 +01:00

33 lines
753 B
JavaScript

import { connect } from 'react-redux';
import { cancelReplyCompose } from 'flavours/glitch/actions/compose';
import ReplyIndicator from '../components/reply_indicator';
const makeMapStateToProps = () => {
const mapStateToProps = state => {
let statusId = state.getIn(['compose', 'id'], null);
let editing = true;
if (statusId === null) {
statusId = state.getIn(['compose', 'in_reply_to']);
editing = false;
}
return {
status: state.getIn(['statuses', statusId]),
editing,
};
};
return mapStateToProps;
};
const mapDispatchToProps = dispatch => ({
onCancel () {
dispatch(cancelReplyCompose());
},
});
export default connect(makeMapStateToProps, mapDispatchToProps)(ReplyIndicator);