2021-01-29 21:19:24 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { StateType } from '../reducer';
|
2022-12-05 22:56:23 +00:00
|
|
|
import type { PropsDataType } from '../../components/conversation/conversation-details/GroupV2Permissions';
|
|
|
|
import { mapDispatchToProps } from '../actions';
|
2021-10-26 19:15:33 +00:00
|
|
|
import { GroupV2Permissions } from '../../components/conversation/conversation-details/GroupV2Permissions';
|
2021-01-29 21:19:24 +00:00
|
|
|
import { getConversationSelector } from '../selectors/conversations';
|
|
|
|
import { getIntl } from '../selectors/user';
|
|
|
|
|
|
|
|
export type SmartGroupV2PermissionsProps = {
|
|
|
|
conversationId: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
const mapStateToProps = (
|
|
|
|
state: StateType,
|
|
|
|
props: SmartGroupV2PermissionsProps
|
2022-12-05 22:56:23 +00:00
|
|
|
): PropsDataType => {
|
2021-01-29 21:19:24 +00:00
|
|
|
const conversation = getConversationSelector(state)(props.conversationId);
|
|
|
|
|
|
|
|
return {
|
|
|
|
...props,
|
|
|
|
conversation,
|
|
|
|
i18n: getIntl(state),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-12-05 22:56:23 +00:00
|
|
|
const smart = connect(mapStateToProps, mapDispatchToProps);
|
2021-01-29 21:19:24 +00:00
|
|
|
|
|
|
|
export const SmartGroupV2Permissions = smart(GroupV2Permissions);
|