signal-desktop/ts/state/roots/createConversationView.tsx

31 lines
832 B
TypeScript
Raw Normal View History

// Copyright 2021-2022 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { Provider } from 'react-redux';
import type { Store } from 'redux';
import { ErrorBoundary } from '../../components/ErrorBoundary';
import type { PropsType } from '../smart/ConversationView';
import { SmartConversationView } from '../smart/ConversationView';
2021-10-05 16:47:06 +00:00
export const createConversationView = (
store: Store,
2021-10-05 16:47:06 +00:00
props: PropsType
): React.ReactElement => (
<Provider store={store}>
<ErrorBoundary
name="createConversationView"
closeView={() => {
window.reduxActions.conversations.showConversation({
conversationId: undefined,
messageId: undefined,
});
}}
>
<SmartConversationView {...props} />
</ErrorBoundary>
</Provider>
);