2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-06-26 00:08:58 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { Store } from 'redux';
|
2020-06-26 00:08:58 +00:00
|
|
|
|
|
|
|
import { SmartSafetyNumberViewer } from '../smart/SafetyNumberViewer';
|
|
|
|
|
|
|
|
// 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 */
|
2020-06-26 00:08:58 +00:00
|
|
|
const FilteredSafetyNumberViewer = SmartSafetyNumberViewer as any;
|
2020-09-14 21:56:35 +00:00
|
|
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
2020-06-26 00:08:58 +00:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
contactID: string;
|
|
|
|
onClose?: () => void;
|
|
|
|
};
|
|
|
|
|
2020-09-14 21:56:35 +00:00
|
|
|
export const createSafetyNumberViewer = (
|
|
|
|
store: Store,
|
|
|
|
props: Props
|
|
|
|
): React.ReactElement => (
|
2020-06-26 00:08:58 +00:00
|
|
|
<Provider store={store}>
|
|
|
|
<FilteredSafetyNumberViewer {...props} />
|
|
|
|
</Provider>
|
|
|
|
);
|