Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/client/src/IDE/Components/LayoutComponents.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import styled from "styled-components";

export const GridContainer = styled.div`
display: grid;
width: 100vw;
height: 100%;
`;

export const LayoutContainer = styled.div<{ name: string }>`
position: relative;
grid-area: ${(props) => props.name};
`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import React from "react";
import JSLibrariesSection from "pages/AppIDE/components/LibrariesList/JSLibrariesSection";
import { IDESidePaneWrapper } from "IDE";

const LibrarySidePane = () => {
const LibrarySidePane = (props: { showAddButton?: boolean }) => {
const { showAddButton = true } = props;

return (
<IDESidePaneWrapper>
<JSLibrariesSection />
<JSLibrariesSection showAddButton={showAddButton} />
</IDESidePaneWrapper>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/ce/pages/common/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from "constants/routes";
import Navigation from "pages/AppViewer/Navigation";
import type { RouteComponentProps } from "react-router";
import { Header as AppIDEHeader } from "pages/AppIDE/layout/components/Header";
import { Header as AppIDEHeader } from "pages/AppIDE/layouts/components/Header";

export type Props = RouteComponentProps;

Expand Down
2 changes: 1 addition & 1 deletion app/client/src/pages/AppIDE/AppIDE.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { RouteComponentProps } from "react-router-dom";
import { withRouter } from "react-router-dom";
import type { BuilderRouteParams } from "constants/routes";
import type { AppState } from "ee/reducers";
import IDE from "./layout";
import IDE from "./layouts";
import {
getCurrentApplicationId,
getIsEditorInitialized,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { useSelector } from "react-redux";
import { animated, useTransition } from "react-spring";
import { LibraryEntity } from "pages/Editor/Explorer/Libraries";

function JSLibrariesSection() {
function JSLibrariesSection(props: { showAddButton: boolean }) {
const { showAddButton } = props;
const libraries = useSelector(selectLibrariesForExplorer);
const transitions = useTransition(libraries, {
keys: (lib) => lib.name,
Expand All @@ -16,7 +17,10 @@ function JSLibrariesSection() {
leave: { opacity: 1 },
});

const rightIcon = useMemo(() => <AddLibraryPopover />, []);
const rightIcon = useMemo(
() => (showAddButton ? <AddLibraryPopover /> : null),
[showAddButton],
);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ const getMockStore = (override: Record<string, any> = {}): any => {
});
};

jest.mock("../../layout/routers/MainPane/MainPane.tsx", () => () => <div />);
jest.mock("../../layout/routers/LeftPane", () => () => <div />);
jest.mock("../../layout/routers/RightPane", () => () => <div />);
jest.mock("../../layout/routers/Sidebar", () => () => <div />);
jest.mock("../../layouts/routers/MainPane/MainPane.tsx", () => () => <div />);
jest.mock("../../layouts/routers/LeftPane", () => () => <div />);
jest.mock("../../layouts/routers/RightPane", () => () => <div />);
jest.mock("../../layouts/routers/Sidebar", () => () => <div />);
jest.mock("../../../../components/BottomBar", () => () => <div />);

const dispatch = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import styled from "styled-components";

import {
useGitModEnabled,
Expand All @@ -16,6 +15,10 @@ import RightPane from "./routers/RightPane";
import { ProtectedCallout } from "../components/ProtectedCallout";
import { useGridLayoutTemplate } from "./hooks/useGridLayoutTemplate";
import { Areas } from "./constants";
import {
GridContainer,
LayoutContainer,
} from "IDE/Components/LayoutComponents";

function GitProtectedBranchCallout() {
const isGitModEnabled = useGitModEnabled();
Expand All @@ -32,17 +35,6 @@ function GitProtectedBranchCallout() {
return null;
}

const GridContainer = styled.div`
display: grid;
width: 100vw;
height: 100%;
`;

const LayoutContainer = styled.div<{ name: string }>`
position: relative;
grid-area: ${(props) => props.name};
`;

export const StaticLayout = React.memo(() => {
const { areas, columns } = useGridLayoutTemplate();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
import { MockCanvas } from "test/testMockedWidgets";
import { act, fireEvent, render, waitFor } from "test/testUtils";
import * as widgetRenderUtils from "utils/widgetRenderUtils";
import IDE from "pages/AppIDE/layout";
import IDE from "pages/AppIDE/layouts";
import GlobalHotKeys from "./GlobalHotKeys";
import * as widgetSelectionsActions from "actions/widgetSelectionActions";
import { SelectionRequestType } from "sagas/WidgetSelectUtils";
Expand Down
2 changes: 1 addition & 1 deletion app/client/test/testMockedWidgets.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { APP_MODE } from "entities/App";
import AppViewerPageContainer from "pages/AppViewer/AppViewerPageContainer";
import Canvas from "pages/Editor/Canvas";
import IDE from "pages/AppIDE/layout";
import IDE from "pages/AppIDE/layouts";
import React from "react";
import { useSelector } from "react-redux";
import { getCanvasWidgetsStructure } from "ee/selectors/entitiesSelector";
Expand Down
Loading