Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
Feat(webapp): animated resizable panel#3319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
044592ba681af8e7f974e1bbfcf5aa50ab7c59e478037352502f119851d55d13f380734927d49957407e81f0be3c7f1364ce4072939dee295f237dbe4712f4b96b9eb064d9730df31cfc4929c7c715dd3e4b87d9bbd2fbda803a61bb847c7File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| "use client"; | ||
| import React from "react"; | ||
| import React, { useRef } from "react"; | ||
| import { PanelGroup, Panel, PanelResizer } from "react-window-splitter"; | ||
| import { cn } from "~/utils/cn"; | ||
| @@ -69,6 +69,30 @@ const ResizableHandle = ({ | ||
| </PanelResizer> | ||
| ); | ||
| export { ResizableHandle, ResizablePanel, ResizablePanelGroup }; | ||
| const RESIZABLE_PANEL_ANIMATION = { | ||
| easing: "ease-in-out" as const, | ||
| duration: 200, | ||
| }; | ||
| const COLLAPSIBLE_HANDLE_CLASSNAME = "transition-opacity duration-200"; | ||
| function collapsibleHandleClassName(show: boolean) { | ||
| return cn(COLLAPSIBLE_HANDLE_CLASSNAME, !show && "pointer-events-none opacity-0"); | ||
samejr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| function useFrozenValue<T>(value: T | null | undefined): T | null | undefined { | ||
| const ref = useRef(value); | ||
| if (value != null) ref.current = value; | ||
| return ref.current; | ||
| } | ||
| export { | ||
| RESIZABLE_PANEL_ANIMATION, | ||
| ResizableHandle, | ||
| ResizablePanel, | ||
| ResizablePanelGroup, | ||
| collapsibleHandleClassName, | ||
| useFrozenValue, | ||
| }; | ||
| export type ResizableSnapshot = React.ComponentProps<typeof PanelGroup>["snapshot"]; | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.