-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from bvaughn/website
Add routing support to website
- Loading branch information
Showing
16 changed files
with
320 additions
and
120 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,12 +1,25 @@ | ||
import { StrictMode } from "react"; | ||
import { createRoot } from "react-dom/client"; | ||
import { createBrowserRouter, RouterProvider } from "react-router-dom"; | ||
|
||
import App from "./src/App"; | ||
import DemoRoute from "./src/routes/Demo"; | ||
import MobileRoute from "./src/routes/Mobile"; | ||
|
||
const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <DemoRoute />, | ||
}, | ||
{ | ||
path: "/mobile", | ||
element: <MobileRoute />, | ||
}, | ||
]); | ||
|
||
const rootElement = document.getElementById("root"); | ||
const root = createRoot(rootElement); | ||
root.render( | ||
<StrictMode> | ||
<App /> | ||
<RouterProvider router={router} /> | ||
</StrictMode> | ||
); |
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
2 changes: 1 addition & 1 deletion
2
...anels-website/src/AutoSizedPanelGroup.tsx → ...te/src/components/AutoSizedPanelGroup.tsx
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
21 changes: 21 additions & 0 deletions
21
packages/react-resizable-panels-website/src/components/ResizeHandle.module.css
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.ResizeHandle { | ||
flex: 0 0 0.5rem; | ||
position: relative; | ||
} | ||
|
||
.ResizeHandleActive, | ||
.ResizeHandleInactive { | ||
position: absolute; | ||
top: 0.125rem; | ||
bottom: 0.125rem; | ||
left: 0.125rem; | ||
right: 0.125rem; | ||
border-radius: 0.125rem; | ||
background-color: transparent; | ||
transition: background-color 0.2s linear; | ||
} | ||
|
||
.ResizeHandleActive, | ||
.ResizeHandle:hover .ResizeHandleInactive { | ||
background-color: var(--color-solid-resize-bar-handle); | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/react-resizable-panels-website/src/components/ResizeHandle.tsx
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useContext } from "react"; | ||
import { PanelContext, PanelResizeHandle } from "react-resizable-panels"; | ||
|
||
import styles from "./ResizeHandle.module.css"; | ||
|
||
export default function ResizeHandle({ | ||
className = "", | ||
id, | ||
}: { | ||
className?: string; | ||
id: string; | ||
}) { | ||
const { activeHandleId } = useContext(PanelContext); | ||
const isDragging = activeHandleId === id; | ||
|
||
return ( | ||
<PanelResizeHandle | ||
className={[styles.ResizeHandle, className].join(" ")} | ||
id={id} | ||
> | ||
<div | ||
className={ | ||
isDragging ? styles.ResizeHandleActive : styles.ResizeHandleInactive | ||
} | ||
/> | ||
</PanelResizeHandle> | ||
); | ||
} |
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
File renamed without changes.
Oops, something went wrong.
ff7709d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-resizable-panels – ./
react-resizable-panels-bvaughn.vercel.app
react-resizable-panels.vercel.app
react-resizable-panels-git-main-bvaughn.vercel.app