mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-10-01 15:57:46 +05:30
Настройка переходов для смены пасса и забыл пароль
This commit is contained in:
parent
5e7d063449
commit
b26c515997
@ -160,7 +160,9 @@ class PanelTransition extends Component {
|
|||||||
'/register': -1,
|
'/register': -1,
|
||||||
'/password': 1,
|
'/password': 1,
|
||||||
'/activation': 1,
|
'/activation': 1,
|
||||||
'/oauth/permissions': -1
|
'/oauth/permissions': -1,
|
||||||
|
'/password-change': 1,
|
||||||
|
'/forgot-password': 1
|
||||||
};
|
};
|
||||||
var sign = map[key];
|
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) => {
|
onUpdateHeight = (height) => {
|
||||||
const canAnimateHeight = Object.keys(this.state.height).length > 1 || this.state.height[[this.props.path]];
|
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();
|
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) {
|
getHeader(key, props) {
|
||||||
var {hasBackButton, transformSpring, Title} = props;
|
var {hasBackButton, transformSpring, Title} = props;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user