2022-02-25 23:59:43 +00:00
|
|
|
// Copyright 2021-2022 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-03-20 17:42:28 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { Store } from 'redux';
|
2022-08-19 18:35:40 +00:00
|
|
|
import { ErrorBoundary } from '../../components/ErrorBoundary';
|
2019-03-20 17:42:28 +00:00
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { PropsType } from '../smart/ConversationView';
|
|
|
|
import { SmartConversationView } from '../smart/ConversationView';
|
2019-03-20 17:42:28 +00:00
|
|
|
|
2021-10-05 16:47:06 +00:00
|
|
|
export const createConversationView = (
|
2020-09-14 21:56:35 +00:00
|
|
|
store: Store,
|
2021-10-05 16:47:06 +00:00
|
|
|
props: PropsType
|
2020-09-14 21:56:35 +00:00
|
|
|
): React.ReactElement => (
|
2019-03-20 17:42:28 +00:00
|
|
|
<Provider store={store}>
|
2022-08-19 18:35:40 +00:00
|
|
|
<ErrorBoundary
|
|
|
|
name="createConversationView"
|
|
|
|
closeView={() => {
|
|
|
|
window.reduxActions.conversations.showConversation({
|
|
|
|
conversationId: undefined,
|
|
|
|
messageId: undefined,
|
|
|
|
});
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<SmartConversationView {...props} />
|
|
|
|
</ErrorBoundary>
|
2019-03-20 17:42:28 +00:00
|
|
|
</Provider>
|
|
|
|
);
|