about summary refs log tree commit diff
path: root/src/view/shell/Composer.web.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2023-12-01 00:02:46 +0000
committerGitHub <noreply@github.com>2023-11-30 16:02:46 -0800
commit93755326985dddeb34d4fc0a4a9755d3a9860be1 (patch)
tree0315edd4c05110f1e04ac2a8fff396e334a6314e /src/view/shell/Composer.web.tsx
parentabe61b7517f07dfdb710a2ceb94676819f77a8d8 (diff)
downloadvoidsky-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.tsx16
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>
   )
 }