Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

Commit

Permalink
Support animationStyle function
Browse files Browse the repository at this point in the history
  • Loading branch information
Kureev Alexey committed Aug 30, 2015
1 parent edd3740 commit e1cef09
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,7 @@ class SideMenu extends Component {

return (
<Animated.View
style={[styles.frontView, {
transform: [{
translateX: this.state.left,
}],
}, ]}
style={[styles.frontView, this.props.animationStyle(this.state.left)]}
ref={(sideMenu) => this.sideMenu = sideMenu}
{...this.responder.panHandlers}>
{children}
Expand Down Expand Up @@ -298,6 +294,13 @@ SideMenu.defaultProps = {
toleranceX: 10,
touchToClose: false,
onChange: () => {},
animationStyle: function(prop) {
return {
transform: [{
translateX: prop,
}],
};
},
animationFunction: (prop, value) => {
return Animated.spring(
prop,
Expand Down

0 comments on commit e1cef09

Please sign in to comment.