Refactor messages model; New timeline react components

This commit is contained in:
Scott Nonnenberg 2019-03-20 10:42:28 -07:00
parent d342b23cbc
commit c41bc53614
31 changed files with 1463 additions and 3395 deletions

View file

@ -0,0 +1,26 @@
import { connect } from 'react-redux';
import { mapDispatchToProps } from '../actions';
import { TimelineItem } from '../../components/conversation/TimelineItem';
import { StateType } from '../reducer';
import { getIntl } from '../selectors/user';
import { getMessageSelector } from '../selectors/conversations';
type ExternalProps = {
id: string;
};
const mapStateToProps = (state: StateType, props: ExternalProps) => {
const { id } = props;
const messageSelector = getMessageSelector(state);
return {
...messageSelector(id),
i18n: getIntl(state),
};
};
const smart = connect(mapStateToProps, mapDispatchToProps);
export const SmartTimelineItem = smart(TimelineItem);