Add layout transitions to the composer photo gallery on iOS (#3609)
* add layoutanimation + transition to images * make iOS-only * use useLayoutEffect * make iOS only (again)
This commit is contained in:
parent
bef7d8a325
commit
1a5b8b2c94
2 changed files with 27 additions and 10 deletions
|
@ -1,9 +1,17 @@
|
|||
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useLayoutEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react'
|
||||
import {
|
||||
ActivityIndicator,
|
||||
BackHandler,
|
||||
Keyboard,
|
||||
KeyboardAvoidingView,
|
||||
LayoutAnimation,
|
||||
Platform,
|
||||
Pressable,
|
||||
ScrollView,
|
||||
|
@ -122,6 +130,13 @@ export const ComposePost = observer(function ComposePost({
|
|||
() => new GalleryModel(initImageUris),
|
||||
[initImageUris],
|
||||
)
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (isIOS) {
|
||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
|
||||
}
|
||||
}, [gallery.size])
|
||||
|
||||
const onClose = useCallback(() => {
|
||||
closeComposer()
|
||||
}, [closeComposer])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue