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

react-native-skeleton-placeholder not working if condition #122

Open
jeffryaz opened this issue Aug 15, 2023 · 0 comments
Open

react-native-skeleton-placeholder not working if condition #122

jeffryaz opened this issue Aug 15, 2023 · 0 comments

Comments

@jeffryaz
Copy link

jeffryaz commented Aug 15, 2023

if there are the following conditions then the content does not appear. but if it has no condition then it can appear
//not show

props.actionHome === actionTypes.GET_DASHBOARD_LIST_FETCH && props.fetchDashboardList && (
    <LoadingSkeleton />
)

//show
<LoadingSkeleton />

const LoadingSkeleton = (): JSX.Element => {
    return (
        <View>
            <View style={{ marginBottom: 50 }}>
                <View style={{ marginBottom: 20 }}>
                    <SkeletonPlaceholder borderRadius={4} highlightColor="#ffffff" speed={700}>
                        <SkeletonPlaceholder.Item flexDirection="row" alignItems="center" justifyContent="space-between">
                            <SkeletonPlaceholder.Item width={150} height={20} />
                            <SkeletonPlaceholder.Item width={50} height={20} />
                        </SkeletonPlaceholder.Item>
                    </SkeletonPlaceholder>
                </View>
                <View>
                    <SkeletonPlaceholder borderRadius={4} highlightColor="#ffffff" speed={700}>
                        <SkeletonPlaceholder.Item flexDirection="row">
                            <SkeletonPlaceholder.Item width={150} height={150} marginRight={15} />
                            <SkeletonPlaceholder.Item width={150} height={150} marginRight={15} />
                            <SkeletonPlaceholder.Item width={150} height={150} marginRight={15} />
                        </SkeletonPlaceholder.Item>
                    </SkeletonPlaceholder>
                </View>
            </View>
            <View style={{ marginBottom: 50 }}>
                <View style={{ marginBottom: 20 }}>
                    <SkeletonPlaceholder borderRadius={4} highlightColor="#ffffff" speed={700}>
                        <SkeletonPlaceholder.Item flexDirection="row" alignItems="center" justifyContent="space-between">
                            <SkeletonPlaceholder.Item width={150} height={20} />
                            <SkeletonPlaceholder.Item width={50} height={20} />
                        </SkeletonPlaceholder.Item>
                    </SkeletonPlaceholder>
                </View>
                <View>
                    <SkeletonPlaceholder borderRadius={4} highlightColor="#ffffff" speed={700}>
                        <SkeletonPlaceholder.Item flexDirection="row">
                            <SkeletonPlaceholder.Item width={150} height={150} marginRight={15} />
                            <SkeletonPlaceholder.Item width={150} height={150} marginRight={15} />
                            <SkeletonPlaceholder.Item width={150} height={150} marginRight={15} />
                        </SkeletonPlaceholder.Item>
                    </SkeletonPlaceholder>
                </View>
            </View>
        </View>
    )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant