ConversationView: Pull various functions out of getMessageActions

This commit is contained in:
Scott Nonnenberg 2022-12-19 17:04:47 -08:00 committed by GitHub
parent 5a98fc2f4c
commit 1e282ee5d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 440 additions and 570 deletions

View file

@ -8,6 +8,7 @@ import { Button, ButtonSize, ButtonVariant } from '../Button';
import { ContactName } from './ContactName';
import { Intl } from '../Intl';
import type { LocalizerType } from '../../types/Util';
import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser';
export type ContactType = {
id: string;
@ -23,21 +24,16 @@ export type PropsData = {
contact: ContactType;
};
export type PropsActions = {
downloadNewVersion: () => unknown;
};
type PropsHousekeeping = {
i18n: LocalizerType;
};
export type Props = PropsData & PropsHousekeeping & PropsActions;
export type Props = PropsData & PropsHousekeeping;
export function UnsupportedMessage({
canProcessNow,
contact,
i18n,
downloadNewVersion,
}: Props): JSX.Element {
const { isMe } = contact;
@ -75,7 +71,7 @@ export function UnsupportedMessage({
<div className="SystemMessage__line">
<Button
onClick={() => {
downloadNewVersion();
openLinkInWebBrowser('https://signal.org/download');
}}
size={ButtonSize.Small}
variant={ButtonVariant.SystemMessage}