feat: make flow editor read only when published
This commit is contained in:
23
packages/web/src/contexts/Editor.tsx
Normal file
23
packages/web/src/contexts/Editor.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import * as React from 'react';
|
||||
|
||||
interface IEditorContext {
|
||||
readOnly: boolean;
|
||||
}
|
||||
|
||||
export const EditorContext = React.createContext<IEditorContext>({ readOnly: false });
|
||||
|
||||
type EditorProviderProps = {
|
||||
children: React.ReactNode;
|
||||
value: IEditorContext;
|
||||
}
|
||||
|
||||
export const EditorProvider = (props: EditorProviderProps): React.ReactElement => {
|
||||
const { children, value } = props;
|
||||
return (
|
||||
<EditorContext.Provider
|
||||
value={value}
|
||||
>
|
||||
{children}
|
||||
</EditorContext.Provider>
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user