signal-desktop/ts/state/smart/MainHeader.tsx

30 lines
877 B
TypeScript
Raw Normal View History

2019-01-14 21:49:58 +00:00
import { connect } from 'react-redux';
import { mapDispatchToProps } from '../actions';
import { MainHeader } from '../../components/MainHeader';
import { StateType } from '../reducer';
2019-08-09 23:12:29 +00:00
import {
getQuery,
getSearchConversationId,
getSearchConversationName,
} from '../selectors/search';
2019-01-14 21:49:58 +00:00
import { getIntl, getRegionCode, getUserNumber } from '../selectors/user';
import { getMe } from '../selectors/conversations';
const mapStateToProps = (state: StateType) => {
return {
searchTerm: getQuery(state),
2019-08-09 23:12:29 +00:00
searchConversationId: getSearchConversationId(state),
searchConversationName: getSearchConversationName(state),
2019-01-14 21:49:58 +00:00
regionCode: getRegionCode(state),
ourNumber: getUserNumber(state),
...getMe(state),
i18n: getIntl(state),
};
};
const smart = connect(mapStateToProps, mapDispatchToProps);
export const SmartMainHeader = smart(MainHeader);