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.
		
		
		
		
		
			
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			TypeScript
		
	
| import { connect } from 'react-redux';
 | |
| import { mapDispatchToProps } from '../actions';
 | |
| import { StateType } from '../reducer';
 | |
| import { getTheme } from '../selectors/theme';
 | |
| import {
 | |
|   getIsSelectedConvoInitialLoadingInProgress,
 | |
|   getLightBoxOptions,
 | |
|   getSelectedConversation,
 | |
|   getSelectedConversationKey,
 | |
|   getSelectedMessageIds,
 | |
|   getSortedMessagesOfSelectedConversation,
 | |
|   isMessageDetailView,
 | |
|   isRightPanelShowing,
 | |
| } from '../selectors/conversations';
 | |
| import { getOurNumber } from '../selectors/user';
 | |
| import { getStagedAttachmentsForCurrentConversation } from '../selectors/stagedAttachments';
 | |
| import { getHasOngoingCallWithFocusedConvo } from '../selectors/call';
 | |
| import { SessionConversation } from '../../components/conversation/SessionConversation';
 | |
| 
 | |
| const mapStateToProps = (state: StateType) => {
 | |
|   return {
 | |
|     selectedConversation: getSelectedConversation(state),
 | |
|     selectedConversationKey: getSelectedConversationKey(state),
 | |
|     theme: getTheme(state),
 | |
|     messagesProps: getSortedMessagesOfSelectedConversation(state),
 | |
|     ourNumber: getOurNumber(state),
 | |
|     showMessageDetails: isMessageDetailView(state),
 | |
|     isRightPanelShowing: isRightPanelShowing(state),
 | |
|     selectedMessages: getSelectedMessageIds(state),
 | |
|     lightBoxOptions: getLightBoxOptions(state),
 | |
|     stagedAttachments: getStagedAttachmentsForCurrentConversation(state),
 | |
|     hasOngoingCallWithFocusedConvo: getHasOngoingCallWithFocusedConvo(state),
 | |
|     isSelectedConvoInitialLoadingInProgress: getIsSelectedConvoInitialLoadingInProgress(state),
 | |
|   };
 | |
| };
 | |
| 
 | |
| const smart = connect(
 | |
|   mapStateToProps,
 | |
|   mapDispatchToProps,
 | |
|   (stateProps, dispatchProps, ownProps) => {
 | |
|     return {
 | |
|       ...stateProps,
 | |
|       router: ownProps,
 | |
|       actions: dispatchProps,
 | |
|     };
 | |
|   }
 | |
| );
 | |
| export const SmartSessionConversation = smart(SessionConversation);
 |