You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import { connect } from 'react-redux';
|
|
import { mapDispatchToProps } from '../actions';
|
|
import { SessionConversation } from '../../components/session/conversation/SessionConversation';
|
|
import { StateType } from '../reducer';
|
|
import { getTheme } from '../selectors/theme';
|
|
import {
|
|
getMessagesOfSelectedConversation,
|
|
getSelectedConversation,
|
|
getSelectedConversationKey,
|
|
} from '../selectors/conversations';
|
|
import { getOurNumber } from '../selectors/user';
|
|
|
|
const mapStateToProps = (state: StateType) => {
|
|
return {
|
|
selectedConversation: getSelectedConversation(state),
|
|
selectedConversationKey: getSelectedConversationKey(state),
|
|
theme: getTheme(state),
|
|
messagesProps: getMessagesOfSelectedConversation(state),
|
|
ourNumber: getOurNumber(state),
|
|
};
|
|
};
|
|
|
|
const smart = connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps,
|
|
(stateProps, dispatchProps, ownProps) => {
|
|
return {
|
|
...stateProps,
|
|
router: ownProps,
|
|
actions: dispatchProps,
|
|
};
|
|
}
|
|
);
|
|
export const SmartSessionConversation = smart(SessionConversation);
|