-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix useId problem in playroom
The code now exposes the provider and a wrapper div, also allowing for more customization
- Loading branch information
Showing
3 changed files
with
27 additions
and
9 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
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,15 +1,8 @@ | ||
import * as React from "react"; | ||
import "./index.css"; | ||
|
||
import { OrbitProvider } from "../src"; | ||
import defaultTheme from "../src/defaultTheme"; | ||
|
||
// Wrap all examples in OrbitProvider for proper theming | ||
const FrameComponent = ({ children }) => { | ||
return ( | ||
<OrbitProvider theme={defaultTheme} useId={React.useId}> | ||
<div style={{ padding: "20px" }}>{children}</div> | ||
</OrbitProvider> | ||
); | ||
return <div id="playroom-frame">{children}</div>; | ||
}; | ||
|
||
export default FrameComponent; |
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,12 @@ | ||
import React from "react"; | ||
|
||
import { useTheme } from "../src"; | ||
|
||
const useScope = () => { | ||
return { | ||
useId: React.useId, | ||
theme: useTheme(), | ||
}; | ||
}; | ||
|
||
export default useScope; |