Add "new conversation" composer for direct messages

This commit is contained in:
Evan Hahn 2021-02-23 14:34:28 -06:00 committed by Josh Perez
parent 84dc166b63
commit 06fb4fd0bc
61 changed files with 5960 additions and 3887 deletions

View file

@ -62,6 +62,7 @@ export type PropsType = {
clearSearch: () => void;
showArchivedConversations: () => void;
startComposing: () => void;
};
type StateType = {
@ -340,6 +341,7 @@ export class MainHeader extends React.Component<PropsType, StateType> {
color,
i18n,
name,
startComposing,
phoneNumber,
profileName,
title,
@ -354,6 +356,10 @@ export class MainHeader extends React.Component<PropsType, StateType> {
? i18n('searchIn', [searchConversationName])
: i18n('search');
const isSearching = Boolean(
searchConversationId || searchTerm.trim().length
);
return (
<div className="module-main-header">
<Manager>
@ -456,6 +462,15 @@ export class MainHeader extends React.Component<PropsType, StateType> {
/>
) : null}
</div>
{!isSearching && (
<button
aria-label={i18n('newConversation')}
className="module-main-header__compose-icon"
onClick={startComposing}
title={i18n('newConversation')}
type="button"
/>
)}
</div>
);
}