Standardize on showConversation function, delete unused functions
This commit is contained in:
parent
1dc3ed914f
commit
f2f1c3c021
35 changed files with 174 additions and 198 deletions
|
@ -2,7 +2,10 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import type {
|
||||
ConversationType,
|
||||
ShowConversationType,
|
||||
} from '../state/ducks/conversations';
|
||||
import { Intl } from './Intl';
|
||||
import type { LocalizerType, ThemeType } from '../types/Util';
|
||||
import { Modal } from './Modal';
|
||||
|
@ -11,14 +14,14 @@ import { ConversationListItem } from './conversationList/ConversationListItem';
|
|||
type PropsType = {
|
||||
groupAdmins: Array<ConversationType>;
|
||||
i18n: LocalizerType;
|
||||
openConversation: (conversationId: string) => unknown;
|
||||
showConversation: ShowConversationType;
|
||||
theme: ThemeType;
|
||||
};
|
||||
|
||||
export function AnnouncementsOnlyGroupBanner({
|
||||
groupAdmins,
|
||||
i18n,
|
||||
openConversation,
|
||||
showConversation,
|
||||
theme,
|
||||
}: PropsType): JSX.Element {
|
||||
const [isShowingAdmins, setIsShowingAdmins] = useState(false);
|
||||
|
@ -35,13 +38,13 @@ export function AnnouncementsOnlyGroupBanner({
|
|||
{groupAdmins.map(admin => (
|
||||
<ConversationListItem
|
||||
{...admin}
|
||||
i18n={i18n}
|
||||
onClick={() => {
|
||||
openConversation(admin.id);
|
||||
}}
|
||||
draftPreview=""
|
||||
i18n={i18n}
|
||||
lastMessage={undefined}
|
||||
lastUpdated={undefined}
|
||||
onClick={() => {
|
||||
showConversation({ conversationId: admin.id });
|
||||
}}
|
||||
theme={theme}
|
||||
/>
|
||||
))}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue