Clicking a group in groups-in-common takes you to that conversation

Co-authored-by: Alvaro <110414366+alvaro-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2022-10-07 12:00:36 -07:00 committed by GitHub
parent 6700d2f196
commit 28b9d84a9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 2 deletions

View File

@ -78,6 +78,7 @@ const createProps = (hasGroupLink = false, expireTimer?: number): Props => ({
showConversationNotificationsSettings: action(
'showConversationNotificationsSettings'
),
showConversation: action('showConversation'),
showPendingInvites: action('showPendingInvites'),
showLightboxForMedia: action('showLightboxForMedia'),
updateGroupAttributes: async () => {

View File

@ -6,7 +6,10 @@ import React, { useState } from 'react';
import { Button, ButtonIconType, ButtonVariant } from '../../Button';
import { Tooltip } from '../../Tooltip';
import type { ConversationType } from '../../../state/ducks/conversations';
import type {
ConversationType,
ShowConversationType,
} from '../../../state/ducks/conversations';
import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges';
import type { SmartChooseGroupMembersModalPropsType } from '../../../state/smart/ChooseGroupMembersModal';
import type { SmartConfirmAdditionsModalPropsType } from '../../../state/smart/ConfirmAdditionsModal';
@ -113,6 +116,7 @@ type ActionProps = {
replaceAvatar: ReplaceAvatarActionType;
saveAvatarToDisk: SaveAvatarToDiskActionType;
showContactModal: (contactId: string, conversationId?: string) => void;
showConversation: ShowConversationType;
toggleSafetyNumberModal: (conversationId: string) => unknown;
searchInConversation: (id: string) => unknown;
toggleAddUserToAnotherGroupModal: (contactId?: string) => void;
@ -155,6 +159,7 @@ export const ConversationDetails: React.ComponentType<Props> = ({
showChatColorEditor,
showContactModal,
showConversationNotificationsSettings,
showConversation,
showGroupLinkManagement,
showGroupV2Permissions,
showLightboxForMedia,
@ -530,6 +535,7 @@ export const ConversationDetails: React.ComponentType<Props> = ({
i18n={i18n}
groupsInCommon={groupsInCommon}
toggleAddUserToAnotherGroupModal={toggleAddUserToAnotherGroupModal}
showConversation={showConversation}
/>
)}

View File

@ -2,7 +2,10 @@
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import type { ConversationType } from '../../../state/ducks/conversations';
import type {
ConversationType,
ShowConversationType,
} from '../../../state/ducks/conversations';
import type { LocalizerType } from '../../../types/Util';
import { Avatar } from '../../Avatar';
import { ConversationDetailsIcon, IconType } from './ConversationDetailsIcon';
@ -14,6 +17,7 @@ type Props = {
i18n: LocalizerType;
groupsInCommon: Array<ConversationType>;
toggleAddUserToAnotherGroupModal: (contactId?: string) => void;
showConversation: ShowConversationType;
};
export const ConversationDetailsGroups = ({
@ -21,6 +25,7 @@ export const ConversationDetailsGroups = ({
i18n,
groupsInCommon,
toggleAddUserToAnotherGroupModal,
showConversation,
}: Props): JSX.Element => {
const [showAllGroups, setShowAllGroups] = React.useState(false);
@ -44,6 +49,12 @@ export const ConversationDetailsGroups = ({
{groupsInCommon.slice(0, groupsToShow).map(group => (
<PanelRow
key={group.id}
onClick={() =>
showConversation({
conversationId: group.id,
switchToAssociatedView: true,
})
}
icon={
<Avatar
conversationType="group"