ea9c7a4a27
* Refactor CommentBadge * Refactor livestreamComment component * Refactor and split livestreamComment CSS * Refactor livestreamComments component * Refactor and split livestreamComments CSS * Remove never used spinner * Refactor livestream Page * Refactor page component * Refactor livestreamLayout component * Break apart livestreamComments into separate sibling components - This helps separating LivestreamComments to deal with only the comments, and the LivestreamLayout to be used for its own Page as a Popout option, and also for a layered approach for mobile * Create Popout Chat Page, Add Popout Chat Menu Option * Add Hide Chat option * sockety improvements * Websocket changes Co-authored-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
35 lines
783 B
JavaScript
35 lines
783 B
JavaScript
// @flow
|
|
import 'scss/component/_comment-badge.scss';
|
|
|
|
import classnames from 'classnames';
|
|
import Icon from 'component/common/icon';
|
|
import React from 'react';
|
|
import Tooltip from 'component/common/tooltip';
|
|
|
|
const LABEL_TYPES = {
|
|
ADMIN: 'Admin',
|
|
MOD: 'Moderator',
|
|
};
|
|
|
|
type Props = {
|
|
icon: string,
|
|
label: string,
|
|
size?: number,
|
|
};
|
|
|
|
export default function CommentBadge(props: Props) {
|
|
const { icon, label, size = 20 } = props;
|
|
|
|
return (
|
|
<Tooltip title={label} placement="top">
|
|
<span
|
|
className={classnames('comment__badge', {
|
|
'comment__badge--globalMod': label === LABEL_TYPES.ADMIN,
|
|
'comment__badge--mod': label === LABEL_TYPES.MOD,
|
|
})}
|
|
>
|
|
<Icon icon={icon} size={size} />
|
|
</span>
|
|
</Tooltip>
|
|
);
|
|
}
|