Skip to content

Commit

Permalink
Active styles + different header when expanded
Browse files Browse the repository at this point in the history
Cherry picking from 8a801c7 and b6dc745

naoufal#38
  • Loading branch information
compojoom committed Nov 21, 2016
1 parent ba0f005 commit c326bb5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ var Accordion = React.createClass({
easing: React.PropTypes.string,
expanded: React.PropTypes.bool,
header: React.PropTypes.element.isRequired,
headerOpen: React.PropTypes.element,
onPress: React.PropTypes.func,
underlayColor: React.PropTypes.string,
style: React.PropTypes.object
style: React.PropTypes.object,
styleOpen: React.PropTypes.object,
},

getDefaultProps() {
Expand Down Expand Up @@ -109,9 +111,9 @@ var Accordion = React.createClass({
ref="AccordionHeader"
onPress={this._onPress}
underlayColor={this.props.underlayColor}
style={this.props.style}
style={this.state.is_visible ? this.props.styleOpen : this.props.style}
>
{this.props.header}
{this.state.is_visible && this.props.headerOpen ? this.props.headerOpen : this.props.header}
</TouchableHighlight>
<View
ref="AccordionContentWrapper"
Expand Down

0 comments on commit c326bb5

Please sign in to comment.