mirror of
https://github.com/owncast/owncast.git
synced 2024-12-23 17:50:38 +03:00
44483a45d3
* style tweaks for Action Button, UserMenu, Modal * a bunch of misc polish; some around chat * Prettified Code! * cleanup * fix formatting * Reduce content padding a bit * some stylesheet cleanup * fix action button sizing * Remove action button height completely --------- Co-authored-by: gingervitis <gingervitis@users.noreply.github.com> Co-authored-by: Gabe Kangas <gabek@real-ity.com>
42 lines
1,011 B
TypeScript
42 lines
1,011 B
TypeScript
import { FC } from 'react';
|
|
import dynamic from 'next/dynamic';
|
|
import { ModerationBadge } from '../ChatUserBadge/ModerationBadge';
|
|
|
|
import styles from './ChatJoinMessage.module.scss';
|
|
|
|
// Lazy loaded components
|
|
|
|
const TeamOutlined = dynamic(() => import('@ant-design/icons/TeamOutlined'), {
|
|
ssr: false,
|
|
});
|
|
|
|
export type ChatJoinMessageProps = {
|
|
isAuthorModerator: boolean;
|
|
userColor: number;
|
|
displayName: string;
|
|
};
|
|
|
|
export const ChatJoinMessage: FC<ChatJoinMessageProps> = ({
|
|
isAuthorModerator,
|
|
userColor,
|
|
displayName,
|
|
}) => {
|
|
const color = `var(--theme-color-users-${userColor})`;
|
|
|
|
return (
|
|
<div className={styles.root}>
|
|
<span style={{ color }}>
|
|
<span className={styles.icon}>
|
|
<TeamOutlined />
|
|
</span>
|
|
<span className={styles.user}>{displayName}</span>
|
|
{isAuthorModerator && (
|
|
<span>
|
|
<ModerationBadge userColor={userColor} />
|
|
</span>
|
|
)}
|
|
</span>{' '}
|
|
joined the chat.
|
|
</div>
|
|
);
|
|
};
|