Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
() => block([
cond(eq(state, State.END), [
set(snapPointX, snapPoint(translationX, velocityX, points)),
set(spring, runSpring(clock, 0, 1)),
cond(
eq(clockRunning(clock), 0),
call([snapPointX], ([x]) => onSnap({ nativeEvent: { x } })),
),
]),
set(
x,
cond(
eq(state, State.ACTIVE),
translationX,
binaryInterpolation(spring, translationX, snapPointX),
),
),
set(
y,
cond(
eq(state, State.ACTIVE),
translationY,
binaryInterpolation(spring, translationY, 0),
),
),
])
}
() => block([
cond(eq(opened, 0), [
set(driver, runTiming(clock, 0, timingConfig)),
cond(eq(clockRunning(clock), 0), set(opened, 1)),
]),
set(x, binaryInterpolation(driver, position.x, 0)),
set(y, binaryInterpolation(driver, position.y, 0)),
set(width, binaryInterpolation(driver, position.width, wWidth)),
set(contentX, binaryInterpolation(driver, position.x, 0)),
set(contentY, binaryInterpolation(driver, position.y, position.height)),
cond(and(greaterOrEq(round(translationY), 100), neq(driver, 0)), [
set(driver, runTiming(clock, 1, {
toValue: 0,
duration: 300,
easing: Easing.inOut(Easing.ease),
})),
cond(eq(clockRunning(clock), 0), call([], close)),
]),
])
}
() => block([
cond(eq(opened, 0), [
set(driver, runTiming(clock, 0, timingConfig)),
cond(eq(clockRunning(clock), 0), set(opened, 1)),
]),
set(x, binaryInterpolation(driver, position.x, 0)),
set(y, binaryInterpolation(driver, position.y, 0)),
set(width, binaryInterpolation(driver, position.width, wWidth)),
set(contentX, binaryInterpolation(driver, position.x, 0)),
set(contentY, binaryInterpolation(driver, position.y, position.height)),
cond(and(greaterOrEq(round(translationY), 100), neq(driver, 0)), [
set(driver, runTiming(clock, 1, {
toValue: 0,
duration: 300,
easing: Easing.inOut(Easing.ease),
})),
cond(eq(clockRunning(clock), 0), call([], close)),
]),
])
}
() => block([
cond(eq(opened, 0), [
set(driver, runTiming(clock, 0, timingConfig)),
cond(eq(clockRunning(clock), 0), set(opened, 1)),
]),
set(x, binaryInterpolation(driver, position.x, 0)),
set(y, binaryInterpolation(driver, position.y, 0)),
set(width, binaryInterpolation(driver, position.width, wWidth)),
set(contentX, binaryInterpolation(driver, position.x, 0)),
set(contentY, binaryInterpolation(driver, position.y, position.height)),
cond(and(greaterOrEq(round(translationY), 100), neq(driver, 0)), [
set(driver, runTiming(clock, 1, {
toValue: 0,
duration: 300,
easing: Easing.inOut(Easing.ease),
})),
cond(eq(clockRunning(clock), 0), call([], close)),
]),
])
}
),
]),
set(
x,
cond(
eq(state, State.ACTIVE),
translationX,
binaryInterpolation(spring, translationX, snapPointX),
),
),
set(
y,
cond(
eq(state, State.ACTIVE),
translationY,
binaryInterpolation(spring, translationY, 0),
),
),
])
}
() => block([
cond(eq(opened, 0), [
set(driver, runTiming(clock, 0, timingConfig)),
cond(eq(clockRunning(clock), 0), set(opened, 1)),
]),
set(x, binaryInterpolation(driver, position.x, 0)),
set(y, binaryInterpolation(driver, position.y, 0)),
set(width, binaryInterpolation(driver, position.width, wWidth)),
set(contentX, binaryInterpolation(driver, position.x, 0)),
set(contentY, binaryInterpolation(driver, position.y, position.height)),
cond(and(greaterOrEq(round(translationY), 100), neq(driver, 0)), [
set(driver, runTiming(clock, 1, {
toValue: 0,
duration: 300,
easing: Easing.inOut(Easing.ease),
})),
cond(eq(clockRunning(clock), 0), call([], close)),
]),
])
}