4 changed files with 101 additions and 4 deletions
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
export default function ReadWriteChatEmbed() { |
||||
return <div className="standalone-chat-embed">fully featured chat embed goes here</div>; |
||||
} |
@ -0,0 +1,38 @@
@@ -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
Loading…
Reference in new issue