From 82e36c05f6689fc765fdde5e7aea5c710586de03 Mon Sep 17 00:00:00 2001 From: Sudheer Salavadi Date: Fri, 28 Jun 2024 20:58:36 +0530 Subject: [PATCH] UI Improvements --- .../DashboardHeader/DashboardHeader.tsx | 28 ++++++++++++------- .../DashboardList/DashboardList.tsx | 17 +++++++++-- .../components/FilterSeries/AddStepButton.tsx | 2 +- .../shared/Breadcrumb/BackButton.tsx | 20 +++++++++++++ .../app/components/ui/PageTitle/PageTitle.tsx | 2 +- 5 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 frontend/app/components/shared/Breadcrumb/BackButton.tsx diff --git a/frontend/app/components/Dashboard/components/DashboardHeader/DashboardHeader.tsx b/frontend/app/components/Dashboard/components/DashboardHeader/DashboardHeader.tsx index f0cc31b9b..3a9fbeff5 100644 --- a/frontend/app/components/Dashboard/components/DashboardHeader/DashboardHeader.tsx +++ b/frontend/app/components/Dashboard/components/DashboardHeader/DashboardHeader.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import Breadcrumb from 'Shared/Breadcrumb'; +//import {Breadcrumb} from 'Shared/Breadcrumb'; +import BackButton from '../../../shared/Breadcrumb/BackButton'; import {withSiteId} from 'App/routes'; import {withRouter, RouteComponentProps} from 'react-router-dom'; import {Button, PageTitle, confirm, Tooltip} from 'UI'; @@ -61,17 +62,24 @@ function DashboardHeader(props: Props) { closeHandler={() => setShowEditModal(false)} focusTitle={focusTitle} /> - {/* */} +
+ + + + {/* */} + + + = [ { title: 'Title', @@ -93,14 +98,22 @@ function DashboardList({ siteId }: { siteId: string }) { ); const emptyImage = dashboardsSearch !== '' ? ICONS.NO_RESULTS : ICONS.NO_DASHBOARDS; + const imageDimensions = dashboardsSearch !== '' ? searchImageDimensions : defaultImageDimensions; return ( list.length === 0 && !dashboardStore.filter.showMine ? ( +
} - imageStyle={{ height: 300 }} + image={} + imageStyle={{ + width: imageDimensions.width, + height: imageDimensions.height, + margin: 'auto', + padding: '2rem 0' + }} description={emptyDescription} /> +
) : ( - diff --git a/frontend/app/components/shared/Breadcrumb/BackButton.tsx b/frontend/app/components/shared/Breadcrumb/BackButton.tsx new file mode 100644 index 000000000..0eb961a84 --- /dev/null +++ b/frontend/app/components/shared/Breadcrumb/BackButton.tsx @@ -0,0 +1,20 @@ +import React from 'react'; +import { Button } from 'antd'; +import { useHistory } from 'react-router-dom'; +import { LeftOutlined } from '@ant-design/icons'; + +function BackButton({ siteId }) { + const history = useHistory(); + + const handleBackClick = () => { + history.goBack(); + }; + + return ( + + ); +} + +export default BackButton; diff --git a/frontend/app/components/ui/PageTitle/PageTitle.tsx b/frontend/app/components/ui/PageTitle/PageTitle.tsx index 50047ac03..b68e21952 100644 --- a/frontend/app/components/ui/PageTitle/PageTitle.tsx +++ b/frontend/app/components/ui/PageTitle/PageTitle.tsx @@ -14,7 +14,7 @@ function PageTitle({ title, actionButton = null, subTitle = '', className = '', return (
-

+

{title}

{ actionButton &&
{actionButton}
}