signal-desktop/ts/components/conversation/ChangeNumberNotification.tsx

49 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-01-03 11:55:46 -08:00
// Copyright 2021 Signal Messenger, LLC
2021-08-05 16:34:49 -07:00
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import type { ConversationType } from '../../state/ducks/conversations';
import type { LocalizerType } from '../../types/Util';
2024-05-15 14:48:02 -07:00
import { I18n } from '../I18n';
2021-08-05 16:34:49 -07:00
import { SystemMessage } from './SystemMessage';
2022-01-26 17:05:26 -06:00
import { MessageTimestamp } from './MessageTimestamp';
2023-04-20 10:03:43 -07:00
import { UserText } from '../UserText';
2021-08-05 16:34:49 -07:00
export type PropsData = {
sender: ConversationType;
timestamp: number;
};
export type PropsHousekeeping = {
i18n: LocalizerType;
};
export type Props = PropsData & PropsHousekeeping;
2022-11-17 16:45:19 -08:00
export function ChangeNumberNotification(props: Props): JSX.Element {
2022-03-08 14:11:11 -05:00
const { i18n, sender, timestamp } = props;
2021-08-05 16:34:49 -07:00
return (
<SystemMessage
contents={
<>
2024-05-15 14:48:02 -07:00
<I18n
2023-03-29 17:03:25 -07:00
id="icu:ChangeNumber--notification"
components={{
2023-04-20 10:03:43 -07:00
sender: (
<UserText text={sender.title || sender.firstName || ''} />
),
}}
i18n={i18n}
/>
&nbsp;·&nbsp;
2022-03-08 14:11:11 -05:00
<MessageTimestamp i18n={i18n} timestamp={timestamp} />
</>
}
icon="phone"
/>
2021-08-05 16:34:49 -07:00
);
2022-11-17 16:45:19 -08:00
}