Merge remote-tracking branch 'origin' into eric/app-864-integrate-post-tags-into-app
* origin: Disable events on hidden bars (#1686) Fix profile layout shift (#1690) Don't re-render bars when showing/hiding them (#1691) Fix crash when scrolling down on the web (#1684) Make shell hide/show animation smoother (#1683) Fix layout shift for multi-image posts (#1673) bskyweb: add rate limiting to reduce DoSability use new zeed-dom version (#1671) 1.53
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React from 'react'
|
||||
import {autorun} from 'mobx'
|
||||
import {useStores} from 'state/index'
|
||||
import {Animated} from 'react-native'
|
||||
import {useAnimatedValue} from 'lib/hooks/useAnimatedValue'
|
||||
@@ -7,26 +8,29 @@ export function useMinimalShellMode() {
|
||||
const store = useStores()
|
||||
const minimalShellInterp = useAnimatedValue(0)
|
||||
const footerMinimalShellTransform = {
|
||||
transform: [{translateY: Animated.multiply(minimalShellInterp, 100)}],
|
||||
opacity: Animated.subtract(1, minimalShellInterp),
|
||||
transform: [{translateY: Animated.multiply(minimalShellInterp, 50)}],
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
if (store.shell.minimalShellMode) {
|
||||
Animated.timing(minimalShellInterp, {
|
||||
toValue: 1,
|
||||
duration: 100,
|
||||
useNativeDriver: true,
|
||||
isInteraction: false,
|
||||
}).start()
|
||||
} else {
|
||||
Animated.timing(minimalShellInterp, {
|
||||
toValue: 0,
|
||||
duration: 100,
|
||||
useNativeDriver: true,
|
||||
isInteraction: false,
|
||||
}).start()
|
||||
}
|
||||
}, [minimalShellInterp, store.shell.minimalShellMode])
|
||||
return autorun(() => {
|
||||
if (store.shell.minimalShellMode) {
|
||||
Animated.timing(minimalShellInterp, {
|
||||
toValue: 1,
|
||||
duration: 150,
|
||||
useNativeDriver: true,
|
||||
isInteraction: false,
|
||||
}).start()
|
||||
} else {
|
||||
Animated.timing(minimalShellInterp, {
|
||||
toValue: 0,
|
||||
duration: 150,
|
||||
useNativeDriver: true,
|
||||
isInteraction: false,
|
||||
}).start()
|
||||
}
|
||||
})
|
||||
}, [minimalShellInterp, store])
|
||||
|
||||
return {footerMinimalShellTransform}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user