Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default memo(({ translateY }: SearchProps) => {
const chevronTranslateY = translateY;
const searchTranslateY = clamp(chevronTranslateY, 0, THRESHOLD);
const backgroundColor = interpolateColor(translateY, {
inputRange: [CONTAINER_HEIGHT, THRESHOLD],
outputRange: [grey, primary]
}) as Animated.Node;
const opacity = interpolate(translateY, {
inputRange: [CONTAINER_HEIGHT, THRESHOLD],
outputRange: [1, 0],
extrapolate: Extrapolate.CLAMP
});
const oppositeOpacity = sub(1, opacity);
return (
export const withClamp = (
value: Animated.Node,
state: Animated.Value,
min: Animated.Adaptable,
max: Animated.Adaptable
) => cond(eq(state, State.ACTIVE), clamp(value, min, max), value);