Refactor messages model; New timeline react components
This commit is contained in:
parent
d342b23cbc
commit
c41bc53614
31 changed files with 1463 additions and 3395 deletions
26
ts/state/smart/TimelineItem.tsx
Normal file
26
ts/state/smart/TimelineItem.tsx
Normal 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);
|
Loading…
Add table
Add a link
Reference in a new issue