diff --git a/src/pages/components/MapLayers/BusToolTip.tsx b/src/pages/components/MapLayers/BusToolTip.tsx index 1687f91b..72d9fdcb 100644 --- a/src/pages/components/MapLayers/BusToolTip.tsx +++ b/src/pages/components/MapLayers/BusToolTip.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react' -import { Point } from 'src/pages/RealtimeMapPage' +import { Point } from 'src/pages/realtimeMap' import { Button } from '@mui/material' import moment from 'moment-timezone' import './BusToolTip.scss' diff --git a/src/pages/components/utils/index.test.ts b/src/pages/components/utils/index.test.ts index 594e471e..f2efaee4 100644 --- a/src/pages/components/utils/index.test.ts +++ b/src/pages/components/utils/index.test.ts @@ -1,7 +1,7 @@ import { parseTime } from 'src/api/gapsService' import { HourlyData, sortByMode } from '.' import { GapsList } from 'src/model/gaps' -import { convertGapsToHourlyStruct as processData } from 'src/pages/useGapsList' +import { convertGapsToHourlyStruct as processData } from 'src/pages/gapsPatterns/useGapsList' describe('sortByMode', () => { it('when mode param is "hour" - should be sorted properly', () => { diff --git a/src/pages/GapsPage.tsx b/src/pages/gaps/index.tsx similarity index 88% rename from src/pages/GapsPage.tsx rename to src/pages/gaps/index.tsx index f7d7ca76..6c4af4b6 100644 --- a/src/pages/GapsPage.tsx +++ b/src/pages/gaps/index.tsx @@ -1,25 +1,25 @@ import { useContext, useEffect, useState } from 'react' -import { PageContainer } from './components/PageContainer' -import { Row } from './components/Row' -import { Label } from './components/Label' -import { TEXTS } from '../resources/texts' -import OperatorSelector from './components/OperatorSelector' -import LineNumberSelector from './components/LineSelector' -import { SearchContext } from '../model/pageState' -import { Gap, GapsList } from '../model/gaps' -import { getGapsAsync } from '../api/gapsService' +import { PageContainer } from '../components/PageContainer' +import { Row } from '../components/Row' +import { Label } from '../components/Label' +import { TEXTS } from '../../resources/texts' +import OperatorSelector from '../components/OperatorSelector' +import LineNumberSelector from '../components/LineSelector' +import { SearchContext } from '../../model/pageState' +import { Gap, GapsList } from '../../model/gaps' +import { getGapsAsync } from '../../api/gapsService' import { Spin } from 'antd' -import RouteSelector from './components/RouteSelector' -import { NotFound } from './components/NotFound' -import { getRoutesAsync } from '../api/gtfsService' +import RouteSelector from '../components/RouteSelector' +import { NotFound } from '../components/NotFound' +import { getRoutesAsync } from '../../api/gtfsService' import moment, { Moment } from 'moment' import styled from 'styled-components' import { useSessionStorage } from 'usehooks-ts' -import { DateSelector } from './components/DateSelector' +import { DateSelector } from '../components/DateSelector' import { FormControlLabel, Switch } from '@mui/material' import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 import { INPUT_SIZE } from 'src/resources/sizes' -import DisplayGapsPercentage from './components/DisplayGapsPercentage' +import DisplayGapsPercentage from '../components/DisplayGapsPercentage' function formatTime(time: Moment) { return time.format(TEXTS.time_format) diff --git a/src/pages/gapsPatterns/GapsPatternsPage.tsx b/src/pages/gapsPatterns/GapsPatternsPage.tsx index ae79391e..6ff0173c 100644 --- a/src/pages/gapsPatterns/GapsPatternsPage.tsx +++ b/src/pages/gapsPatterns/GapsPatternsPage.tsx @@ -29,7 +29,7 @@ import { ResponsiveContainer, } from 'recharts' import { mapColorByExecution } from '../components/utils' -import { useGapsList } from '../useGapsList' +import { useGapsList } from './useGapsList' import { DateSelector } from '../components/DateSelector' import { INPUT_SIZE } from 'src/resources/sizes' const { Title } = Typography diff --git a/src/pages/useGapsList.ts b/src/pages/gapsPatterns/useGapsList.ts similarity index 94% rename from src/pages/useGapsList.ts rename to src/pages/gapsPatterns/useGapsList.ts index 3b672b96..7bc6192b 100644 --- a/src/pages/useGapsList.ts +++ b/src/pages/gapsPatterns/useGapsList.ts @@ -1,8 +1,8 @@ import { useEffect, useState } from 'react' import { Moment } from 'moment' -import { getGapsAsync } from '../api/gapsService' +import { getGapsAsync } from '../../api/gapsService' -import { sortByMode, HourlyData } from './components/utils' +import { sortByMode, HourlyData } from '../components/utils' import { GapsList } from 'src/model/gaps' type HourlyDataList = HourlyData[] diff --git a/src/pages/RealtimeMapPage.tsx b/src/pages/realtimeMap/index.tsx similarity index 92% rename from src/pages/RealtimeMapPage.tsx rename to src/pages/realtimeMap/index.tsx index ab412d6d..db8e3aad 100644 --- a/src/pages/RealtimeMapPage.tsx +++ b/src/pages/realtimeMap/index.tsx @@ -8,17 +8,17 @@ import moment from 'moment' import getAgencyList, { Agency } from 'src/api/agencyList' import useVehicleLocations from 'src/api/useVehicleLocations' import { VehicleLocation } from 'src/model/vehicleLocation' -import './Map.scss' -import { DateSelector } from './components/DateSelector' -import MinuteSelector from './components/MinuteSelector' +import '../Map.scss' +import { DateSelector } from '../components/DateSelector' +import MinuteSelector from '../components/MinuteSelector' import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 -import { PageContainer } from './components/PageContainer' +import { PageContainer } from '../components/PageContainer' import { INPUT_SIZE } from 'src/resources/sizes' -import { Label } from './components/Label' -import { getColorByHashString } from './dashboard/AllLineschart/OperatorHbarChart/utils' -import createClusterCustomIcon from './components/utils/customCluster/customCluster' -import { TimeSelector } from './components/TimeSelector' -import { busIcon, busIconPath } from './components/utils/BusIcon' +import { Label } from '../components/Label' +import { getColorByHashString } from '../dashboard/AllLineschart/OperatorHbarChart/utils' +import createClusterCustomIcon from '../components/utils/customCluster/customCluster' +import { TimeSelector } from '../components/TimeSelector' +import { busIcon, busIconPath } from '../components/utils/BusIcon' import { BusToolTip } from 'src/pages/components/MapLayers/BusToolTip' const { Title } = Typography diff --git a/src/pages/SingleLineMapPage.tsx b/src/pages/singleLineMap/index.tsx similarity index 93% rename from src/pages/SingleLineMapPage.tsx rename to src/pages/singleLineMap/index.tsx index 6ec61c83..20559156 100644 --- a/src/pages/SingleLineMapPage.tsx +++ b/src/pages/singleLineMap/index.tsx @@ -9,20 +9,20 @@ import OperatorSelector from 'src/pages/components/OperatorSelector' import RouteSelector from 'src/pages/components/RouteSelector' import { INPUT_SIZE } from 'src/resources/sizes' import { TEXTS } from 'src/resources/texts' -import { SearchContext } from '../model/pageState' -import { NotFound } from './components/NotFound' -import { Point } from './RealtimeMapPage' +import { SearchContext } from '../../model/pageState' +import { NotFound } from '../components/NotFound' +import { Point } from '../realtimeMap' import Grid from '@mui/material/Unstable_Grid2' // Grid version 2 -import './Map.scss' +import '../Map.scss' import getAgencyList, { Agency } from 'src/api/agencyList' import { VehicleLocation } from 'src/model/vehicleLocation' -import { getColorByHashString } from './dashboard/AllLineschart/OperatorHbarChart/utils' -import { DateSelector } from './components/DateSelector' +import { getColorByHashString } from '../dashboard/AllLineschart/OperatorHbarChart/utils' +import { DateSelector } from '../components/DateSelector' import { CircularProgress } from '@mui/material' -import { FilterPositionsByStartTimeSelector } from './components/FilterPositionsByStartTimeSelector' -import { PageContainer } from './components/PageContainer' -import { busIcon, busIconPath } from './components/utils/BusIcon' +import { FilterPositionsByStartTimeSelector } from '../components/FilterPositionsByStartTimeSelector' +import { PageContainer } from '../components/PageContainer' +import { busIcon, busIconPath } from '../components/utils/BusIcon' import { BusToolTip } from 'src/pages/components/MapLayers/BusToolTip' interface Path { diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 3382a6c1..5ff9328d 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -3,10 +3,10 @@ import { Navigate, Route, Routes } from 'react-router-dom' import { lazy, Suspense } from 'react' const DashboardPage = lazy(() => import('../pages/dashboard/DashboardPage')) const TimelinePage = lazy(() => import('../pages/TimelinePage')) -const GapsPage = lazy(() => import('../pages/GapsPage')) +const GapsPage = lazy(() => import('../pages/gaps')) const GapsPatternsPage = lazy(() => import('../pages/gapsPatterns')) -const RealtimeMapPage = lazy(() => import('../pages/RealtimeMapPage')) -const SingleLineMapPage = lazy(() => import('../pages/SingleLineMapPage')) +const RealtimeMapPage = lazy(() => import('../pages/realtimeMap')) +const SingleLineMapPage = lazy(() => import('../pages/singleLineMap')) const About = lazy(() => import('../pages/About')) const Profile = lazy(() => import('../pages/Profile')) const BugReportForm = lazy(() => import('../pages/BugReportForm '))