Add topic modal

This commit is contained in:
Ken-Håvard Lieng 2019-01-25 03:57:58 +01:00
parent aab1ad3e99
commit 24960f23b9
11 changed files with 235 additions and 172 deletions

View file

@ -2,13 +2,14 @@ import React, { memo } from 'react';
import Navicon from 'containers/Navicon';
import Editable from 'components/ui/Editable';
import { isValidServerName } from 'state/servers';
import { isChannel, linkify } from 'utils';
import { isChannel } from 'utils';
const ChatTitle = ({
status,
title,
tab,
channel,
openModal,
onTitleChange,
onToggleSearch,
onToggleUserList,
@ -44,9 +45,19 @@ const ChatTitle = ({
<span className="chat-title">{title}</span>
</Editable>
<div className="chat-topic-wrap">
<span className="chat-topic">
{channel && linkify(channel.topic)}
</span>
{channel && channel.topic && (
<span
className="chat-topic"
onClick={() =>
openModal('topic', {
topic: channel.topic,
channel: channel.name
})
}
>
{channel.topic}
</span>
)}
{serverError}
</div>
<i className="icon-search" title="Search" onClick={onToggleSearch} />