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