Add "new conversation" composer for direct messages
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user