-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from opentripplanner/dev
Merge itin refactor changes into master
- Loading branch information
Showing
12 changed files
with
174 additions
and
107 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
lib/components/narrative/access-leg.js → ...omponents/narrative/default/access-leg.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from 'react' | ||
|
||
import NarrativeItinerary from '../narrative-itinerary' | ||
import ItinerarySummary from './itinerary-summary' | ||
import ItineraryDetails from './itinerary-details' | ||
import { formatDuration, formatTime } from '../../../util/time' | ||
|
||
export default class DefaultItinerary extends NarrativeItinerary { | ||
render () { | ||
const { | ||
active, | ||
activeLeg, | ||
activeStep, | ||
expanded, | ||
index, | ||
itinerary, | ||
setActiveLeg, | ||
setActiveStep | ||
} = this.props | ||
return ( | ||
<div className={`option itinerary${active ? ' active' : ''}`}> | ||
<button | ||
className='header' | ||
onClick={this._onHeaderClick} | ||
> | ||
<span className='title'>Itinerary {index + 1}</span>{' '} | ||
<span className='duration pull-right'>{formatDuration(itinerary.duration)}</span>{' '} | ||
<span className='arrivalTime'>{formatTime(itinerary.startTime)}—{formatTime(itinerary.endTime)}</span> | ||
<ItinerarySummary itinerary={itinerary} /> | ||
</button> | ||
{(active || expanded) && | ||
<div className='body'> | ||
<ItineraryDetails | ||
itinerary={itinerary} | ||
activeLeg={activeLeg} | ||
activeStep={activeStep} | ||
setActiveLeg={setActiveLeg} | ||
setActiveStep={setActiveStep} | ||
/> | ||
</div> | ||
} | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...components/narrative/itinerary-summary.js → ...ts/narrative/default/itinerary-summary.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
lib/components/narrative/transit-leg.js → ...mponents/narrative/default/transit-leg.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.