Add support for disabled chat state in the chat input field. Closes #2761

This commit is contained in:
Gabe Kangas
2023-03-01 16:19:02 -08:00
parent de71984d46
commit 4a0476b237
9 changed files with 76 additions and 22 deletions

View File

@@ -5,11 +5,13 @@ import {
ClientConfigStore,
currentUserAtom,
visibleChatMessagesSelector,
isChatAvailableSelector,
} from '../../../../components/stores/ClientConfigStore';
export default function ReadOnlyChatEmbed() {
const currentUser = useRecoilValue(currentUserAtom);
const messages = useRecoilValue<ChatMessage[]>(visibleChatMessagesSelector);
const isChatAvailable = useRecoilValue(isChatAvailableSelector);
return (
<div>
@@ -22,6 +24,7 @@ export default function ReadOnlyChatEmbed() {
isModerator={false}
showInput={false}
height="100vh"
chatAvailable={isChatAvailable}
/>
)}
</div>

View File

@@ -8,6 +8,7 @@ import {
clientConfigStateAtom,
appStateAtom,
serverStatusState,
isChatAvailableSelector,
} from '../../../../components/stores/ClientConfigStore';
import Header from '../../../../components/ui/Header/Header';
import { ClientConfig } from '../../../../interfaces/client-config.model';
@@ -21,6 +22,7 @@ export default function ReadWriteChatEmbed() {
const clientStatus = useRecoilValue<ServerStatus>(serverStatusState);
const appState = useRecoilValue<AppStateOptions>(appStateAtom);
const isChatAvailable = useRecoilValue(isChatAvailableSelector);
const { name, chatDisabled } = clientConfig;
const { videoAvailable } = appState;
@@ -41,6 +43,7 @@ export default function ReadWriteChatEmbed() {
isModerator={currentUser.isModerator}
showInput
height="80vh"
chatAvailable={isChatAvailable}
/>
</div>
)}