Skip to content

Commit

Permalink
fix typescript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-heppner-ibigroup committed Dec 1, 2023
1 parent 248c2f2 commit 997e689
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/components/map/enhanced-stop-marker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class EnhancedStopMarker extends Component<Props> {
setViewedStop,
stop
} = this.props
if (stop.lat === undefined || stop.lon === undefined) return null
const { id, lat, lon } = stop
const displayedStopId = coreUtils.itinerary.getDisplayedStopId(stop)
if (!displayedStopId) return null
Expand All @@ -140,6 +141,7 @@ class EnhancedStopMarker extends Component<Props> {
activeStopId !== stop.id && (
<BaseMapStyled.MapOverlayPopup id={activeContentId}>
<StopPopup
// @ts-expect-error The lat and lon are checked for above, but TS doesn't detect this
entity={stop}
setLocation={setLocation}
setViewedStop={setViewedStop}
Expand Down
2 changes: 2 additions & 0 deletions lib/components/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Agency,
MapLocationActionArg,
Route,
Station,
Stop
} from '@opentripplanner/types'

Expand Down Expand Up @@ -93,6 +94,7 @@ export interface PatternDayStopTimes extends PatternStopTimes {

export interface VehicleRental {
errorsByNetwork: { [key: string]: { message?: string; severity?: string } }
stations: Station[]
systemInformationDataByNetwork: {
[key: string]: { message?: string; severity?: string }
}
Expand Down
7 changes: 2 additions & 5 deletions lib/components/viewers/amenities-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import React, { Component, Suspense } from 'react'
import styled from 'styled-components'

import { ComponentContext } from '../../util/contexts'
import { StopData } from '../util/types'

import RelatedPanel from './related-panel'

Expand Down Expand Up @@ -35,11 +36,7 @@ const parkAndRideMarker = (
type Props = {
configCompanies: ConfiguredCompany[]
intl: IntlShape
stopData: Stop & {
bikeRental: any
parkAndRideLocations: any
vehicleRental: any
}
stopData: StopData
}
type State = {
expanded: boolean
Expand Down

0 comments on commit 997e689

Please sign in to comment.