Skip to content

Commit

Permalink
move magic constant into variable
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMSchmidt committed Mar 19, 2017
1 parent 04ca762 commit 79848d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DrawerLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
View,
} from 'react-native';

const MIN_SWIPE_DISTANCE = 3;
const DEVICE_WIDTH = parseFloat(Dimensions.get('window').width);
const THRESHOLD = DEVICE_WIDTH / 2;
const VX_MAX = 0.1;
Expand Down Expand Up @@ -218,7 +219,7 @@ export default class DrawerLayout extends Component {
};

_shouldSetPanResponder = (e, { moveX, dx, dy }) => {
if (!dx || !dy || Math.abs(dx) < 3) {
if (!dx || !dy || Math.abs(dx) < MIN_SWIPE_DISTANCE) {
return false;
}

Expand Down

0 comments on commit 79848d7

Please sign in to comment.