From 1ac0ebca18b281641f1bc36f331584e68d86f39e Mon Sep 17 00:00:00 2001 From: Szymon Szlachtowicz <38212223+Szymx95@users.noreply.github.com> Date: Mon, 18 Oct 2021 12:51:20 +0200 Subject: [PATCH] Don't reload on showing chat (#79) --- packages/react-chat-example/src/index.tsx | 41 +++++++++++++---------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/packages/react-chat-example/src/index.tsx b/packages/react-chat-example/src/index.tsx index 13c81164..469f6b3b 100644 --- a/packages/react-chat-example/src/index.tsx +++ b/packages/react-chat-example/src/index.tsx @@ -62,30 +62,35 @@ function DragDiv() { document.addEventListener("mouseup", onMouseUp); }} /> + + + {showChat && ( - <> -
- -
- { - setting.current = "size"; - document.addEventListener("mousemove", onMouseMove); - document.addEventListener("mouseup", onMouseUp); - }} - > - + { + setting.current = "size"; + document.addEventListener("mousemove", onMouseMove); + document.addEventListener("mouseup", onMouseUp); + }} + > )} ); } +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;