fix(embed): set background color and height of chat embed. closes #2961

This commit is contained in:
Gabe Kangas
2023-04-27 10:22:59 -07:00
parent 1dc71004c9
commit f2fbce113e

View File

@@ -1,4 +1,6 @@
/* eslint-disable react/no-unknown-property */
import { useRecoilValue } from 'recoil'; import { useRecoilValue } from 'recoil';
import { useEffect } from 'react';
import { ChatMessage } from '../../../../interfaces/chat-message.model'; import { ChatMessage } from '../../../../interfaces/chat-message.model';
import { ChatContainer } from '../../../../components/chat/ChatContainer/ChatContainer'; import { ChatContainer } from '../../../../components/chat/ChatContainer/ChatContainer';
import { import {
@@ -30,8 +32,20 @@ export default function ReadWriteChatEmbed() {
const headerText = online ? streamTitle || name : name; const headerText = online ? streamTitle || name : name;
// This is a hack to force a specific body background color for just this page.
useEffect(() => {
document.body.classList.add('body-background');
}, []);
return ( return (
<div> <div>
<style jsx global>
{`
.body-background {
background: var(--theme-color-components-chat-background);
}
`}
</style>
<ClientConfigStore /> <ClientConfigStore />
<Header name={headerText} chatAvailable chatDisabled={chatDisabled} online={videoAvailable} /> <Header name={headerText} chatAvailable chatDisabled={chatDisabled} online={videoAvailable} />
{currentUser && ( {currentUser && (
@@ -42,7 +56,7 @@ export default function ReadWriteChatEmbed() {
chatUserId={currentUser.id} chatUserId={currentUser.id}
isModerator={currentUser.isModerator} isModerator={currentUser.isModerator}
showInput showInput
height="80vh" height="92vh"
chatAvailable={isChatAvailable} chatAvailable={isChatAvailable}
/> />
</div> </div>