-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: draggable panel dragging bg color
Signed-off-by: Innei <[email protected]>
- Loading branch information
Showing
3 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,26 @@ | ||
import { cn } from "@renderer/lib/utils" | ||
import * as React from "react" | ||
|
||
export const PanelSplitter = ( | ||
props: React.DetailedHTMLProps< | ||
React.HTMLAttributes<HTMLDivElement>, | ||
HTMLDivElement | ||
>, | ||
) => ( | ||
<div className="relative h-full w-0 shrink-0"> | ||
<div | ||
tabIndex={-1} | ||
{...props} | ||
className="absolute inset-0 z-[11] w-[2px] -translate-x-1/2 cursor-ew-resize bg-transparent hover:bg-gray-400 active:!bg-accent hover:dark:bg-neutral-500" | ||
/> | ||
</div> | ||
) | ||
> & { | ||
isDragging?: boolean | ||
}, | ||
) => { | ||
const { isDragging, ...rest } = props | ||
|
||
return ( | ||
<div className="relative h-full w-0 shrink-0"> | ||
<div | ||
tabIndex={-1} | ||
{...rest} | ||
className={cn( | ||
"absolute inset-0 z-[11] w-[2px] -translate-x-1/2 cursor-ew-resize bg-transparent hover:bg-gray-400 active:!bg-accent hover:dark:bg-neutral-500", | ||
isDragging ? "bg-accent" : "", | ||
)} | ||
/> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters