-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
* UI: refactor use widget wrapper * commit UI assets
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React, { useContext } from 'react' | ||
|
||
export type WidgetWrapper = { | ||
WidgetWrapper: ({ id, children }: { id: string; children: React.ReactNode }) => JSX.Element | ||
} | ||
|
||
const EmptyWidgetWrapper: WidgetWrapper['WidgetWrapper'] = ({ children }) => <>{children}</> | ||
|
||
export const widgetWrapperContext = React.createContext<WidgetWrapper>({ | ||
WidgetWrapper: EmptyWidgetWrapper | ||
}) | ||
|
||
export const useWidgetWrapper = () => useContext(widgetWrapperContext) |