Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got error loading when using moti/skeleton with FlashList #1330

Open
LucasWilliams2622 opened this issue Aug 26, 2024 · 0 comments
Open

Got error loading when using moti/skeleton with FlashList #1330

LucasWilliams2622 opened this issue Aug 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@LucasWilliams2622
Copy link

Image
Flashlist does not receive isLoading change event when using moti/skeleton here is my. code

const ItemTable = ({
data,
noShadow = false,
containerStyle,
navigation,
isLoading,
}: {
data: TableOrderProps
noShadow?: boolean
containerStyle?: StyleProp
navigation: any
isLoading?: boolean
}) => {
const { datetimebegin, status, num_guests } = data.bookings
const { image_mobile_photo, address, name } = data.shops
return (
<TouchableOpacity
style={[noShadow ? null : appStyle.shadow, styles.container, containerStyle]}
onPress={() => {
navigation.navigate("DetailTableOrder", { navigation: navigation, data: data })
}}
>
<Skeleton.Group show={isLoading}>
<>

<Skeleton colorMode={"light"} radius={4}>
<Image style={styles.image} source={{ uri: image_mobile_photo }} />

<View
style={[appStyle.columnBtw, { alignItems: "flex-start", marginLeft: 12, flex: 1 }]}
>
<Skeleton colorMode={"light"} width={"100%"}>


{name}

              <AppSpacing height={4} />
              <Text style={[appStyle.text10Medium, {}]} numberOfLines={1}>
                {address}
              </Text>
            </View>
          </Skeleton>

          <Skeleton colorMode={"light"}>
            <Text
              style={[
                styles.boxStatus,
                appStyle.text12Medium,
                {
                  backgroundColor:color.successColor2,
                  color: color.successColor,
                },
              ]}
            >
             TEXT
            </Text>
          </Skeleton>
        </View>
      </View>
      {status === "success" && (
        <>
          <AppSpacing height={12} />
          <Skeleton colorMode={"light"}>
            <View style={[appStyle.rowBtw, styles.boxInfo]}>
              <View style={appStyle.rowCenter}>
                <SVGS.IConClock color={color.text} width={14} />
                <Text style={[appStyle.text12Medium, { marginLeft: 8 }]}>
                  {datetimebegin.slice(10)}
                </Text>
              </View>
              <View style={[appStyle.rowCenter, {}]}>
                <SVGS.IConCalendar color={color.text} />
                <Text style={[appStyle.text12Medium, { marginLeft: 8 }]} numberOfLines={1}>
                  {datetimebegin.slice(0, 10)}
                </Text>
              </View>

              <View style={appStyle.rowCenter}>
                <SVGS.People color={color.text} />
                <Text style={[appStyle.text12Medium, { marginLeft: 8 }]}>
                  {num_guests} người
                </Text>
              </View>
            </View>
          </Skeleton>
        </>
      )}
    </>
  </Skeleton.Group>
</TouchableOpacity>

)
}

export default ItemTable
==================| TableHome |===================
<FlashList
showsHorizontalScrollIndicator={false}
horizontal
data={listTable}
renderItem={({ item }) => (

)}
ItemSeparatorComponent={SeparatorComponent}
keyExtractor={(item) => item.id.toString()}
estimatedItemSize={listTable?.length > 0 ? listTable?.length : 1}
/>

@LucasWilliams2622 LucasWilliams2622 added the bug Something isn't working label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant