session-desktop/ts/components/StartNewConversation.tsx
Mikunj b8ef6c2cc6 Loki changes
Added friends section in search.

This is because contacts is now used in signal for something else and we don't want to clash meanings.

Styling fixes

Add dropdown options into mainheader

Updated styling

Restore StartNewConversation to the old ui style of loki messenger.

Fix friend search display.

Fix header expand animation.

Hooked up menu actions.

Linting.

More styling changes.

Fix tests.

Added back in the loki logo below the gutter.

Fix toast positioning.

Fix context menu showing incorrectly on virtual lists.

Added tabs.

Linting
2019-04-24 13:25:20 +10:00

42 lines
1.1 KiB
TypeScript

import React from 'react';
import classNames from 'classnames';
import { LocalizerType } from '../types/Util';
import { validateNumber } from '../types/PhoneNumber';
export interface Props {
phoneNumber: string;
i18n: LocalizerType;
onClick: () => void;
}
export class StartNewConversation extends React.PureComponent<Props> {
public render() {
const { phoneNumber, i18n, onClick } = this.props;
const error = validateNumber(phoneNumber, i18n);
const avatar = error ? '!' : '#';
const click = error ? undefined : onClick;
return (
<div
role="button"
className={classNames(
'module-start-new-conversation',
!error && 'valid'
)}
onClick={click}
>
<div className="module-start-new-conversation__avatar">{avatar}</div>
<div className="module-start-new-conversation__content">
<div className="module-start-new-conversation__number">
{phoneNumber}
</div>
<div className="module-start-new-conversation__text">
{error || i18n('startConversation')}
</div>
</div>
</div>
);
}
}