From e912fba62520801109d6bf5fb9953c86ec8c3e58 Mon Sep 17 00:00:00 2001 From: jeremy-babylonchain Date: Thu, 12 Dec 2024 17:43:09 +0800 Subject: [PATCH] resolve comments --- src/app/components/Delegations/Delegation.tsx | 4 +- .../FinalityProviderFilter.tsx | 4 +- .../FinalityProviderSearch.tsx | 4 +- .../FinalityProviderSubtitle.tsx | 9 -- .../FinalityProviderTable.tsx | 126 +++++++++++------- .../FinalityProviderTableStatusView.tsx | 14 +- .../FinalityProviderTitle.tsx | 9 -- .../FinalityProviders/FinalityProviders.tsx | 12 +- .../state/FinalityProviderServiceState.tsx | 45 ------- .../FinalityProviderState.tsx} | 120 +++++++++++++---- src/app/state/index.tsx | 8 +- .../components/FinalityProviderMoniker.tsx | 4 +- 12 files changed, 189 insertions(+), 170 deletions(-) delete mode 100644 src/app/components/Staking/FinalityProviders/FinalityProviderSubtitle.tsx delete mode 100644 src/app/components/Staking/FinalityProviders/FinalityProviderTitle.tsx delete mode 100644 src/app/state/FinalityProviderServiceState.tsx rename src/app/{hooks/services/useFinalityProviderService.ts => state/FinalityProviderState.tsx} (51%) diff --git a/src/app/components/Delegations/Delegation.tsx b/src/app/components/Delegations/Delegation.tsx index 14f7e771..a59283cf 100644 --- a/src/app/components/Delegations/Delegation.tsx +++ b/src/app/components/Delegations/Delegation.tsx @@ -4,12 +4,12 @@ import { FaBitcoin } from "react-icons/fa"; import { IoIosWarning } from "react-icons/io"; import { Tooltip } from "react-tooltip"; -import { useFinalityProviderService } from "@/app/hooks/services/useFinalityProviderService"; import { type SigningStep, useTransactionService, } from "@/app/hooks/services/useTransactionService"; import { useHealthCheck } from "@/app/hooks/useHealthCheck"; +import { useFinalityProviderState } from "@/app/state/FinalityProviderState"; import { type Delegation as DelegationInterface, DelegationState, @@ -48,7 +48,7 @@ export const Delegation: React.FC = ({ const [currentTime, setCurrentTime] = useState(Date.now()); const { isApiNormal, isGeoBlocked } = useHealthCheck(); const { transitionPhase1Delegation } = useTransactionService(); - const { getFinalityProviderMoniker } = useFinalityProviderService(); // get the moniker of the finality provider + const { getFinalityProviderMoniker } = useFinalityProviderState(); // get the moniker of the finality provider useEffect(() => { const timerId = setInterval(() => { setCurrentTime(Date.now()); diff --git a/src/app/components/Staking/FinalityProviders/FinalityProviderFilter.tsx b/src/app/components/Staking/FinalityProviders/FinalityProviderFilter.tsx index ad460e8c..ed4abb4c 100644 --- a/src/app/components/Staking/FinalityProviders/FinalityProviderFilter.tsx +++ b/src/app/components/Staking/FinalityProviders/FinalityProviderFilter.tsx @@ -1,6 +1,6 @@ import { Select } from "@babylonlabs-io/bbn-core-ui"; -import { useFinalityProviderService } from "@/app/hooks/services/useFinalityProviderService"; +import { useFinalityProviderState } from "@/app/state/FinalityProviderState"; const options = [ { value: "active", label: "Active" }, @@ -8,7 +8,7 @@ const options = [ ]; export const FinalityProviderFilter = () => { - const { filterValue, handleFilter } = useFinalityProviderService(); + const { filterValue, handleFilter } = useFinalityProviderState(); return (