Skip to content

Commit b787b53

Browse files
author
David Emory
committed
feat(narrative): Add option for expansion listener to ItineraryCarousel
1 parent 595cc08 commit b787b53

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/components/narrative/itinerary-carousel.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ class ItineraryCarousel extends Component {
1616
pending: PropTypes.bool,
1717
activeItinerary: PropTypes.number,
1818
hideHeader: PropTypes.bool,
19+
onExpand: PropTypes.func,
1920
setActiveItinerary: PropTypes.func,
2021
setActiveLeg: PropTypes.func,
2122
setActiveStep: PropTypes.func
2223
}
2324

2425
_onItineraryClick = () => {
25-
this.setState({expanded: !this.state.expanded})
26+
const expanded = !this.state.expanded
27+
this.setState({expanded})
28+
if (this.props.onExpand) this.props.onExpand(expanded)
2629
}
2730

2831
_onLeftClick = () => {

0 commit comments

Comments
 (0)