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.
session-desktop/ts/state/smart/SessionConversation.tsx

33 lines
872 B
TypeScript

import { connect } from 'react-redux';
import { mapDispatchToProps } from '../actions';
import { SessionConversation } from '../../components/session/conversation/SessionConversation';
import { StateType } from '../reducer';
const mapStateToProps = (state: StateType) => {
const conversationKey = state.conversations.selectedConversation;
const conversation =
(conversationKey &&
state.conversations.conversationLookup[conversationKey]) ||
null;
return {
conversation,
conversationKey,
theme: state.theme,
messages: state.conversations.messages,
};
};
const smart = connect(
mapStateToProps,
mapDispatchToProps,
(stateProps, dispatchProps, ownProps) => {
return {
...stateProps,
router: ownProps,
actions: dispatchProps,
};
}
);
export const SmartSessionConversation = smart(SessionConversation);