From 5d7c4ddd90079837073c9aa57a9eecb2f006c158 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Mon, 5 Dec 2022 10:50:46 -0600 Subject: [PATCH] Remove loading-placeholder animation; according to some issues, animated linear-gradients may cause crashes --- src/view/com/util/LoadingPlaceholder.tsx | 51 +++--------------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/src/view/com/util/LoadingPlaceholder.tsx b/src/view/com/util/LoadingPlaceholder.tsx index 3fcb07b5..9c2d0398 100644 --- a/src/view/com/util/LoadingPlaceholder.tsx +++ b/src/view/com/util/LoadingPlaceholder.tsx @@ -1,13 +1,5 @@ -import React, {useEffect, useMemo} from 'react' -import { - Animated, - StyleSheet, - StyleProp, - useWindowDimensions, - View, - ViewStyle, -} from 'react-native' -import LinearGradient from 'react-native-linear-gradient' +import React from 'react' +import {StyleSheet, StyleProp, View, ViewStyle} from 'react-native' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {UpIcon} from '../../lib/icons' import {s, colors} from '../../lib/styles' @@ -21,31 +13,6 @@ export function LoadingPlaceholder({ height: string | number style?: StyleProp }) { - const dim = useWindowDimensions() - const elWidth = typeof width === 'string' ? dim.width : width - const offset = useMemo(() => new Animated.Value(elWidth * -1), []) - useEffect(() => { - const anim = Animated.loop( - Animated.sequence([ - Animated.timing(offset, { - toValue: elWidth, - duration: 1e3, - useNativeDriver: true, - isInteraction: false, - }), - Animated.timing(offset, { - toValue: elWidth * -1, - duration: 0, - delay: 500, - useNativeDriver: true, - isInteraction: false, - }), - ]), - ) - anim.start() - return () => anim.stop() - }, []) - return ( - - - + backgroundColor: '#e7e9ea', + }} + /> ) }