diff --git a/src/pages/commonFeed/components/FeedLayout/components/SplitView/SplitView.module.scss b/src/pages/commonFeed/components/FeedLayout/components/SplitView/SplitView.module.scss index c04dafa35..dc7e316e4 100644 --- a/src/pages/commonFeed/components/FeedLayout/components/SplitView/SplitView.module.scss +++ b/src/pages/commonFeed/components/FeedLayout/components/SplitView/SplitView.module.scss @@ -1,27 +1,42 @@ -@import "../../../../../../constants"; +@import "../../../../../../constants.scss"; -.resizer { - flex-shrink: 0; - z-index: 99; - background: transparent; - background-clip: padding-box; - opacity: 0.2; - box-sizing: border-box; +.container { + display: flex; + height: 100%; + overflow: hidden; +} + +.left, .center, .right { + height: 100%; + overflow-y: auto; +} + +.divider { + width: 4px; + background-color: $gray-200; + cursor: col-resize; + transition: background-color 0.2s ease; &:hover { - transition: all 2s ease; + background-color: $blue-500; } - &:global(.vertical) { - width: 0.6875rem; - margin: 0 -0.3125rem; - border-left: 0.3125rem solid transparent; - border-right: 0.3125rem solid transparent; - cursor: col-resize; + &::after { + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 16px; + height: 16px; + background-image: url('path/to/your/resize-icon.svg'); + background-repeat: no-repeat; + background-position: center; + opacity: 0; + transition: opacity 0.2s ease; + } - &:hover { - border-left: 0.3125rem solid #{$split-view-resizer-border-hover-color}; - border-right: 0.3125rem solid #{$split-view-resizer-border-hover-color}; - } + &:hover::after { + opacity: 1; } } diff --git a/src/pages/commonFeed/components/FeedLayout/components/SplitView/SplitView.tsx b/src/pages/commonFeed/components/FeedLayout/components/SplitView/SplitView.tsx index 737964f0c..4e7d2d79b 100644 --- a/src/pages/commonFeed/components/FeedLayout/components/SplitView/SplitView.tsx +++ b/src/pages/commonFeed/components/FeedLayout/components/SplitView/SplitView.tsx @@ -1,56 +1,55 @@ -import React, { FC, useEffect } from "react"; -import SplitPane from "react-split-pane"; -import { useLockedBody } from "@/shared/hooks"; -import styles from "./SplitView.module.scss"; +import React, { useState, useCallback } from 'react'; +import classNames from 'classnames'; +import styles from './SplitView.module.scss'; interface SplitViewProps { - className?: string; - size: number; - minSize: number; - maxSize: number; - defaultSize?: number; - onChange?: (newSize: number) => void; + left: React.ReactNode; + center: React.ReactNode; + right: React.ReactNode; + initialLeftWidth?: number; + initialRightWidth?: number; } -const SplitView: FC = (props) => { - const { className, size, minSize, maxSize, defaultSize, onChange, children } = - props; - const { lockBodyScroll, unlockBodyScroll } = useLockedBody(); +const SplitView: React.FC = ({ + left, + center, + right, + initialLeftWidth = 250, + initialRightWidth = 400 +}) => { + const [leftWidth, setLeftWidth] = useState(initialLeftWidth); + const [rightWidth, setRightWidth] = useState(initialRightWidth); - useEffect(() => { - lockBodyScroll(); - return () => { - unlockBodyScroll(); - }; + const handleLeftDividerMouseDown = useCallback(() => { + // Implement left divider drag logic similar to the existing right divider + }, []); + + const handleRightDividerMouseDown = useCallback(() => { + // ... existing right divider drag logic ... }, []); return ( - - {children} -
- +
+
+ {left} +
+
e.preventDefault()} + /> +
+ {center} +
+
e.preventDefault()} + /> +
+ {right} +
+
); };