From 4ae839f9e6b842fab51d3e0fdb91a9c6fd664dce Mon Sep 17 00:00:00 2001 From: Daniel Heppner Date: Wed, 6 Dec 2023 14:41:12 -0800 Subject: [PATCH] fix layout issue in some cards --- lib/components/viewers/nearby/rental-station.tsx | 4 ++-- lib/components/viewers/nearby/stop.tsx | 6 ++++-- lib/components/viewers/nearby/styled.tsx | 10 ++++++++-- lib/components/viewers/nearby/vehicle-parking.tsx | 6 ++++-- lib/components/viewers/nearby/vehicle-rent.tsx | 8 ++++---- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/lib/components/viewers/nearby/rental-station.tsx b/lib/components/viewers/nearby/rental-station.tsx index 4abe7259b..16103d171 100644 --- a/lib/components/viewers/nearby/rental-station.tsx +++ b/lib/components/viewers/nearby/rental-station.tsx @@ -8,7 +8,7 @@ import * as mapActions from '../../../actions/map' import { FormattedMessage } from 'react-intl' import { IconWithText } from '../../util/styledIcon' -import { Card, CardBody, CardHeader, CardSubheader } from './styled' +import { Card, CardBody, CardHeader, CardSubheader, CardTitle } from './styled' import { useMap } from 'react-map-gl' @@ -26,7 +26,7 @@ const RentalStation = ({ companies, place, zoomToPlace }: Props) => { return ( zoomToPlace(map, place)}> - {place.name} + {place.name} {company || ( diff --git a/lib/components/viewers/nearby/stop.tsx b/lib/components/viewers/nearby/stop.tsx index d6a2b3125..ddb4efbc3 100644 --- a/lib/components/viewers/nearby/stop.tsx +++ b/lib/components/viewers/nearby/stop.tsx @@ -4,7 +4,6 @@ import { format } from 'date-fns-tz' import { FormattedMessage, useIntl } from 'react-intl' import { InfoCircle } from '@styled-icons/fa-solid/InfoCircle' import { Place, TransitOperator } from '@opentripplanner/types' -import { Search } from '@styled-icons/fa-solid/Search' import { useMap } from 'react-map-gl' import coreUtils from '@opentripplanner/core-utils' import dateFnsUSLocale from 'date-fns/locale/en-US' @@ -18,6 +17,7 @@ import { Card, CardBody, CardHeader, + CardTitle, PatternRowContainer, StyledAlert } from './styled' @@ -178,7 +178,9 @@ const Stop = ({ return ( - {stopData.name} + + {stopData.name} +
diff --git a/lib/components/viewers/nearby/styled.tsx b/lib/components/viewers/nearby/styled.tsx index 696216bed..6ccf91919 100644 --- a/lib/components/viewers/nearby/styled.tsx +++ b/lib/components/viewers/nearby/styled.tsx @@ -33,16 +33,22 @@ export const Card = styled.div` ` export const CardHeader = styled.div` - font-size: 22px; padding: 1rem 1.2rem; - font-weight: 600; display: flex; + flex-direction: column; +` + +export const CardTitle = styled.p` + font-weight: 600; + font-size: 22px; + margin: 0; ` export const CardSubheader = styled.p` font-size: 16px; font-weight: 400; color: #444; + margin: 0; ` export const CardBody = styled.div` diff --git a/lib/components/viewers/nearby/vehicle-parking.tsx b/lib/components/viewers/nearby/vehicle-parking.tsx index 6a457e3fd..34cc240ae 100644 --- a/lib/components/viewers/nearby/vehicle-parking.tsx +++ b/lib/components/viewers/nearby/vehicle-parking.tsx @@ -8,7 +8,7 @@ import { useMap } from 'react-map-gl' import * as mapActions from '../../../actions/map' -import { Card, CardBody, CardHeader, CardSubheader } from './styled' +import { Card, CardBody, CardHeader, CardSubheader, CardTitle } from './styled' import FromToLocationPicker from '@opentripplanner/from-to-location-picker' @@ -31,7 +31,9 @@ const VehicleParking = ({ place, setLocation, zoomToPlace }: Props) => { return ( zoomToPlace(map, place)}> - {place.name} + + {place.name} + Park and Ride diff --git a/lib/components/viewers/nearby/vehicle-rent.tsx b/lib/components/viewers/nearby/vehicle-rent.tsx index f27c6deb7..162ff1f64 100644 --- a/lib/components/viewers/nearby/vehicle-rent.tsx +++ b/lib/components/viewers/nearby/vehicle-rent.tsx @@ -12,7 +12,7 @@ import React, { Suspense } from 'react' import * as mapActions from '../../../actions/map' -import { Card, CardBody, CardHeader } from './styled' +import { Card, CardBody, CardHeader, CardTitle } from './styled' import { IconWithText } from '../../util/styledIcon' type VehicleFormFactor = @@ -93,8 +93,6 @@ const Vehicle = ({ } const getStationIcon = () => { const CompanyIcon = getCompanyIcon(vehicle.network) - console.log(CompanyIcon) - console.log(vehicle.network) return CompanyIcon ? ( {company}}> @@ -106,7 +104,9 @@ const Vehicle = ({ return ( zoomToPlace(map, vehicle)}> - {company} + + {company} +
{vehicle.name}