Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 2x 49x 49x 49x 49x 3x 49x | import React, {useState} from "react";
import ChatPanel from "./ChatPanel";
import ChatToggle from "./ChatToggle";
import { useCurrentUser } from "main/utils/currentUser";
const ChatContainer = ({commonsId}) => {
const { data: currentUser } = useCurrentUser();
const chatContainerStyle = {
width: '550px',
position: 'fixed',
bottom: '100px',
right: '20px',
};
const [isChatOpen, setIsChatOpen] = useState(false);
const toggleChatWindow = () => {
setIsChatOpen((prevState) => !prevState);
};
return (
<div style={chatContainerStyle} data-testid="playpage-chat-div">
{!!isChatOpen && <ChatPanel commonsId={commonsId} currentUser={currentUser}/>}
<ChatToggle isChatOpen={isChatOpen} onClick={toggleChatWindow} />
</div>
);
};
export default ChatContainer; |