Skip to content

Commit

Permalink
Merge pull request #5175 from HSLdevcom/stop-page-folder
Browse files Browse the repository at this point in the history
Add folder for stop page components
  • Loading branch information
partisaani authored Nov 25, 2024
2 parents 6f53889 + cb7f62e commit 0c4149a
Show file tree
Hide file tree
Showing 40 changed files with 110 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { FormattedMessage } from 'react-intl';
import { configShape } from '../util/shapes';
import { durationToString } from '../util/timeUtils';
import { isKeyboardSelectionEvent } from '../util/browser';
import Icon from './Icon';
import { configShape } from '../../util/shapes';
import { durationToString } from '../../util/timeUtils';
import { isKeyboardSelectionEvent } from '../../util/browser';
import Icon from '../Icon';

export default function StopInfo(
{ intermediateStopCount, toggleFunction, duration, showIntermediateStops },
Expand Down
2 changes: 1 addition & 1 deletion app/component/itinerary/TransitLeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { shouldShowFareInfo } from '../../util/fareUtils';
import { AlertEntityType, AlertSeverityLevelType } from '../../constants';
import { legShape, configShape } from '../../util/shapes';
import ZoneIcon from '../ZoneIcon';
import StopInfo from '../StopInfo';
import StopInfo from './StopInfo';
import InterlineInfo from './InterlineInfo';
import AlternativeLegsInfo from './AlternativeLegsInfo';
import LegInfo from './LegInfo';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import moment from 'moment';
import { intlShape } from 'react-intl';

import Select from 'react-select';
import Icon from './Icon';
import Icon from '../Icon';

function DateSelect(props, context) {
const [isMenuOpen, setIsMenuOpen] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import intersection from 'lodash/intersection';
import { FormattedMessage, intlShape } from 'react-intl';
import cx from 'classnames';
import Modal from '@hsl-fi/modal';
import Icon from './Icon';
import routeCompare from '../util/route-compare';
import withBreakpoint from '../util/withBreakpoint';
import { isKeyboardSelectionEvent } from '../util/browser';
import { getRouteMode } from '../util/modeUtils';
import { stopShape } from '../util/shapes';
import Icon from '../Icon';
import routeCompare from '../../util/route-compare';
import withBreakpoint from '../../util/withBreakpoint';
import { isKeyboardSelectionEvent } from '../../util/browser';
import { getRouteMode } from '../../util/modeUtils';
import { stopShape } from '../../util/shapes';

class FilterTimeTableModal extends React.Component {
static propTypes = {
Expand Down
12 changes: 6 additions & 6 deletions app/component/StopAlerts.js → app/component/stop/StopAlerts.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import { intlShape } from 'react-intl';
import { uniq } from 'lodash';
import AlertList from './AlertList';
import AlertList from '../AlertList';
import {
getCancelationsForStop,
getAlertsForObject,
getServiceAlertsForStation,
} from '../util/alertUtils';
import { getRouteMode } from '../util/modeUtils';
import { epochToTime } from '../util/timeUtils';
import { stopShape, configShape } from '../util/shapes';
import { AlertSeverityLevelType, AlertEntityType } from '../constants';
} from '../../util/alertUtils';
import { getRouteMode } from '../../util/modeUtils';
import { epochToTime } from '../../util/timeUtils';
import { stopShape, configShape } from '../../util/shapes';
import { AlertSeverityLevelType, AlertEntityType } from '../../constants';

export const isRelevantEntity = (entity, stopIds, routeIds) =>
// eslint-disable-next-line no-underscore-dangle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { createFragmentContainer, graphql } from 'react-relay';
import { stopShape } from '../util/shapes';
import { stopShape } from '../../util/shapes';
import StopAlerts from './StopAlerts';

const StopAlertsContainer = ({ stop }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import PropTypes from 'prop-types';
import React from 'react';
import { intlShape } from 'react-intl';
import { matchShape } from 'found';
import { stopShape, stationShape } from '../util/shapes';
import CardHeader from './CardHeader';
import { getJson } from '../util/xhrPromise';
import { saveSearch } from '../action/SearchActions';
import { isIOS } from '../util/browser';
import LazilyLoad, { importLazy } from './LazilyLoad';
import { stopShape, stationShape } from '../../util/shapes';
import CardHeader from '../CardHeader';
import { getJson } from '../../util/xhrPromise';
import { saveSearch } from '../../action/SearchActions';
import { isIOS } from '../../util/browser';
import LazilyLoad, { importLazy } from '../LazilyLoad';

const modules = {
FavouriteStopContainer: () => importLazy(import('./FavouriteStopContainer')),
FavouriteStopContainer: () => importLazy(import('../FavouriteStopContainer')),
};

class StopCardHeader extends React.Component {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ import { createRefetchContainer, graphql } from 'react-relay';
import connectToStores from 'fluxible-addons-react/connectToStores';
import { FormattedMessage, intlShape } from 'react-intl';
import { matchShape, routerShape, RedirectException } from 'found';
import { configShape, errorShape, relayShape, stopShape } from '../util/shapes';
import DepartureListContainer from './DepartureListContainer';
import Loading from './Loading';
import Icon from './Icon';
import ScrollableWrapper from './ScrollableWrapper';
import { isBrowser } from '../util/browser';
import { PREFIX_STOPS } from '../util/path';
import {
configShape,
errorShape,
relayShape,
stopShape,
} from '../../util/shapes';
import DepartureListContainer from '../DepartureListContainer';
import Loading from '../Loading';
import Icon from '../Icon';
import ScrollableWrapper from '../ScrollableWrapper';
import { isBrowser } from '../../util/browser';
import { PREFIX_STOPS } from '../../util/path';

class StopPageContent extends React.Component {
static propTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import getContext from 'recompose/getContext';
import compose from 'recompose/compose';

import StopCardHeaderContainer from './StopCardHeaderContainer';
import withBreakpoint from '../util/withBreakpoint';
import withBreakpoint from '../../util/withBreakpoint';

const StopPageHeader = compose(
withBreakpoint,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import PropTypes from 'prop-types';
import React from 'react';
import { createFragmentContainer, graphql } from 'react-relay';
import { configShape } from '../util/shapes';
import StopPageMap from './map/StopPageMap';
import { configShape } from '../../util/shapes';
import StopPageMap from '../map/StopPageMap';

function StopPageMapContainer({ stop }) {
if (!stop) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { createFragmentContainer, graphql } from 'react-relay';
import compose from 'recompose/compose';
import getContext from 'recompose/getContext';
import mapProps from 'recompose/mapProps';
import { configShape } from '../util/shapes';
import { configShape } from '../../util/shapes';

import { generateMetaData } from '../util/metaUtils';
import { generateMetaData } from '../../util/metaUtils';

const StopPageMeta = compose(
getContext({ config: configShape, intl: intlShape }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import { createFragmentContainer, graphql } from 'react-relay';
import { alertShape } from '../util/shapes';
import { alertShape } from '../../util/shapes';
import StopPageTabs from './StopPageTabs';

function StopPageTabContainer({ children, stop }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ import cx from 'classnames';
import React, { useState, useRef } from 'react';
import { FormattedMessage } from 'react-intl';
import { matchShape } from 'found';
import { stopShape } from '../util/shapes';
import { AlertSeverityLevelType } from '../constants';
import { stopShape } from '../../util/shapes';
import { AlertSeverityLevelType } from '../../constants';
import {
getCancelationsForStop,
getAlertsForObject,
getServiceAlertsForStation,
getActiveAlertSeverityLevel,
} from '../util/alertUtils';
import withBreakpoint from '../util/withBreakpoint';
import { addAnalyticsEvent } from '../util/analyticsUtils';
import { unixTime } from '../util/timeUtils';
} from '../../util/alertUtils';
import withBreakpoint from '../../util/withBreakpoint';
import { addAnalyticsEvent } from '../../util/analyticsUtils';
import { unixTime } from '../../util/timeUtils';
import {
PREFIX_DISRUPTION,
PREFIX_ROUTES,
PREFIX_STOPS,
PREFIX_TERMINALS,
PREFIX_TIMETABLE,
} from '../util/path';
import Icon from './Icon';
} from '../../util/path';
import Icon from '../Icon';

const Tab = {
Disruptions: PREFIX_DISRUPTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';
import PropTypes from 'prop-types';
import { createRefetchContainer, graphql } from 'react-relay';
import { matchShape, routerShape } from 'found';
import { unixTime, unixToYYYYMMDD } from '../util/timeUtils';
import { configShape, relayShape } from '../util/shapes';
import { prepareServiceDay } from '../util/dateParamUtils';
import { unixTime, unixToYYYYMMDD } from '../../util/timeUtils';
import { configShape, relayShape } from '../../util/shapes';
import { prepareServiceDay } from '../../util/dateParamUtils';
import TimetableContainer from './TimetableContainer';

class StopTimetablePage extends React.Component {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { createFragmentContainer, graphql } from 'react-relay';
import { stationShape } from '../util/shapes';
import { stationShape } from '../../util/shapes';
import StopAlerts from './StopAlerts';

const TerminalAlertsContainer = ({ station }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { createRefetchContainer, graphql } from 'react-relay';
import connectToStores from 'fluxible-addons-react/connectToStores';
import { FormattedMessage } from 'react-intl';
import { routerShape, RedirectException } from 'found';
import DepartureListContainer from './DepartureListContainer';
import Loading from './Loading';
import Icon from './Icon';
import ScrollableWrapper from './ScrollableWrapper';
import { isBrowser } from '../util/browser';
import { PREFIX_TERMINALS } from '../util/path';
import { stationShape, errorShape, relayShape } from '../util/shapes';
import DepartureListContainer from '../DepartureListContainer';
import Loading from '../Loading';
import Icon from '../Icon';
import ScrollableWrapper from '../ScrollableWrapper';
import { isBrowser } from '../../util/browser';
import { PREFIX_TERMINALS } from '../../util/path';
import { stationShape, errorShape, relayShape } from '../../util/shapes';

class TerminalPageContent extends React.Component {
static propTypes = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import PropTypes from 'prop-types';
import React from 'react';
import { createFragmentContainer, graphql } from 'react-relay';
import { configShape } from '../util/shapes';
import StopPageMap from './map/StopPageMap';
import { configShape } from '../../util/shapes';
import StopPageMap from '../map/StopPageMap';

const TerminalPageMapContainer = ({ station }) => {
if (!station) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { createFragmentContainer, graphql } from 'react-relay';
import compose from 'recompose/compose';
import getContext from 'recompose/getContext';
import mapProps from 'recompose/mapProps';
import { configShape } from '../util/shapes';
import { configShape } from '../../util/shapes';

import { generateMetaData } from '../util/metaUtils';
import { generateMetaData } from '../../util/metaUtils';

const TerminalPageMeta = compose(
getContext({ config: configShape, intl: intlShape }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import { createFragmentContainer, graphql } from 'react-relay';
import { alertShape } from '../util/shapes';
import { alertShape } from '../../util/shapes';
import StopPageTabs from './StopPageTabs';

function TerminalPageTabContainer({ children, station }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';
import PropTypes from 'prop-types';
import { createRefetchContainer, graphql } from 'react-relay';
import { matchShape, routerShape } from 'found';
import { configShape, relayShape } from '../util/shapes';
import { unixTime, unixToYYYYMMDD } from '../util/timeUtils';
import { prepareServiceDay } from '../util/dateParamUtils';
import { configShape, relayShape } from '../../util/shapes';
import { unixTime, unixToYYYYMMDD } from '../../util/timeUtils';
import { prepareServiceDay } from '../../util/dateParamUtils';
import TimetableContainer from './TimetableContainer';

class TerminalTimetablePage extends React.Component {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import PropTypes from 'prop-types';
import React from 'react';
import { FormattedMessage } from 'react-intl';
import uniqBy from 'lodash/uniqBy';
import Icon from './Icon';
import { ExtendedRouteTypes } from '../constants';
import { addAnalyticsEvent } from '../util/analyticsUtils';
import { stopShape } from '../util/shapes';
import Icon from '../Icon';
import { ExtendedRouteTypes } from '../../constants';
import { addAnalyticsEvent } from '../../util/analyticsUtils';
import { stopShape } from '../../util/shapes';

const MAX_ROUTEFILTER_LEN = 13;

Expand Down
18 changes: 9 additions & 9 deletions app/component/Timetable.js → app/component/stop/Timetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import padStart from 'lodash/padStart';
import { FormattedMessage, intlShape } from 'react-intl';
import { matchShape, routerShape, RedirectException } from 'found';
import cx from 'classnames';
import { configShape } from '../util/shapes';
import Icon from './Icon';
import { configShape } from '../../util/shapes';
import Icon from '../Icon';
import FilterTimeTableModal from './FilterTimeTableModal';
import TimeTableOptionsPanel from './TimeTableOptionsPanel';
import TimetableRow from './TimetableRow';
import { RealtimeStateType } from '../constants';
import SecondaryButton from './SecondaryButton';
import { addAnalyticsEvent } from '../util/analyticsUtils';
import { RealtimeStateType } from '../../constants';
import SecondaryButton from '../SecondaryButton';
import { addAnalyticsEvent } from '../../util/analyticsUtils';
import DateSelect from './DateSelect';
import ScrollableWrapper from './ScrollableWrapper';
import { replaceQueryParams } from '../util/queryUtils';
import { isBrowser } from '../util/browser';
import { PREFIX_STOPS } from '../util/path';
import ScrollableWrapper from '../ScrollableWrapper';
import { replaceQueryParams } from '../../util/queryUtils';
import { isBrowser } from '../../util/browser';
import { PREFIX_STOPS } from '../../util/path';

const mapStopTimes = stoptimesObject =>
stoptimesObject
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0c4149a

Please sign in to comment.