Skip to content
Snippets Groups Projects
Commit 2e547352 authored by Jan Ole Schmidt's avatar Jan Ole Schmidt
Browse files

Merge branch 'NOISSUE-adapt-challenges-carousel-skeleton' into 'main'

NOISSUE: adapt challenges carousel skeleton

See merge request app/holi-frontends!3120
parents b3dcc076 d62fbf4a
No related merge requests found
...@@ -15,6 +15,7 @@ import { useTranslation } from 'react-i18next' ...@@ -15,6 +15,7 @@ import { useTranslation } from 'react-i18next'
import HoliSkeleton from '@holi/ui/components/atoms/HoliSkeleton' import HoliSkeleton from '@holi/ui/components/atoms/HoliSkeleton'
import { Spacing } from 'holi-bricks/tokens/dimensions/spacing' import { Spacing } from 'holi-bricks/tokens/dimensions/spacing'
import { Stack } from 'holi-bricks/components/stack' import { Stack } from 'holi-bricks/components/stack'
import { HoliGap } from '@holi/ui/components/atoms/HoliGap'
const API_URL = challengeAppBaseUrl + '/api/v1/recommended-challenges' const API_URL = challengeAppBaseUrl + '/api/v1/recommended-challenges'
const CARD_WIDTH = 130 const CARD_WIDTH = 130
...@@ -66,23 +67,24 @@ const ChallengesCarousel = () => { ...@@ -66,23 +67,24 @@ const ChallengesCarousel = () => {
return id return id
} }
// show nothing if there are no challenges
if (!challenges || challenges.length === 0) {
return null
}
// show skeleton while loading // show skeleton while loading
if (isLoading) { if (isLoading) {
return ( return (
<Stack direction="column" gap="3xs"> <Stack direction="column" gap="3xs">
<HoliSkeleton height={Spacing.xl} width={180} borderRadius={16} /> <HoliSkeleton height={Spacing.xl} width={180} borderRadius={16} />
<Stack direction="row" gap="3xs"> <Stack direction="row" gap="3xs">
<HoliSkeleton height={CARD_WIDTH} width={'100%'} borderRadius={16} /> <HoliSkeleton height={172} width={'100%'} borderRadius={16} />
</Stack> </Stack>
<HoliGap size="l" />
</Stack> </Stack>
) )
} }
// show nothing if there are no challenges
if (!challenges || challenges.length === 0) {
return null
}
return ( return (
<ChallengesSlider <ChallengesSlider
viewTrackingParams={{ viewTrackingParams={{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment