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

30 lines
922 B
TypeScript
Raw Normal View History

2020-08-26 20:03:42 -04:00
import React from 'react';
2020-06-04 11:16:19 -07:00
import { connect } from 'react-redux';
import { mapDispatchToProps } from '../actions';
import { CallManager } from '../../components/CallManager';
import { StateType } from '../reducer';
import { getIntl } from '../selectors/user';
2020-08-26 20:03:42 -04:00
import { SmartCallingDeviceSelection } from './CallingDeviceSelection';
// Workaround: A react component's required properties are filtering up through connect()
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31363
const FilteredCallingDeviceSelection = SmartCallingDeviceSelection as any;
function renderDeviceSelection(): JSX.Element {
return <FilteredCallingDeviceSelection />;
}
2020-06-04 11:16:19 -07:00
const mapStateToProps = (state: StateType) => {
return {
...state.calling,
i18n: getIntl(state),
2020-08-26 20:03:42 -04:00
renderDeviceSelection,
2020-06-04 11:16:19 -07:00
};
};
const smart = connect(mapStateToProps, mapDispatchToProps);
export const SmartCallManager = smart(CallManager);