2024-09-09 10:55:50 +00:00
|
|
|
import React from "react";
|
2025-02-17 07:34:23 +00:00
|
|
|
|
2025-01-05 10:21:23 +00:00
|
|
|
import {
|
|
|
|
|
useGitModEnabled,
|
|
|
|
|
useGitProtectedMode,
|
|
|
|
|
} from "pages/Editor/gitSync/hooks/modHooks";
|
|
|
|
|
import { GitProtectedBranchCallout as GitProtectedBranchCalloutNew } from "git";
|
2025-02-17 07:34:23 +00:00
|
|
|
import BottomBar from "components/BottomBar";
|
|
|
|
|
import EditorWrapperContainer from "pages/Editor/commons/EditorWrapperContainer";
|
|
|
|
|
|
|
|
|
|
import Sidebar from "./routers/Sidebar";
|
|
|
|
|
import LeftPane from "./routers/LeftPane";
|
|
|
|
|
import MainPane from "./routers/MainPane";
|
|
|
|
|
import RightPane from "./routers/RightPane";
|
|
|
|
|
import { ProtectedCallout } from "../components/ProtectedCallout";
|
|
|
|
|
import { useGridLayoutTemplate } from "./hooks/useGridLayoutTemplate";
|
|
|
|
|
import { Areas } from "./constants";
|
2025-02-20 15:04:06 +00:00
|
|
|
import {
|
|
|
|
|
GridContainer,
|
|
|
|
|
LayoutContainer,
|
|
|
|
|
} from "IDE/Components/LayoutComponents";
|
2025-01-05 10:21:23 +00:00
|
|
|
|
|
|
|
|
function GitProtectedBranchCallout() {
|
|
|
|
|
const isGitModEnabled = useGitModEnabled();
|
|
|
|
|
const isProtectedMode = useGitProtectedMode();
|
|
|
|
|
|
|
|
|
|
if (isGitModEnabled) {
|
|
|
|
|
return <GitProtectedBranchCalloutNew />;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isProtectedMode) {
|
|
|
|
|
return <ProtectedCallout />;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2024-09-09 10:55:50 +00:00
|
|
|
|
2024-12-20 11:57:53 +00:00
|
|
|
export const StaticLayout = React.memo(() => {
|
2024-09-09 10:55:50 +00:00
|
|
|
const { areas, columns } = useGridLayoutTemplate();
|
|
|
|
|
|
|
|
|
|
const isSidebarVisible = columns[0] !== "0px";
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
2025-01-05 10:21:23 +00:00
|
|
|
<GitProtectedBranchCallout />
|
2024-09-09 10:55:50 +00:00
|
|
|
<EditorWrapperContainer>
|
|
|
|
|
<GridContainer
|
|
|
|
|
style={{
|
|
|
|
|
gridTemplateRows: "100%",
|
|
|
|
|
gridTemplateAreas: areas
|
|
|
|
|
.map((area) => `"${area.join(" ")}"`)
|
|
|
|
|
.join("\n"),
|
|
|
|
|
gridTemplateColumns: columns.join(" "),
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<LayoutContainer name={Areas.Sidebar}>
|
|
|
|
|
{isSidebarVisible ? <Sidebar /> : <div />}
|
|
|
|
|
</LayoutContainer>
|
|
|
|
|
<LayoutContainer name={Areas.Explorer}>
|
|
|
|
|
<LeftPane />
|
|
|
|
|
</LayoutContainer>
|
|
|
|
|
<LayoutContainer name={Areas.WidgetEditor}>
|
|
|
|
|
<MainPane id="app-body" />
|
|
|
|
|
</LayoutContainer>
|
|
|
|
|
<LayoutContainer name={Areas.PropertyPane}>
|
|
|
|
|
<RightPane />
|
|
|
|
|
</LayoutContainer>
|
|
|
|
|
</GridContainer>
|
|
|
|
|
</EditorWrapperContainer>
|
|
|
|
|
<BottomBar />
|
|
|
|
|
</>
|
|
|
|
|
);
|
2024-12-20 11:57:53 +00:00
|
|
|
});
|