From 5aec1439e2ecb48f6088888c6646bf0f99762931 Mon Sep 17 00:00:00 2001 From: Hien Le Date: Fri, 12 Apr 2024 14:26:55 +0700 Subject: [PATCH] fix: header --- app/[server]/page.tsx | 10 +- app/globals.css | 4 - app/layout.tsx | 8 + app/verify/page.tsx | 27 +- components/footer.tsx | 57 ++- components/header/left-slot.tsx | 13 +- components/header/network-button.tsx | 30 ++ components/header/right-slot.tsx | 2 + components/overview/FlexibleStakingCard.tsx | 14 +- components/profile-dropdown.tsx | 333 +++++++++--------- .../stake/flexible/flexible-stake-content.tsx | 80 +---- hooks/useWalletNetwork.ts | 87 +++++ store/wallet-balance.ts | 164 +++++++++ store/wallet.ts | 83 ----- utils/number.ts | 10 + utils/tryCatch.ts | 11 + 16 files changed, 536 insertions(+), 397 deletions(-) create mode 100644 components/header/network-button.tsx create mode 100644 hooks/useWalletNetwork.ts create mode 100644 store/wallet-balance.ts delete mode 100644 store/wallet.ts create mode 100644 utils/tryCatch.ts diff --git a/app/[server]/page.tsx b/app/[server]/page.tsx index 8548c16..e27d9e8 100644 --- a/app/[server]/page.tsx +++ b/app/[server]/page.tsx @@ -18,7 +18,7 @@ import { Header } from "@/components/header/header"; const Overview = () => { const { isLoggedIn } = useLoginWidget(); - const { stakingPools, fetchStakingPools } = useTokenStaking(); + const { stakingPools } = useTokenStaking(); const { balance, stakedAmount, @@ -28,10 +28,6 @@ const Overview = () => { } = useFlexibleStaking(); const [showInfo, setShowInfo] = useState(false); - useEffect(() => { - fetchStakingPools(); - }, [fetchStakingPools]); - useEffect(() => { if (!!balance && !showInfo) { setShowInfo(true); @@ -158,7 +154,7 @@ const Overview = () => { )} - {/*
= 2, "lg:grid-cols-3": stakingPools.length >= 3, @@ -173,7 +169,7 @@ const Overview = () => { {stakingPools.some((each) => each.type === "nft") && (
*/} +