signal-desktop/ts/state/smart/MainHeader.tsx
Ken Powers a90246cbe5 Passive UUID support
Co-authored-by: Scott Nonnenberg <scott@signal.org>
2020-03-24 16:59:35 -07:00

39 lines
1.1 KiB
TypeScript

import { connect } from 'react-redux';
import { mapDispatchToProps } from '../actions';
import { MainHeader } from '../../components/MainHeader';
import { StateType } from '../reducer';
import {
getQuery,
getSearchConversationId,
getSearchConversationName,
getStartSearchCounter,
} from '../selectors/search';
import {
getIntl,
getRegionCode,
getUserConversationId,
getUserNumber,
getUserUuid,
} from '../selectors/user';
import { getMe } from '../selectors/conversations';
const mapStateToProps = (state: StateType) => {
return {
searchTerm: getQuery(state),
searchConversationId: getSearchConversationId(state),
searchConversationName: getSearchConversationName(state),
startSearchCounter: getStartSearchCounter(state),
regionCode: getRegionCode(state),
ourConversationId: getUserConversationId(state),
ourNumber: getUserNumber(state),
ourUuid: getUserUuid(state),
...getMe(state),
i18n: getIntl(state),
};
};
const smart = connect(mapStateToProps, mapDispatchToProps);
export const SmartMainHeader = smart(MainHeader);