2021-05-28 16:15:17 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { mapDispatchToProps } from '../actions';
|
|
|
|
import { GlobalModalContainer } from '../../components/GlobalModalContainer';
|
|
|
|
import { StateType } from '../reducer';
|
2021-07-19 19:26:06 +00:00
|
|
|
import { SmartProfileEditorModal } from './ProfileEditorModal';
|
2021-09-21 22:37:10 +00:00
|
|
|
import { SmartContactModal } from './ContactModal';
|
2021-07-19 19:26:06 +00:00
|
|
|
|
2021-09-13 02:36:41 +00:00
|
|
|
const FilteredSmartProfileEditorModal = SmartProfileEditorModal;
|
2021-05-28 16:15:17 +00:00
|
|
|
|
2021-07-19 19:26:06 +00:00
|
|
|
function renderProfileEditor(): JSX.Element {
|
|
|
|
return <FilteredSmartProfileEditorModal />;
|
|
|
|
}
|
|
|
|
|
2021-09-21 22:37:10 +00:00
|
|
|
function renderContactModal(): JSX.Element {
|
|
|
|
return <SmartContactModal />;
|
|
|
|
}
|
|
|
|
|
2021-05-28 16:15:17 +00:00
|
|
|
const mapStateToProps = (state: StateType) => {
|
|
|
|
return {
|
|
|
|
...state.globalModals,
|
2021-09-21 22:37:10 +00:00
|
|
|
renderContactModal,
|
2021-07-19 19:26:06 +00:00
|
|
|
renderProfileEditor,
|
2021-05-28 16:15:17 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const smart = connect(mapStateToProps, mapDispatchToProps);
|
|
|
|
|
|
|
|
export const SmartGlobalModalContainer = smart(GlobalModalContainer);
|