2022-08-26 13:13:48 +00:00
|
|
|
import { APP_MODE } from "entities/App";
|
|
|
|
|
import AppViewerPageContainer from "pages/AppViewer/AppViewerPageContainer";
|
2021-06-28 07:11:47 +00:00
|
|
|
import Canvas from "pages/Editor/Canvas";
|
2025-02-20 15:04:06 +00:00
|
|
|
import IDE from "pages/AppIDE/layouts";
|
2021-06-28 07:11:47 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { useSelector } from "react-redux";
|
2024-08-08 12:55:00 +00:00
|
|
|
import { getCanvasWidgetsStructure } from "ee/selectors/entitiesSelector";
|
2022-08-19 10:10:36 +00:00
|
|
|
import { useMockDsl } from "./testCommon";
|
2021-06-28 07:11:47 +00:00
|
|
|
|
2021-09-17 09:08:35 +00:00
|
|
|
export function MockCanvas() {
|
2022-08-19 10:10:36 +00:00
|
|
|
const canvasWidgetsStructure = useSelector(getCanvasWidgetsStructure);
|
2024-10-17 15:18:39 +00:00
|
|
|
|
2024-01-11 05:43:29 +00:00
|
|
|
return <Canvas canvasWidth={0} widgetsStructure={canvasWidgetsStructure} />;
|
2021-09-17 09:08:35 +00:00
|
|
|
}
|
2022-08-26 13:13:48 +00:00
|
|
|
|
2024-10-17 15:18:39 +00:00
|
|
|
export function UpdateAppViewer({ dsl }: { dsl: unknown }) {
|
|
|
|
|
const hasLoaded = useMockDsl(dsl, APP_MODE.PUBLISHED);
|
|
|
|
|
|
|
|
|
|
return hasLoaded ? <AppViewerPageContainer /> : null;
|
2022-08-26 13:13:48 +00:00
|
|
|
}
|
2025-02-17 07:34:23 +00:00
|
|
|
|
2024-10-17 15:18:39 +00:00
|
|
|
export function UpdatedEditor({ dsl }: { dsl: unknown }) {
|
|
|
|
|
const hasLoaded = useMockDsl(dsl, APP_MODE.EDIT);
|
|
|
|
|
|
|
|
|
|
return hasLoaded ? <IDE /> : null;
|
2021-08-24 11:38:20 +00:00
|
|
|
}
|