summaryrefslogtreecommitdiffhomepage
path: root/app/transitions.js
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-06-01 16:13:10 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-06-05 12:11:55 +0200
commitca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087 (patch)
treeb1f7754eb50896ab3681e35fa4e08be642b940c9 /app/transitions.js
parent5852c980980de53e00d76a0bdb4b41bf5c0f5b39 (diff)
downloadmullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.tar.xz
mullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.zip
Add formatted source code
Diffstat (limited to 'app/transitions.js')
-rw-r--r--app/transitions.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/app/transitions.js b/app/transitions.js
index 3e825c2968..56b1d74cfb 100644
--- a/app/transitions.js
+++ b/app/transitions.js
@@ -8,7 +8,7 @@ export type TransitionGroupProps = {
};
type TransitionMap = {
- [name: string]: TransitionFork
+ [name: string]: TransitionFork,
};
/**
@@ -18,23 +18,23 @@ const transitions: TransitionMap = {
slide: {
forward: {
name: 'slide-up',
- duration: 450
+ duration: 450,
},
backward: {
name: 'slide-down',
- duration: 450
- }
+ duration: 450,
+ },
},
push: {
forward: {
name: 'push',
- duration: 450
+ duration: 450,
},
backward: {
name: 'pop',
- duration: 450
- }
- }
+ duration: 450,
+ },
+ },
};
/**
@@ -47,7 +47,7 @@ const transitionRules = [
r('/settings', '/settings/advanced', transitions.push),
r('/settings', '/settings/support', transitions.push),
r(null, '/settings', transitions.slide),
- r(null, '/select-location', transitions.slide)
+ r(null, '/select-location', transitions.slide),
];
/**
@@ -58,13 +58,13 @@ const transitionRules = [
*/
export function getTransitionProps(fromRoute: ?string, toRoute: string): TransitionGroupProps {
// ignore initial transition and transition between the same routes
- if(!fromRoute || fromRoute === toRoute) {
+ if (!fromRoute || fromRoute === toRoute) {
return noTransitionProps();
}
- for(const rule of transitionRules) {
+ for (const rule of transitionRules) {
const match = rule.match(fromRoute, toRoute);
- if(match) {
+ if (match) {
return toTransitionGroupProps(match.descriptor);
}
}
@@ -77,7 +77,7 @@ export function getTransitionProps(fromRoute: ?string, toRoute: string): Transit
* @param {TransitionDescriptor} descriptor
*/
function toTransitionGroupProps(descriptor: TransitionDescriptor): TransitionGroupProps {
- const {name, duration} = descriptor;
+ const { name, duration } = descriptor;
return {
name: name,
duration: duration,