2021-06-17 21:15:09 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
2021-08-31 20:58:39 +00:00
|
|
|
import { App } from '../../components/App';
|
2021-06-17 21:15:09 +00:00
|
|
|
import { SmartCallManager } from './CallManager';
|
2021-09-09 16:29:01 +00:00
|
|
|
import { SmartCustomizingPreferredReactionsModal } from './CustomizingPreferredReactionsModal';
|
2021-06-17 21:15:09 +00:00
|
|
|
import { SmartGlobalModalContainer } from './GlobalModalContainer';
|
2021-08-31 20:58:39 +00:00
|
|
|
import { SmartSafetyNumberViewer } from './SafetyNumberViewer';
|
2021-06-17 21:15:09 +00:00
|
|
|
import { StateType } from '../reducer';
|
2021-08-31 20:58:39 +00:00
|
|
|
import { getIntl, getTheme } from '../selectors/user';
|
|
|
|
import {
|
|
|
|
getConversationsStoppingMessageSendBecauseOfVerification,
|
|
|
|
getNumberOfMessagesPendingBecauseOfVerification,
|
|
|
|
} from '../selectors/conversations';
|
2021-09-09 16:29:01 +00:00
|
|
|
import { getIsCustomizingPreferredReactions } from '../selectors/preferredReactions';
|
2021-06-17 21:15:09 +00:00
|
|
|
import { mapDispatchToProps } from '../actions';
|
2021-08-31 20:58:39 +00:00
|
|
|
import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog';
|
2021-06-17 21:15:09 +00:00
|
|
|
|
2021-08-31 20:58:39 +00:00
|
|
|
const mapStateToProps = (state: StateType) => {
|
2021-06-17 21:15:09 +00:00
|
|
|
return {
|
|
|
|
...state.app,
|
2021-08-31 20:58:39 +00:00
|
|
|
conversationsStoppingMessageSendBecauseOfVerification: getConversationsStoppingMessageSendBecauseOfVerification(
|
|
|
|
state
|
|
|
|
),
|
|
|
|
i18n: getIntl(state),
|
2021-09-09 16:29:01 +00:00
|
|
|
isCustomizingPreferredReactions: getIsCustomizingPreferredReactions(state),
|
2021-08-31 20:58:39 +00:00
|
|
|
numberOfMessagesPendingBecauseOfVerification: getNumberOfMessagesPendingBecauseOfVerification(
|
|
|
|
state
|
|
|
|
),
|
2021-06-17 21:15:09 +00:00
|
|
|
renderCallManager: () => <SmartCallManager />,
|
2021-09-09 16:29:01 +00:00
|
|
|
renderCustomizingPreferredReactionsModal: () => (
|
|
|
|
<SmartCustomizingPreferredReactionsModal />
|
|
|
|
),
|
2021-06-17 21:15:09 +00:00
|
|
|
renderGlobalModalContainer: () => <SmartGlobalModalContainer />,
|
2021-08-31 20:58:39 +00:00
|
|
|
renderSafetyNumber: (props: SafetyNumberProps) => (
|
|
|
|
<SmartSafetyNumberViewer {...props} />
|
|
|
|
),
|
2021-06-17 21:15:09 +00:00
|
|
|
theme: getTheme(state),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const smart = connect(mapStateToProps, mapDispatchToProps);
|
|
|
|
|
|
|
|
export const SmartApp = smart(App);
|