2021-10-05 16:47:06 +00:00
|
|
|
// Copyright 2021 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';
|
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
|
|
|
|
|
|
|
// Workaround: A react component's required properties are filtering up through connect()
|
|
|
|
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31363
|
2020-09-14 21:56:35 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
2021-10-05 16:47:06 +00:00
|
|
|
const FilteredConversationView = SmartConversationView as any;
|
2020-09-14 21:56:35 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
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}>
|
2021-10-05 16:47:06 +00:00
|
|
|
<FilteredConversationView {...props} />
|
2019-03-20 17:42:28 +00:00
|
|
|
</Provider>
|
|
|
|
);
|