Skip to content

Commit c5904ab

Browse files
fix(Yarn): Update yarn file; Remove unused stuff in DateTimeModal
1 parent 38673f2 commit c5904ab

File tree

3 files changed

+542
-271
lines changed

3 files changed

+542
-271
lines changed

lib/components/form/date-time-modal.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import * as TripFormClasses from '@opentripplanner/trip-form/lib/styled'
1010

1111
import { setQueryParam } from '../../actions/form'
1212

13+
// Styles for the DateTimeSelector.
14+
// TODO: Find a way to bring OTP CSS classes in here.
1315
const StyledDateTimeSelector = styled(DateTimeSelector)`
1416
margin: 0 -15px 20px;
1517
${TripFormClasses.DateTimeSelector.DateTimeRow} {
@@ -81,21 +83,15 @@ const StyledDateTimeSelector = styled(DateTimeSelector)`
8183
}
8284
}
8385
`
84-
// ^ ^ TODO: On Chrome on MacOS, here is a one-pixel gap between the selection highlight and the control
85-
// that didn't occur in the old version.
8686

8787
// Define default routingType labels and components
8888
const rtDefaults = [
8989
{
9090
key: 'ITINERARY',
91-
text: 'Itinerary',
92-
component: <StyledDateTimeSelector />,
93-
componentClass: StyledDateTimeSelector
91+
text: 'Itinerary'
9492
}, {
9593
key: 'PROFILE',
96-
text: 'Profile',
97-
component: <StyledDateTimeSelector profile />, // TODO: Profile in DateTimeSelector.
98-
componentClass: StyledDateTimeSelector
94+
text: 'Profile'
9995
}
10096
]
10197

@@ -107,7 +103,6 @@ class DateTimeModal extends Component {
107103

108104
render () {
109105
const { config, date, dateFormatLegacy, departArrive, routingType, setQueryParam, time, timeFormatLegacy } = this.props
110-
const ActualDateSelector = rtDefaults.find(d => d.key === routingType).componentClass
111106

112107
return (
113108
<div className='date-time-modal'>
@@ -135,7 +130,7 @@ class DateTimeModal extends Component {
135130

136131
{/* The main panel for the selected routing type */}
137132
<div className='main-panel'>
138-
<ActualDateSelector
133+
<StyledDateTimeSelector
139134
className='date-time-selector'
140135
date={date}
141136
dateFormatLegacy={dateFormatLegacy}
@@ -157,11 +152,11 @@ const mapStateToProps = (state, ownProps) => {
157152
departArrive,
158153
date,
159154
time,
160-
// startTime, // Not used right now, was once used in "Profile mode".
161-
// endTime, // Not used right now, was once used in "Profile mode".
162155
routingType,
163-
// These props below are for very old browsers + Safari on MacOS that don't support `<input type="time|date">`.
164-
// Otherwise, `<input type="time|date">` in modern browsers displays the time|date according to user/local settings.
156+
// These props below are for Safari on MacOS, and old browsers
157+
// that don't support `<input type="time|date">`.
158+
// In modern browsers, `<input type="time|date">` already
159+
// formats the time|date according to the OS settings.
165160
timeFormatLegacy: getTimeFormat(state.otp.config),
166161
dateFormatLegacy: getDateFormat(state.otp.config)
167162
}

lib/components/form/date-time-selector.js

Lines changed: 0 additions & 254 deletions
This file was deleted.

0 commit comments

Comments
 (0)