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,30 +62,35 @@ function DragDiv() {
document.addEventListener("mouseup", onMouseUp); document.addEventListener("mouseup", onMouseUp);
}} }}
/> />
<FloatingDiv className={showChat ? "" : "hide"}>
<ReactChat
theme={lightTheme}
community={community}
fetchMetadata={fetchMetadata}
/>
</FloatingDiv>
{showChat && ( {showChat && (
<> <SizeSet
<div onMouseDown={() => {
style={{ height: "calc(100% - 50px)", border: "1px solid black" }} setting.current = "size";
> document.addEventListener("mousemove", onMouseMove);
<ReactChat document.addEventListener("mouseup", onMouseUp);
theme={lightTheme} }}
community={community} ></SizeSet>
fetchMetadata={fetchMetadata}
/>
</div>
<SizeSet
onMouseDown={() => {
setting.current = "size";
document.addEventListener("mousemove", onMouseMove);
document.addEventListener("mouseup", onMouseUp);
}}
></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;