0

Add read-write chat embed. Closes #1906

This commit is contained in:
Gabe Kangas 2022-09-10 21:16:41 -07:00
parent cf34998f66
commit 88919efde9
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA
4 changed files with 101 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import { Meta } from '@storybook/addon-docs';
import { Typography } from 'antd';
<Meta title="Owncast/Readme" />
<Meta title="Owncast/Documentation/Readme" />
<Typography.Title style={{ color: 'var(--primary-color)' }}>Owncast Web UI v2</Typography.Title>

View File

@ -1,3 +0,0 @@
export default function ReadWriteChatEmbed() {
return <div className="standalone-chat-embed">fully featured chat embed goes here</div>;
}

View File

@ -0,0 +1,38 @@
import { useRecoilValue } from 'recoil';
import { ChatMessage } from '../../../../interfaces/chat-message.model';
import { ChatContainer } from '../../../../components/chat/ChatContainer/ChatContainer';
import {
ClientConfigStore,
chatDisplayNameAtom,
chatUserIdAtom,
visibleChatMessagesSelector,
clientConfigStateAtom,
isChatModeratorAtom,
} from '../../../../components/stores/ClientConfigStore';
import Header from '../../../../components/ui/Header/Header';
import { ClientConfig } from '../../../../interfaces/client-config.model';
export default function ReadWriteChatEmbed() {
const chatDisplayName = useRecoilValue<string>(chatDisplayNameAtom);
const chatUserId = useRecoilValue<string>(chatUserIdAtom);
const messages = useRecoilValue<ChatMessage[]>(visibleChatMessagesSelector);
const clientConfig = useRecoilValue<ClientConfig>(clientConfigStateAtom);
const isModerator = useRecoilValue<boolean>(isChatModeratorAtom);
const { name, chatDisabled } = clientConfig;
return (
<div>
<ClientConfigStore />
<Header name={name} chatAvailable chatDisabled={chatDisabled} />
<ChatContainer
messages={messages}
usernameToHighlight={chatDisplayName}
chatUserId={chatUserId}
isModerator={isModerator}
showInput
height="80vh"
/>
</div>
);
}

File diff suppressed because one or more lines are too long