mirror of
https://github.com/Jellify-Music/App.git
synced 2025-12-30 15:29:49 -06:00
fix: update AnimatedBlurhash to use Animated.View for improved performance (#756)
This commit is contained in:
@@ -78,13 +78,14 @@ interface ItemBlurhashProps {
|
||||
testID?: string | undefined
|
||||
}
|
||||
|
||||
const AnimatedBlurhash = Animated.createAnimatedComponent(Blurhash)
|
||||
|
||||
const Styles = StyleSheet.create({
|
||||
blurhash: {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
},
|
||||
blurhashInner: {
|
||||
...StyleSheet.absoluteFillObject,
|
||||
},
|
||||
})
|
||||
|
||||
const ItemBlurhash = memo(
|
||||
@@ -92,13 +93,9 @@ const ItemBlurhash = memo(
|
||||
const blurhash = getBlurhashFromDto(item, type)
|
||||
|
||||
return (
|
||||
<AnimatedBlurhash
|
||||
resizeMode={'cover'}
|
||||
style={Styles.blurhash}
|
||||
blurhash={blurhash}
|
||||
entering={FadeIn}
|
||||
exiting={FadeOut}
|
||||
/>
|
||||
<Animated.View style={Styles.blurhash} entering={FadeIn} exiting={FadeOut}>
|
||||
<Blurhash resizeMode={'cover'} style={Styles.blurhashInner} blurhash={blurhash} />
|
||||
</Animated.View>
|
||||
)
|
||||
},
|
||||
(prevProps: ItemBlurhashProps, nextProps: ItemBlurhashProps) =>
|
||||
|
||||
@@ -80,6 +80,7 @@ export const Miniplayer = React.memo(function Miniplayer(): React.JSX.Element {
|
||||
return (
|
||||
<GestureDetector gesture={gesture}>
|
||||
<Animated.View
|
||||
collapsable={false}
|
||||
testID='miniplayer-test-id'
|
||||
entering={FadeInDown.springify()}
|
||||
exiting={FadeOutDown.springify()}
|
||||
|
||||
Reference in New Issue
Block a user