| 
									
										
										
										
											2019-01-14 13:49:58 -08:00
										 |  |  | import { connect } from 'react-redux'; | 
					
						
							|  |  |  | import { mapDispatchToProps } from '../actions'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import { MainHeader } from '../../components/MainHeader'; | 
					
						
							|  |  |  | import { StateType } from '../reducer'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-09 16:12:29 -07:00
										 |  |  | import { | 
					
						
							|  |  |  |   getQuery, | 
					
						
							|  |  |  |   getSearchConversationId, | 
					
						
							|  |  |  |   getSearchConversationName, | 
					
						
							| 
									
										
										
										
											2019-11-07 13:36:16 -08:00
										 |  |  |   getStartSearchCounter, | 
					
						
							| 
									
										
										
										
											2019-08-09 16:12:29 -07:00
										 |  |  | } from '../selectors/search'; | 
					
						
							| 
									
										
										
										
											2020-03-05 13:14:58 -08:00
										 |  |  | import { | 
					
						
							|  |  |  |   getIntl, | 
					
						
							|  |  |  |   getRegionCode, | 
					
						
							|  |  |  |   getUserConversationId, | 
					
						
							|  |  |  |   getUserNumber, | 
					
						
							|  |  |  |   getUserUuid, | 
					
						
							|  |  |  | } from '../selectors/user'; | 
					
						
							| 
									
										
										
										
											2019-01-14 13:49:58 -08:00
										 |  |  | import { getMe } from '../selectors/conversations'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const mapStateToProps = (state: StateType) => { | 
					
						
							|  |  |  |   return { | 
					
						
							|  |  |  |     searchTerm: getQuery(state), | 
					
						
							| 
									
										
										
										
											2019-08-09 16:12:29 -07:00
										 |  |  |     searchConversationId: getSearchConversationId(state), | 
					
						
							|  |  |  |     searchConversationName: getSearchConversationName(state), | 
					
						
							| 
									
										
										
										
											2019-11-07 13:36:16 -08:00
										 |  |  |     startSearchCounter: getStartSearchCounter(state), | 
					
						
							| 
									
										
										
										
											2019-01-14 13:49:58 -08:00
										 |  |  |     regionCode: getRegionCode(state), | 
					
						
							| 
									
										
										
										
											2020-03-05 13:14:58 -08:00
										 |  |  |     ourConversationId: getUserConversationId(state), | 
					
						
							| 
									
										
										
										
											2019-01-14 13:49:58 -08:00
										 |  |  |     ourNumber: getUserNumber(state), | 
					
						
							| 
									
										
										
										
											2020-03-05 13:14:58 -08:00
										 |  |  |     ourUuid: getUserUuid(state), | 
					
						
							| 
									
										
										
										
											2019-01-14 13:49:58 -08:00
										 |  |  |     ...getMe(state), | 
					
						
							|  |  |  |     i18n: getIntl(state), | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const smart = connect(mapStateToProps, mapDispatchToProps); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export const SmartMainHeader = smart(MainHeader); |