Skip to content

Commit

Permalink
refactor: move page files to parent directories (#282)
Browse files Browse the repository at this point in the history
* refactor: move page files to parent directories
  • Loading branch information
shootermv authored Dec 7, 2023
1 parent 1a259f7 commit d6199a2
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/pages/components/MapLayers/BusToolTip.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/components/utils/index.test.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
28 changes: 14 additions & 14 deletions src/pages/GapsPage.tsx → src/pages/gaps/index.tsx
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/gapsPatterns/GapsPatternsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 '))
Expand Down

0 comments on commit d6199a2

Please sign in to comment.