feat: introduce feature flag for new flow editor
This commit is contained in:

committed by
Ali BARIN

parent
b5839390fd
commit
bac4ab5aa4
@@ -20,6 +20,9 @@ import * as URLS from 'config/urls';
|
|||||||
import { TopBar } from './style';
|
import { TopBar } from './style';
|
||||||
import useFlow from 'hooks/useFlow';
|
import useFlow from 'hooks/useFlow';
|
||||||
import { useQueryClient } from '@tanstack/react-query';
|
import { useQueryClient } from '@tanstack/react-query';
|
||||||
|
import EditorNew from 'components/EditorNew/EditorNew';
|
||||||
|
|
||||||
|
const useNewFlowEditor = process.env.REACT_APP_USE_NEW_FLOW_EDITOR === 'true';
|
||||||
|
|
||||||
export default function EditorLayout() {
|
export default function EditorLayout() {
|
||||||
const { flowId } = useParams();
|
const { flowId } = useParams();
|
||||||
@@ -136,7 +139,12 @@ export default function EditorLayout() {
|
|||||||
<EditorProvider value={{ readOnly: !!flow?.active }}>
|
<EditorProvider value={{ readOnly: !!flow?.active }}>
|
||||||
{!flow && !isFlowLoading && 'not found'}
|
{!flow && !isFlowLoading && 'not found'}
|
||||||
|
|
||||||
{flow && <Editor flow={flow} />}
|
{flow &&
|
||||||
|
(useNewFlowEditor ? (
|
||||||
|
<EditorNew flow={flow} />
|
||||||
|
) : (
|
||||||
|
<Editor flow={flow} />
|
||||||
|
))}
|
||||||
</EditorProvider>
|
</EditorProvider>
|
||||||
</Container>
|
</Container>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
12
packages/web/src/components/EditorNew/EditorNew.js
Normal file
12
packages/web/src/components/EditorNew/EditorNew.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import * as React from 'react';
|
||||||
|
import { FlowPropType } from 'propTypes/propTypes';
|
||||||
|
|
||||||
|
function EditorNew(props) {
|
||||||
|
return <div>new editor comes here</div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorNew.propTypes = {
|
||||||
|
flow: FlowPropType.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default EditorNew;
|
Reference in New Issue
Block a user