Skip to content

Commit

Permalink
fix tooltip and pending registration
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-babylonlabs committed Jan 12, 2025
1 parent 72f2313 commit f110d27
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 36 deletions.
8 changes: 2 additions & 6 deletions src/app/components/Delegations/Delegation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
type Delegation as DelegationInterface,
DelegationState,
} from "@/app/types/delegations";
import { Hint } from "@/components/common/Hint";
import { getNetworkConfigBTC } from "@/config/network/btc";
import { satoshiToBtc } from "@/utils/btc";
import { getState, getStateTooltip } from "@/utils/getState";
Expand All @@ -23,7 +24,6 @@ import { trim } from "@/utils/trim";
import { VerificationModal } from "../Modals/VerificationModal";

import { DelegationCell } from "./components/DelegationCell";
import { DelegationStatus } from "./components/DelegationStatus";
import { OverflowBadge } from "./components/OverflowBadge";

interface DelegationProps {
Expand Down Expand Up @@ -148,11 +148,7 @@ export const Delegation: React.FC<DelegationProps> = ({
order="order-5"
className="relative flex justify-end lg:justify-start"
>
<DelegationStatus
state={renderState()}
tooltip={renderStateTooltip()}
stakingTxHashHex={stakingTxHashHex}
/>
<Hint tooltip={renderStateTooltip()}>{renderState()}</Hint>
</DelegationCell>

<DelegationCell order="order-6">
Expand Down
27 changes: 0 additions & 27 deletions src/app/components/Delegations/components/DelegationStatus.tsx

This file was deleted.

4 changes: 3 additions & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ body.modal-open {

.tooltip-wrap {
max-width: 25rem;
white-space: normal;
white-space: pre-wrap;
word-wrap: break-word;
height: fit-content !important;
z-index: 9999;
}

.tooltip-wrap[data-popper-placement*="top"] .tooltip-arrow {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/getState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const getState = (state: string) => {
case DelegationState.INTERMEDIATE_WITHDRAWAL:
return "Withdrawal Submitted";
case DelegationState.INTERMEDIATE_TRANSITIONING:
return "Transitioning";
return "Active/Pending Registration";
case DelegationState.TRANSITIONED:
return "Transitioned";
default:
Expand Down Expand Up @@ -57,7 +57,7 @@ export const getStateTooltip = (state: string) => {
case DelegationState.INTERMEDIATE_WITHDRAWAL:
return "Withdrawal transaction pending confirmation on Bitcoin";
case DelegationState.INTERMEDIATE_TRANSITIONING:
return `Stake is transitioning to the ${bbnNetworkFullName} network`;
return `Stake is pending registration to the ${bbnNetworkFullName} network`;
case DelegationState.TRANSITIONED:
return `Stake has been transitioned to the ${bbnNetworkFullName} network`;
default:
Expand Down

0 comments on commit f110d27

Please sign in to comment.