Don't reload on showing chat (#79)

This commit is contained in:
Szymon Szlachtowicz 2021-10-18 12:51:20 +02:00 committed by GitHub
parent 35d32b9292
commit 1ac0ebca18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 18 deletions

View File

@ -62,17 +62,14 @@ function DragDiv() {
document.addEventListener("mouseup", onMouseUp); document.addEventListener("mouseup", onMouseUp);
}} }}
/> />
{showChat && ( <FloatingDiv className={showChat ? "" : "hide"}>
<>
<div
style={{ height: "calc(100% - 50px)", border: "1px solid black" }}
>
<ReactChat <ReactChat
theme={lightTheme} theme={lightTheme}
community={community} community={community}
fetchMetadata={fetchMetadata} fetchMetadata={fetchMetadata}
/> />
</div> </FloatingDiv>
{showChat && (
<SizeSet <SizeSet
onMouseDown={() => { onMouseDown={() => {
setting.current = "size"; setting.current = "size";
@ -80,12 +77,20 @@ function DragDiv() {
document.addEventListener("mouseup", onMouseUp); document.addEventListener("mouseup", onMouseUp);
}} }}
></SizeSet> ></SizeSet>
</>
)} )}
</Drag> </Drag>
); );
} }
const FloatingDiv = styled.div`
height: calc(100% - 50px);
border: 1px solid black;
&.hide {
display: none;
}
`;
const SizeSet = styled.div` const SizeSet = styled.div`
margin-left: auto; margin-left: auto;
margin-right: 0px; margin-right: 0px;