Skip to content

Commit

Permalink
Fix issue with loading animation (#486)
Browse files Browse the repository at this point in the history
Signed-off-by: Cintia Sanchez Garcia <[email protected]>
  • Loading branch information
cynthia-sg authored Feb 5, 2024
1 parent 9d2d959 commit 9a3328e
Showing 1 changed file with 40 additions and 36 deletions.
76 changes: 40 additions & 36 deletions web/src/layout/explore/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ const Explore = (props: Props) => {
});

return (
<Show when={!isUndefined(groupsData()) && readyData()}>
<Show when={!isUndefined(groupsData())}>
<main class="flex-grow-1 container-fluid px-3 px-lg-4 mainPadding position-relative">
<div class="d-flex flex-column flex-lg-row my-2 my-md-3 py-1">
<div class="d-flex flex-row align-items-center mb-1 mb-md-0">
Expand Down Expand Up @@ -588,7 +588,7 @@ const Explore = (props: Props) => {
/>
</div>

<Show when={numVisibleItems() === 0}>
<Show when={numVisibleItems() === 0 && readyData()}>
<div class="pt-5">
<NoData>
<>
Expand All @@ -613,15 +613,17 @@ const Explore = (props: Props) => {
<Show when={!isUndefined(point())}>
<Switch>
<Match when={SMALL_DEVICES_BREAKPOINTS.includes(point()!)}>
<div ref={setContainerRef}>
<ExploreMobileIndex
openMenuStatus={openMenuStatus()}
closeMenuStatus={closeMenuStatus}
data={{ ...groupsData() }[selectedGroup() || 'default']}
categories_overridden={props.initialData.categories_overridden}
finishLoading={finishLoading}
/>
</div>
<Show when={readyData()}>
<div ref={setContainerRef}>
<ExploreMobileIndex
openMenuStatus={openMenuStatus()}
closeMenuStatus={closeMenuStatus}
data={{ ...groupsData() }[selectedGroup() || 'default']}
categories_overridden={props.initialData.categories_overridden}
finishLoading={finishLoading}
/>
</div>
</Show>
</Match>
<Match when={!SMALL_DEVICES_BREAKPOINTS.includes(point()!)}>
<div class="position-relative d-flex w-100 pt-1">
Expand All @@ -638,31 +640,33 @@ const Explore = (props: Props) => {
<Loading spinnerClass="position-fixed top-50 start-50" transparentBg />
)}

<Show
when={!isUndefined(props.initialData.groups)}
fallback={
<Content
data={{ ...groupsData() }.default}
categories_overridden={props.initialData.categories_overridden}
updateHash={updateHash}
finishLoading={finishLoading}
/>
}
>
<For each={props.initialData.groups}>
{(group: Group) => {
return (
<Content
group={group.normalized_name}
initialSelectedGroup={selectedGroup()}
data={{ ...groupsData() }[group.normalized_name]}
categories_overridden={props.initialData.categories_overridden}
updateHash={updateHash}
finishLoading={finishLoading}
/>
);
}}
</For>
<Show when={readyData()}>
<Show
when={!isUndefined(props.initialData.groups)}
fallback={
<Content
data={{ ...groupsData() }.default}
categories_overridden={props.initialData.categories_overridden}
updateHash={updateHash}
finishLoading={finishLoading}
/>
}
>
<For each={props.initialData.groups}>
{(group: Group) => {
return (
<Content
group={group.normalized_name}
initialSelectedGroup={selectedGroup()}
data={{ ...groupsData() }[group.normalized_name]}
categories_overridden={props.initialData.categories_overridden}
updateHash={updateHash}
finishLoading={finishLoading}
/>
);
}}
</For>
</Show>
</Show>
</div>
</div>
Expand Down

0 comments on commit 9a3328e

Please sign in to comment.