From 5b73ffdbaad3e7c964fd0130eeea3e9c8bca246b Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Fri, 29 Dec 2023 11:35:25 +0530 Subject: [PATCH] chore: Page Pane visual revisions (#29927) Further revisions on visual elements marked in fixes #29921 ## Summary by CodeRabbit - **New Features** - Introduced `SegmentAddHeader` and `SegmentedHeader` components for improved navigation and functionality in the editor pane. - **Enhancements** - Updated the editor pane layout and styling for better visual appeal and usability. - Enhanced button functionality to streamline user interactions within the editor. - **Style Updates** - Adjusted various styling properties across components, including padding, gap, and flex attributes for a more cohesive design language. - **Bug Fixes** - Fixed button logic and event handling functions to ensure smoother user experience. --- .../pages/Editor/IDE/EditorPane/AddQuery.tsx | 37 +++----- .../Editor/IDE/EditorPane/AddWidgets.tsx | 31 ++---- .../IDE/EditorPane/EditorPaneSegments.tsx | 83 +--------------- .../Editor/IDE/EditorPane/EmptyState.tsx | 2 +- .../Editor/IDE/EditorPane/JS_Section.tsx | 12 +-- .../pages/Editor/IDE/EditorPane/ListQuery.tsx | 19 ++-- .../Editor/IDE/EditorPane/ListWidgets.tsx | 12 +-- .../components/SegmentAddHeader.tsx | 39 ++++++++ .../EditorPane/components/SegmentedHeader.tsx | 94 +++++++++++++++++++ .../pages/Editor/IDE/LeftPane/PaneHeader.tsx | 1 + 10 files changed, 174 insertions(+), 156 deletions(-) create mode 100644 app/client/src/pages/Editor/IDE/EditorPane/components/SegmentAddHeader.tsx create mode 100644 app/client/src/pages/Editor/IDE/EditorPane/components/SegmentedHeader.tsx diff --git a/app/client/src/pages/Editor/IDE/EditorPane/AddQuery.tsx b/app/client/src/pages/Editor/IDE/EditorPane/AddQuery.tsx index d8a8c94ae8..a2165f8215 100644 --- a/app/client/src/pages/Editor/IDE/EditorPane/AddQuery.tsx +++ b/app/client/src/pages/Editor/IDE/EditorPane/AddQuery.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useMemo } from "react"; -import { Button, Flex, List, Text } from "design-system"; +import { Flex, List, Text } from "design-system"; import type { ListItemProps } from "design-system"; import { useDispatch, useSelector } from "react-redux"; import keyBy from "lodash/keyBy"; @@ -20,6 +20,7 @@ import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; import { getPagePermissions } from "selectors/editorSelectors"; import { FEATURE_FLAG } from "@appsmith/entities/FeatureFlag"; import { createMessage, PAGES_PANE_TEXTS } from "@appsmith/constants/messages"; +import SegmentAddHeader from "./components/SegmentAddHeader"; const StyledList = styled(List)` padding: 0; @@ -94,33 +95,19 @@ const AddQuery = () => { }, [pageId]); return ( - <> - - - {createMessage(PAGES_PANE_TEXTS.query_create_tab_title)} - - )} - + {Object.keys(files).map((key) => { return ( - + { }, [widgets]); return ( - + {widgets && widgets.children && widgets.children.length > 0 && canManagePages && ( - + )} - + {widgets?.children?.map((child) => ( string; + onCloseClick: () => void; +} + +const Container = styled(Flex)` + padding-right: var(--ads-v2-spaces-2); + background-color: var(--ads-v2-color-gray-50); +`; + +const SegmentAddHeader = (props: Props) => { + return ( + + + {createMessage(props.titleMessage)} + +