added comments placeholder animation

This commit is contained in:
Nouman Tahir 2021-03-05 18:09:03 +05:00
parent 804b76688d
commit 202bae5e03

View File

@ -1,30 +1,39 @@
import React from 'react'; import React from 'react';
import { View } from 'react-native'; import { View } from 'react-native';
import Placeholder from 'rn-placeholder';
import { ThemeContainer } from '../../../../containers'; import { ThemeContainer } from '../../../../containers';
import LottieView from 'lottie-react-native';
import styles from './listItemPlaceHolderStyles'; import styles from './listItemPlaceHolderStyles';
const CommentPlaceHolderView = () => { const CommentPlaceHolderView = () => {
const animationStyle = {
width:300, height: 72
}
return ( return (
<ThemeContainer> <ThemeContainer>
{({ isDarkTheme }) => { {({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.paragraphWithoutMargin}> <LottieView
<Placeholder.Paragraph style={animationStyle}
color={color} source={require('../../../../assets/animations/commentBody.json')}
lineNumber={3} autoPlay
textSize={12} loop={true}
lineSpacing={8} autoSize={true}
width="100%" resizeMode='cover'
lastLineWidth="70%" colorFilters={[
firstLineWidth="50%" {
animate="fade" keypath:'comments',
color:color
}
]
}
/> />
</View>
</View> </View>
); );
}} }}