2022-04-28 18:54:33 +02:00
|
|
|
import Sider from 'antd/lib/layout/Sider';
|
|
|
|
import { useRecoilValue } from 'recoil';
|
2022-04-28 14:36:05 -07:00
|
|
|
import { ChatMessage } from '../../../interfaces/chat-message.model';
|
2022-07-10 08:56:31 +02:00
|
|
|
import { ChatContainer } from '../../chat';
|
2022-05-04 09:55:44 +02:00
|
|
|
import s from './Sidebar.module.scss';
|
2022-05-25 20:38:40 -07:00
|
|
|
|
2022-06-24 21:30:54 -07:00
|
|
|
import {
|
|
|
|
chatMessagesAtom,
|
|
|
|
chatDisplayNameAtom,
|
|
|
|
chatUserIdAtom,
|
2022-08-22 19:23:06 -07:00
|
|
|
isChatModeratorAtom,
|
2022-06-24 21:30:54 -07:00
|
|
|
} from '../../stores/ClientConfigStore';
|
2022-04-28 18:54:33 +02:00
|
|
|
|
|
|
|
export default function Sidebar() {
|
2022-05-02 17:45:22 -07:00
|
|
|
const messages = useRecoilValue<ChatMessage[]>(chatMessagesAtom);
|
2022-06-24 21:30:54 -07:00
|
|
|
const chatDisplayName = useRecoilValue<string>(chatDisplayNameAtom);
|
|
|
|
const chatUserId = useRecoilValue<string>(chatUserIdAtom);
|
2022-08-22 19:23:06 -07:00
|
|
|
const isChatModerator = useRecoilValue<boolean>(isChatModeratorAtom);
|
2022-04-28 14:36:05 -07:00
|
|
|
|
2022-04-28 18:54:33 +02:00
|
|
|
return (
|
2022-05-25 20:38:40 -07:00
|
|
|
<Sider className={s.root} collapsedWidth={0} width={320}>
|
2022-06-24 21:30:54 -07:00
|
|
|
<ChatContainer
|
|
|
|
messages={messages}
|
|
|
|
usernameToHighlight={chatDisplayName}
|
|
|
|
chatUserId={chatUserId}
|
2022-08-22 19:23:06 -07:00
|
|
|
isModerator={isChatModerator}
|
2022-06-24 21:30:54 -07:00
|
|
|
/>
|
2022-04-28 14:36:05 -07:00
|
|
|
</Sider>
|
2022-04-28 18:54:33 +02:00
|
|
|
);
|
|
|
|
}
|