about summary refs log tree commit diff
path: root/src/view/com/modals/Modal.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/com/modals/Modal.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/com/modals/Modal.web.tsx')
-rw-r--r--src/view/com/modals/Modal.web.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/view/com/modals/Modal.web.tsx b/src/view/com/modals/Modal.web.tsx
index 74aa7b1a9..c39ba1f51 100644
--- a/src/view/com/modals/Modal.web.tsx
+++ b/src/view/com/modals/Modal.web.tsx
@@ -1,10 +1,11 @@
 import React from 'react'
 import {TouchableWithoutFeedback, StyleSheet, View} from 'react-native'
+import Animated, {FadeIn, FadeOut} from 'react-native-reanimated'
 import {usePalette} from 'lib/hooks/usePalette'
 import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
-import type {Modal as ModalIface} from '#/state/modals'
 
 import {useModals, useModalControls} from '#/state/modals'
+import type {Modal as ModalIface} from '#/state/modals'
 import * as ConfirmModal from './Confirm'
 import * as EditProfileModal from './EditProfile'
 import * as ProfilePreviewModal from './ProfilePreview'
@@ -129,7 +130,10 @@ function Modal({modal}: {modal: ModalIface}) {
   return (
     // eslint-disable-next-line react-native-a11y/has-valid-accessibility-descriptors
     <TouchableWithoutFeedback onPress={onPressMask}>
-      <View style={styles.mask}>
+      <Animated.View
+        style={styles.mask}
+        entering={FadeIn.duration(150)}
+        exiting={FadeOut}>
         {/* eslint-disable-next-line react-native-a11y/has-valid-accessibility-descriptors */}
         <TouchableWithoutFeedback onPress={onInnerPress}>
           <View
@@ -142,7 +146,7 @@ function Modal({modal}: {modal: ModalIface}) {
             {element}
           </View>
         </TouchableWithoutFeedback>
-      </View>
+      </Animated.View>
     </TouchableWithoutFeedback>
   )
 }