diff --git a/app/assets/stylesheets/chat.scss b/app/assets/stylesheets/chat.scss index 59508887e..09a79148d 100644 --- a/app/assets/stylesheets/chat.scss +++ b/app/assets/stylesheets/chat.scss @@ -329,6 +329,17 @@ overflow-x: hidden; } +.chatchannels__channelslistheader{ + background: lighten($purple, 5%); + border: 1px solid darken($purple, 20%); + font-size: 12px; + color: $dark-purple; + box-sizing: border-box; + padding: 5px; + width: 98%; + border-radius: 3px; +} + .chatchannels__channelslistfooter{ font-size: 12px; color: $medium-gray; diff --git a/app/javascript/chat/channels.jsx b/app/javascript/chat/channels.jsx index 008389c05..a97c2abf2 100644 --- a/app/javascript/chat/channels.jsx +++ b/app/javascript/chat/channels.jsx @@ -2,11 +2,11 @@ import { h } from 'preact'; import PropTypes from 'prop-types'; import ConfigImage from 'images/three-dots.svg'; -const Channels = ({ activeChannelId, chatChannels, handleSwitchChannel, expanded }) => { - const channels = chatChannels.map(channel => { +const Channels = ({ activeChannelId, chatChannels, handleSwitchChannel, expanded, filterQuery, channelsLoaded }) => { + const channels = chatChannels.map((channel, index) => { const isActive = parseInt(activeChannelId, 10) === channel.id const lastOpened = channel.last_opened_at ? channel.last_opened_at : channel.channel_users[window.currentUser.username].last_opened_at - const isUnopened = new Date(channel.last_message_at) > new Date(lastOpened); + const isUnopened = (new Date(channel.last_message_at) > new Date(lastOpened)) && channel.messages_count > 0; const otherClassname = isActive @@ -50,7 +50,6 @@ const Channels = ({ activeChannelId, chatChannels, handleSwitchChannel, expanded content = name } } - return (