docbrown/app/javascript/chat/components/ChannelImage.jsx
Katie Davis 76453b41fb
Updates ESLint rules to error on default imports (#12512)
* add rule

* add named imports

* more missed files

* so many files
2021-02-02 10:24:03 -05:00

36 lines
1 KiB
JavaScript

import { h } from 'preact';
import PropTypes from 'prop-types';
import { defaultChannelPropTypes } from '../../common-prop-types/channel-list-prop-type';
export function ChannelImage(props) {
const { channel, newMessagesIndicator, discoverableChannel } = props;
return (
<span
data-channel-slug={channel.channel_modified_slug}
className={
discoverableChannel
? 'chatchanneltabindicator'
: `chatchanneltabindicator chatchanneltabindicator--${newMessagesIndicator}`
}
data-channel-id={channel.chat_channel_id}
>
<img
src={channel.channel_image}
alt="pic"
data-channel-id={channel.chat_channel_id}
className={
channel.channel_type === 'direct'
? 'chatchanneltabindicatordirectimage'
: 'chatchanneltabindicatordirectimage invert-channel-image'
}
/>
</span>
);
}
ChannelImage.propTypes = {
channel: defaultChannelPropTypes,
discoverableChannel: PropTypes.bool,
newMessagesIndicator: PropTypes.string,
};