2021-01-29 21:19:24 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-03-13 20:44:13 +00:00
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
import React, { memo } from 'react';
|
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';
|
2024-03-13 20:44:13 +00:00
|
|
|
import { useConversationsActions } from '../ducks/conversations';
|
2021-01-29 21:19:24 +00:00
|
|
|
|
|
|
|
export type SmartGroupV2PermissionsProps = {
|
|
|
|
conversationId: string;
|
|
|
|
};
|
|
|
|
|
2024-03-13 20:44:13 +00:00
|
|
|
export const SmartGroupV2Permissions = memo(function SmartGroupV2Permissions({
|
|
|
|
conversationId,
|
|
|
|
}: SmartGroupV2PermissionsProps) {
|
|
|
|
const i18n = useSelector(getIntl);
|
|
|
|
const conversationSelector = useSelector(getConversationSelector);
|
|
|
|
const conversation = conversationSelector(conversationId);
|
|
|
|
const {
|
|
|
|
setAccessControlAttributesSetting,
|
|
|
|
setAccessControlMembersSetting,
|
|
|
|
setAnnouncementsOnly,
|
|
|
|
} = useConversationsActions();
|
|
|
|
return (
|
|
|
|
<GroupV2Permissions
|
|
|
|
i18n={i18n}
|
|
|
|
conversation={conversation}
|
|
|
|
setAccessControlAttributesSetting={setAccessControlAttributesSetting}
|
|
|
|
setAccessControlMembersSetting={setAccessControlMembersSetting}
|
|
|
|
setAnnouncementsOnly={setAnnouncementsOnly}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
});
|