2022-12-15 01:10:09 +00:00
|
|
|
// Copyright 2022 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-03-13 20:44:13 +00:00
|
|
|
import React, { memo } from 'react';
|
2022-12-15 01:10:09 +00:00
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
|
|
|
|
import { ConversationDetailsMembershipList } from '../../components/conversation/conversation-details/ConversationDetailsMembershipList';
|
|
|
|
import { assertDev } from '../../util/assert';
|
|
|
|
import { getGroupMemberships } from '../../util/getGroupMemberships';
|
|
|
|
import {
|
|
|
|
getConversationByIdSelector,
|
2023-08-16 20:54:39 +00:00
|
|
|
getConversationByServiceIdSelector,
|
2022-12-15 01:10:09 +00:00
|
|
|
} from '../selectors/conversations';
|
|
|
|
import { getIntl, getTheme } from '../selectors/user';
|
|
|
|
import { getPreferredBadgeSelector } from '../selectors/badges';
|
|
|
|
import { useGlobalModalActions } from '../ducks/globalModals';
|
|
|
|
|
|
|
|
export type PropsType = {
|
|
|
|
conversationId: string;
|
|
|
|
};
|
|
|
|
|
2024-03-13 20:44:13 +00:00
|
|
|
export const SmartGV1Members = memo(function SmartGV1Members({
|
|
|
|
conversationId,
|
|
|
|
}: PropsType): JSX.Element {
|
2022-12-15 01:10:09 +00:00
|
|
|
const getPreferredBadge = useSelector(getPreferredBadgeSelector);
|
|
|
|
const i18n = useSelector(getIntl);
|
|
|
|
const theme = useSelector(getTheme);
|
|
|
|
const { showContactModal } = useGlobalModalActions();
|
|
|
|
|
|
|
|
const conversationSelector = useSelector(getConversationByIdSelector);
|
2023-08-16 20:54:39 +00:00
|
|
|
const conversationByServiceIdSelector = useSelector(
|
|
|
|
getConversationByServiceIdSelector
|
|
|
|
);
|
2022-12-15 01:10:09 +00:00
|
|
|
|
|
|
|
const conversation = conversationSelector(conversationId);
|
|
|
|
assertDev(
|
|
|
|
conversation,
|
|
|
|
'<SmartPendingInvites> expected a conversation to be found'
|
|
|
|
);
|
|
|
|
|
|
|
|
const { memberships } = getGroupMemberships(
|
|
|
|
conversation,
|
2023-08-16 20:54:39 +00:00
|
|
|
conversationByServiceIdSelector
|
2022-12-15 01:10:09 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<ConversationDetailsMembershipList
|
|
|
|
canAddNewMembers={false}
|
|
|
|
conversationId={conversationId}
|
|
|
|
i18n={i18n}
|
|
|
|
getPreferredBadge={getPreferredBadge}
|
|
|
|
maxShownMemberCount={32}
|
|
|
|
memberships={memberships}
|
|
|
|
showContactModal={showContactModal}
|
|
|
|
theme={theme}
|
|
|
|
/>
|
|
|
|
);
|
2024-03-13 20:44:13 +00:00
|
|
|
});
|