feat: make flow editor read only when published

This commit is contained in:
Ali BARIN
2022-08-24 21:00:49 +02:00
parent 5ed3b9230e
commit be141e55a9
13 changed files with 87 additions and 25 deletions

View 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>
);
};