diff --git a/src/components/FeaturePanel/PublicTransport/route/Stops.tsx b/src/components/FeaturePanel/PublicTransport/route/Stops.tsx index ad84ed4e..d8079827 100644 --- a/src/components/FeaturePanel/PublicTransport/route/Stops.tsx +++ b/src/components/FeaturePanel/PublicTransport/route/Stops.tsx @@ -1,10 +1,11 @@ import Link from 'next/link'; import { Feature } from '../../../../services/types'; import { StationItem, StationsList } from './helpers'; -import { IconButton, Typography } from '@mui/material'; +import { Button, Typography } from '@mui/material'; import { t } from '../../../../services/intl'; import { getUrlOsmId } from '../../../../services/helpers'; -import TurnLeftIcon from '@mui/icons-material/TurnLeft'; +import ExpandLessIcon from '@mui/icons-material/ExpandLess'; +import ExpandMoreIcon from '@mui/icons-material/ChevronRight'; type ShowMoreLessButtonProps = { type: 'collapse' | 'expand'; @@ -17,72 +18,23 @@ const ShowMoreLessButton = ({ onClick, stopCount, }: ShowMoreLessButtonProps) => ( - - - - - {type === 'collapse' - ? t('publictransport.visible_stops', { - amount: stopCount - 2, - }) - : t('publictransport.hidden_stops', { - amount: stopCount - 2, - })} + + ); -const StationInner = ({ - stop, - stopCount, - onExpand, - onCollapse, -}: { - stop: Feature | 'collapse' | 'expand'; - stopCount: number; - onExpand: () => void; - onCollapse: () => void; -}) => { - if (stop === 'expand') { - return ( - - { - onExpand(); - }} - > - - - {t('publictransport.hidden_stops', { - amount: stopCount - 2, - })} - - ); - } - if (stop === 'collapse') { - return ( - - { - onCollapse(); - }} - > - {t('publictransport.visible_stops', { - amount: stopCount - 2, - })} - - ); - } - - return {stop.tags.name}; -}; - type Props = { stops: Feature[]; stopCount: number; @@ -97,12 +49,7 @@ export const Stops = ({ stops, stopCount, onExpand, onCollapse }: Props) => { {stops.map((stop, i) => ( <> - + {stop.tags.name} {i === 0 && (