diff options
author | Samuel Newman <mozzius@protonmail.com> | 2023-12-01 00:02:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 16:02:46 -0800 |
commit | 93755326985dddeb34d4fc0a4a9755d3a9860be1 (patch) | |
tree | 0315edd4c05110f1e04ac2a8fff396e334a6314e /src/view/shell/Composer.web.tsx | |
parent | abe61b7517f07dfdb710a2ceb94676819f77a8d8 (diff) | |
download | voidsky-93755326985dddeb34d4fc0a4a9755d3a9860be1.tar.zst |
Add enter/exit animations to modals on web (#2042)
* add reanimated layout animations to modals * reorder imports * pass context to scroll handler patches
Diffstat (limited to 'src/view/shell/Composer.web.tsx')
-rw-r--r-- | src/view/shell/Composer.web.tsx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/view/shell/Composer.web.tsx b/src/view/shell/Composer.web.tsx index e08c792a4..d8f4648fe 100644 --- a/src/view/shell/Composer.web.tsx +++ b/src/view/shell/Composer.web.tsx @@ -1,5 +1,6 @@ import React from 'react' import {StyleSheet, View} from 'react-native' +import Animated, {FadeIn, FadeInDown, FadeOut} from 'react-native-reanimated' import {ComposePost} from '../com/composer/Composer' import {useComposerState} from 'state/shell/composer' import {usePalette} from 'lib/hooks/usePalette' @@ -20,8 +21,15 @@ export function Composer({}: {winHeight: number}) { } return ( - <View style={styles.mask} aria-modal accessibilityViewIsModal> - <View + <Animated.View + style={styles.mask} + aria-modal + accessibilityViewIsModal + entering={FadeIn.duration(150)} + exiting={FadeOut}> + <Animated.View + entering={FadeInDown.duration(200)} + exiting={FadeOut} style={[ styles.container, isMobile && styles.containerMobile, @@ -34,8 +42,8 @@ export function Composer({}: {winHeight: number}) { onPost={state.onPost} mention={state.mention} /> - </View> - </View> + </Animated.View> + </Animated.View> ) } |