Настройка переходов для смены пасса и забыл пароль

This commit is contained in:
SleepWalker 2016-02-29 20:36:23 +02:00
parent 5e7d063449
commit b26c515997

View File

@ -160,7 +160,9 @@ class PanelTransition extends Component {
'/register': -1,
'/password': 1,
'/activation': 1,
'/oauth/permissions': -1
'/oauth/permissions': -1,
'/password-change': 1,
'/forgot-password': 1
};
var sign = map[key];
@ -172,6 +174,22 @@ class PanelTransition extends Component {
};
}
getDirection(next, prev) {
var not = (path) => prev !== path && next !== path;
var map = {
'/login': not('/password') && not('/forgot-password') ? 'Y' : 'X',
'/password': not('/login') && not('/forgot-password') ? 'Y' : 'X',
'/register': not('/activation') ? 'Y' : 'X',
'/activation': not('/register') ? 'Y' : 'X',
'/oauth/permissions': 'Y',
'/password-change': 'Y',
'/forgot-password': not('/password') && not('/login') ? 'Y' : 'X'
};
return map[next];
}
onUpdateHeight = (height) => {
const canAnimateHeight = Object.keys(this.state.height).length > 1 || this.state.height[[this.props.path]];
@ -197,20 +215,6 @@ class PanelTransition extends Component {
this.props.goBack();
};
getDirection(next, prev) {
var not = (path) => prev !== path && next !== path;
var map = {
'/login': not('/password') ? 'Y' : 'X',
'/password': not('/login') ? 'Y' : 'X',
'/register': not('/activation') ? 'Y' : 'X',
'/activation': not('/register') ? 'Y' : 'X',
'/oauth/permissions': 'Y'
};
return map[next];
}
getHeader(key, props) {
var {hasBackButton, transformSpring, Title} = props;