Skip to content

Commit 1e9d52e

Browse files
committed
cleanup
1 parent 80d44e0 commit 1e9d52e

File tree

1 file changed

+9
-27
lines changed

1 file changed

+9
-27
lines changed

src/main/client/src/component/Chat.jsx

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import {
1111
import {
1212
useAuthStore,
1313
} from "src/store.js"
14-
import {
15-
useViewStateStore,
16-
} from "src/layout.js"
1714
import {
1815
StompContext,
1916
tfetch,
@@ -193,37 +190,22 @@ function SplitPane({className, messageRef, topElement, bottomElement}) {
193190
}
194191

195192
function SplitBar({splitPos, dragOffset, onMouseDown, container}) {
196-
let dragging = useViewStateStore(state => state.dragging)
197193
if (!container) {
198194
return <div />
199195
}
200-
let innerHeight = Math.trunc(getRemInPixel() * 0.5)
201196
let rect = container.getBoundingClientRect()
202197
let parentRect = container.offsetParent.getBoundingClientRect()
203-
let width = dragging ? 2 * rect.width : rect.width
204-
let left = rect.left - parentRect.left
205-
let lineClass = twJoin(
206-
"absolute h-[1px] z-20 cursor-row-resize",
207-
"bg-transparent",
208-
)
209-
let barClass = twJoin(
210-
"absolute z-20 cursor-row-resize",
211-
"bg-transparent",
212-
)
213-
return <>
214-
<div
215-
onMouseDown={Number.isNaN(dragOffset) ? onMouseDown : undefined}
216-
style={{top: Math.trunc(splitPos), height: 1, width: width, left: left}}
217-
className={lineClass} />
218-
<div
219-
onMouseDown={Number.isNaN(dragOffset) ? onMouseDown : undefined}
220-
style={{top: Math.trunc(splitPos + 1), height: innerHeight, width: width, left: left}}
221-
className={barClass} />
198+
return (
222199
<div
223200
onMouseDown={Number.isNaN(dragOffset) ? onMouseDown : undefined}
224-
style={{top: Math.trunc(splitPos + innerHeight + 1), height: 1, width: width, left: left}}
225-
className={lineClass} />
226-
</>
201+
style={{
202+
top: Math.trunc(splitPos) - 1,
203+
height: Math.trunc(getRemInPixel() * 0.5) + 2,
204+
width: rect.width,
205+
left: rect.left - parentRect.left,
206+
}}
207+
className="absolute z-20 cursor-row-resize bg-transparent" />
208+
)
227209
}
228210

229211
function getSplitPos(clientY, container) {

0 commit comments

Comments
 (0)