From f31f60df534a140de7791b500adf7301a2d6ac87 Mon Sep 17 00:00:00 2001 From: moshe vilner Date: Sun, 29 Oct 2023 07:01:01 +0200 Subject: [PATCH] refactor: replace widget by antd Card component --- src/pages/GapsPatternsPage.tsx | 63 ++++++++++++++------------ src/pages/dashboard/DashboardPage.scss | 7 +-- src/pages/dashboard/DashboardPage.tsx | 14 +++--- 3 files changed, 41 insertions(+), 43 deletions(-) diff --git a/src/pages/GapsPatternsPage.tsx b/src/pages/GapsPatternsPage.tsx index dcbbe50e..4be61858 100644 --- a/src/pages/GapsPatternsPage.tsx +++ b/src/pages/GapsPatternsPage.tsx @@ -1,7 +1,7 @@ import React, { useContext, useEffect, useState } from 'react' import './GapsPatternsPage.scss' import { Moment } from 'moment' -import { Skeleton, Spin } from 'antd' +import { Card, Skeleton, Spin } from 'antd' import moment from 'moment/moment' import { useDate } from './components/DateTimePicker' import { PageContainer } from './components/PageContainer' @@ -205,36 +205,39 @@ const GapsPatternsPage = () => { setLineNumber={(number) => setSearch((current) => ({ ...current, lineNumber: number }))} /> + - - {routesIsLoading && ( - - - )} - {!routesIsLoading && - routes && - (routes.length === 0 ? ( - {TEXTS.line_not_found} - ) : ( - <> - setSearch((current) => ({ ...current, routeKey: key }))} - /> - - route.key === routeKey)?.lineRef || 0} - operatorRef={operatorId || ''} - fromDate={startDate} - toDate={endDate} - /> - - - ))} - + + {routesIsLoading && ( + + + )} + {!routesIsLoading && + routes && + (routes.length === 0 ? ( + {TEXTS.line_not_found} + ) : ( + <> + setSearch((current) => ({ ...current, routeKey: key }))} + /> + + ))} + + + + + route.key === routeKey)?.lineRef || 0} + operatorRef={operatorId || ''} + fromDate={startDate} + toDate={endDate} + /> + ) diff --git a/src/pages/dashboard/DashboardPage.scss b/src/pages/dashboard/DashboardPage.scss index c5f4a817..79f4027e 100644 --- a/src/pages/dashboard/DashboardPage.scss +++ b/src/pages/dashboard/DashboardPage.scss @@ -8,12 +8,7 @@ } .widget { - border: 1px solid #e0e0e0; - border-radius: 4px; - padding: 20px; - box-sizing: border-box; - margin-bottom: 20px; - background-color: white; + .chart { height: 400px; diff --git a/src/pages/dashboard/DashboardPage.tsx b/src/pages/dashboard/DashboardPage.tsx index 29a3c967..cc69e3d9 100644 --- a/src/pages/dashboard/DashboardPage.tsx +++ b/src/pages/dashboard/DashboardPage.tsx @@ -10,7 +10,7 @@ import LinesHbarChart from './LineHbarChart/LinesHbarChart' import { FormControlLabel, Switch, Tooltip } from '@mui/material' import OperatorSelector from 'src/pages/components/OperatorSelector' import { useDate } from '../components/DateTimePicker' -import { Skeleton } from 'antd' +import { Card, Skeleton } from 'antd' import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 import { Label } from '../components/Label' import { DateSelector } from '../components/DateSelector' @@ -120,7 +120,7 @@ const DashboardPage = () => { -
+

{TEXTS.dashboard_page_title} { ) : ( )} -

+
{ /> -
+

{TEXTS.worst_lines_page_title}

{lineDataLoading ? ( @@ -155,17 +155,17 @@ const DashboardPage = () => { operators_whitelist={['אלקטרה אפיקים', 'דן', 'מטרופולין', 'קווים', 'אגד']} /> )} -
+
-
+

{TEXTS.dashboard_page_graph_title}

{loadingGrap ? ( ) : ( )} -
+