Skip to content

Commit

Permalink
Merge pull request #789 from alleslabs/fix/removing-pool-loading-overlay
Browse files Browse the repository at this point in the history
fix: pool list overlay
  • Loading branch information
evilpeach committed Feb 15, 2024
2 parents 302b75f + 65a18b4 commit 5d74696
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Bug fixes

- [#789](https://github.com/alleslabs/celatone-frontend/pull/789) Remove loading overlay on pool list page causing the page look like flicking
- [#783](https://github.com/alleslabs/celatone-frontend/pull/783) Fix link used for Osmosis Pool JSON To poolmanager
- [#780](https://github.com/alleslabs/celatone-frontend/pull/780) Fix proposal vote table, scroll to top on table
- [#761](https://github.com/alleslabs/celatone-frontend/pull/761) Fix copy button tooltip alignment
Expand Down
11 changes: 7 additions & 4 deletions src/lib/pages/pools/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Heading, Tabs, TabList, TabPanels, TabPanel } from "@chakra-ui/react";
import { isUndefined } from "lodash";
import { useRouter } from "next/router";
import { useCallback, useEffect, useState } from "react";

import { AmpEvent, trackUseTab, track } from "lib/amplitude";
import { usePoolConfig } from "lib/app-provider";
import { CustomTab } from "lib/components/CustomTab";
import { LoadingOverlay } from "lib/components/LoadingOverlay";
import PageContainer from "lib/components/PageContainer";
import { usePoolListCountQuery } from "lib/services/poolService";
import { PoolType } from "lib/types";
Expand Down Expand Up @@ -55,16 +55,15 @@ export const PoolIndex = () => {

useEffect(() => {
if (
supportedPoolCount &&
unsupportedPoolCount &&
!isUndefined(supportedPoolCount) &&
!isUndefined(unsupportedPoolCount) &&
supportedPoolCount === 0 &&
unsupportedPoolCount > 0
) {
handleTabChange(TabIndex.Unsupported);
}
}, [handleTabChange, supportedPoolCount, unsupportedPoolCount]);

if (isLoadingSupported || isLoadingUnsupported) return <LoadingOverlay />;
return (
<PageContainer>
<Heading variant="h5" as="h5">
Expand All @@ -75,12 +74,16 @@ export const PoolIndex = () => {
<CustomTab
count={supportedPoolCount ?? 0}
onClick={() => handleTabChange(TabIndex.Supported)}
isLoading={isLoadingSupported}
isDisabled={!supportedPoolCount}
>
Pools
</CustomTab>
<CustomTab
count={unsupportedPoolCount ?? 0}
onClick={() => handleTabChange(TabIndex.Unsupported)}
isLoading={isLoadingUnsupported}
isDisabled={!unsupportedPoolCount}
>
Pools with unsupported tokens
</CustomTab>
Expand Down

0 comments on commit 5d74696

Please sign in to comment.