signal-desktop/ts/components/StartNewConversation.tsx

45 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-10-30 20:34:04 +00:00
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2019-01-14 21:49:58 +00:00
import React from 'react';
import { Avatar } from './Avatar';
import { LocalizerType } from '../types/Util';
export type Props = {
2019-01-14 21:49:58 +00:00
phoneNumber: string;
i18n: LocalizerType;
2019-03-12 00:20:16 +00:00
onClick: () => void;
};
2019-01-14 21:49:58 +00:00
export class StartNewConversation extends React.PureComponent<Props> {
2020-09-12 00:46:52 +00:00
public render(): JSX.Element {
2019-01-14 21:49:58 +00:00
const { phoneNumber, i18n, onClick } = this.props;
return (
2020-09-12 00:46:52 +00:00
<button
type="button"
className="module-start-new-conversation"
onClick={onClick}
>
2019-01-14 21:49:58 +00:00
<Avatar
color="grey"
conversationType="direct"
i18n={i18n}
2020-07-24 01:35:32 +00:00
title={phoneNumber}
2019-10-04 18:06:17 +00:00
size={52}
2019-01-14 21:49:58 +00:00
/>
<div className="module-start-new-conversation__content">
<div className="module-start-new-conversation__number">
{phoneNumber}
</div>
<div className="module-start-new-conversation__text">
{i18n('startConversation')}
</div>
</div>
2019-11-07 21:36:16 +00:00
</button>
2019-01-14 21:49:58 +00:00
);
}
}