Skip to content

Instantly share code, notes, and snippets.

@jai-adapptor
Last active July 25, 2022 13:52
Show Gist options
  • Save jai-adapptor/207eb5bcd676b269f47cbfd9f447959e to your computer and use it in GitHub Desktop.
Save jai-adapptor/207eb5bcd676b269f47cbfd9f447959e to your computer and use it in GitHub Desktop.
5: Animated styles
const sheetHeightAnimatedStyle = useAnimatedStyle(() => ({
// The 'worklet' directive is included with useAnimatedStyle hook by default
height: -sheetHeight.value,
}));
const sheetContentAnimatedStyle = useAnimatedStyle(() => ({
paddingBottom: position.value === 'maximised' ? 180 : 0,
paddingTop: position.value === 'maximised' ? 40 : 20,
paddingHorizontal: 20,
}));
const sheetNavigationAnimatedStyle = useAnimatedStyle(() => ({
height: navHeight.value,
overflow: 'hidden',
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment