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

47 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-01-03 19:55:46 +00:00
// Copyright 2021 Signal Messenger, LLC
2021-08-05 23:34:49 +00: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';
2021-08-05 23:34:49 +00:00
import { Intl } from '../Intl';
import { SystemMessage } from './SystemMessage';
2022-01-26 23:05:26 +00:00
import { MessageTimestamp } from './MessageTimestamp';
2021-08-05 23:34:49 +00:00
import { Emojify } from './Emojify';
export type PropsData = {
sender: ConversationType;
timestamp: number;
};
export type PropsHousekeeping = {
i18n: LocalizerType;
};
export type Props = PropsData & PropsHousekeeping;
2022-11-18 00:45:19 +00:00
export function ChangeNumberNotification(props: Props): JSX.Element {
2022-03-08 19:11:11 +00:00
const { i18n, sender, timestamp } = props;
2021-08-05 23:34:49 +00:00
return (
<SystemMessage
contents={
<>
<Intl
id="ChangeNumber--notification"
components={{
2022-11-10 04:59:36 +00:00
sender: <Emojify text={sender.title || sender.firstName || ''} />,
}}
i18n={i18n}
/>
&nbsp;·&nbsp;
2022-03-08 19:11:11 +00:00
<MessageTimestamp i18n={i18n} timestamp={timestamp} />
</>
}
icon="phone"
/>
2021-08-05 23:34:49 +00:00
);
2022-11-18 00:45:19 +00:00
}