import React, { useState, useEffect } from "react"; import { View, Text, StyleSheet, Animated, ScrollView } from "react-native"; import MasonryList from "@react-native-seoul/masonry-list"; const CardSkeletonLoading = () => { const [animation, setAnimation] = useState(new Animated.Value(0)); useEffect(() => { Animated.loop( Animated.timing(animation, { toValue: 1, duration: 900, useNativeDriver: true, }) ).start(); }, [animation]); const opacity = animation.interpolate({ inputRange: [0, 1], outputRange: [0.2, 1], }); const product = [1, 2, 3, 4, 5, 6]; return ( item.id} style={styles.list} numColumns={2} showsVerticalScrollIndicator={false} renderItem={({ item }) => ( )} containerStyle={styles.container1} contentContainerStyle={styles.content} // refreshing={isLoadingNext} // onRefresh={() => refetch({ first: itemCount })} onEndReachedThreshold={0.1} // onEndReached={() => loadNext(ITEM_CNT)} /> ); }; const styles = StyleSheet.create({ container: { alignItems: "center", justifyContent: "center", flex: 1, backgroundColor: "#fff", }, container1: { width: "100%", marginTop: 0, flex: 1, backgroundColor: "#fff", }, container2: { width: "100%", marginTop: 30, flex: 1, backgroundColor: "#fff", }, categories: { flexDirection: "row", width: "100%", justifyContent: "space-between", }, skeleton: { backgroundColor: "#f2f2f2", borderRadius: 5, width: "98%", height: 250, marginVertical: 5, }, skeletonText: { backgroundColor: "#f2f2f2", borderRadius: 5, width: "30%", height: 30, marginVertical: 5, }, skeletonRound: { backgroundColor: "#f2f2f2", borderRadius: 5, width: 60, height: 60, borderRadius: 80, marginVertical: 5, }, }); export default CardSkeletonLoading;