diff --git a/src/components/Modal/DeauthorizeApplicationModal/InititateDeauthorization.tsx b/src/components/Modal/DeauthorizeApplicationModal/InititateDeauthorization.tsx index 618dd8671..3825cee75 100644 --- a/src/components/Modal/DeauthorizeApplicationModal/InititateDeauthorization.tsx +++ b/src/components/Modal/DeauthorizeApplicationModal/InititateDeauthorization.tsx @@ -24,6 +24,7 @@ import shortenAddress from "../../../utils/shortenAddress" import TokenBalance from "../../TokenBalance" import { StakingAppName } from "../../../store/staking-applications" import { useInitiateDeauthorization } from "../../../hooks/staking-applications" +import { getSakingAppLabel } from "../../../utils/getStakingAppLabel" const InitiateDeauthorization: FC<{ closeModal: () => void @@ -44,7 +45,8 @@ const InitiateDeauthorization: FC<{
- You're about to initiate the decrease of your TBTC authoriation. + You're about to initiate the decrease of your{" "} + {getSakingAppLabel(stakingAppName)} authorization.
Initiation and confirmation of deauthorization is a two step action. diff --git a/src/components/Modal/MapOperatorToStakingProviderModal/index.tsx b/src/components/Modal/MapOperatorToStakingProviderModal/index.tsx index 8e88e6217..52680f849 100644 --- a/src/components/Modal/MapOperatorToStakingProviderModal/index.tsx +++ b/src/components/Modal/MapOperatorToStakingProviderModal/index.tsx @@ -106,11 +106,11 @@ const MapOperatorToStakingProviderModal: FC = () => { mb={"5"} > {isOperatorMappedOnlyInRandomBeacon ? ( - tbtc app + tBTC app ) : isOperatorMappedOnlyInTbtc ? ( random beacon app ) : ( - TBTC + Random Beacon apps (requires 2txs) + tBTC + Random Beacon apps (requires 2txs) )} { > For each stake, there are three applications available. PRE does not - require authorization. To authorize TBTC and Random Beacon, go to + require authorization. To authorize tBTC and Random Beacon, go to the Staking Page and select “Configure Stake”. @@ -212,7 +212,7 @@ const StakingTimeline: FC<{ statuses?: FlowStepStatus[] } & StackProps> = ({ status={statuses[1] ?? FlowStepStatus.inactive} > For each stake, there are three applications available. PRE does not - require authorization. To authorize TBTC and Random Beacon, go to the{" "} + require authorization. To authorize tBTC and Random Beacon, go to the{" "} Staking page and select “Configure Stake”. { - Authorize TBTC + Authorize tBTC { isFullWidth variant="outline" > - TBTC Node Docs + tBTC Node Docs } diff --git a/src/pages/Staking/StakeDetailsPage/index.tsx b/src/pages/Staking/StakeDetailsPage/index.tsx index 1350dc1b0..da10ae012 100644 --- a/src/pages/Staking/StakeDetailsPage/index.tsx +++ b/src/pages/Staking/StakeDetailsPage/index.tsx @@ -117,7 +117,7 @@ const StakeDetailsPage: FC = () => { - + diff --git a/src/utils/getStakingAppLabel.ts b/src/utils/getStakingAppLabel.ts new file mode 100644 index 000000000..f8ce7ec95 --- /dev/null +++ b/src/utils/getStakingAppLabel.ts @@ -0,0 +1,21 @@ +import { threshold } from "./getThresholdLib" +import { StakingAppName } from "../store/staking-applications" + +const stakingAppNameToAppLabel: Record = { + tbtc: "tBTC", + randomBeacon: "Random Beacon", +} + +const stakingAppAddressToName: { [key: string]: string } = { + [threshold.multiAppStaking.ecdsa.address]: stakingAppNameToAppLabel.tbtc, + [threshold.multiAppStaking.randomBeacon.address]: + stakingAppNameToAppLabel.randomBeacon, +} + +export const getStakingAppNameFromAddress = (stakingAppAddress: string) => { + return stakingAppAddressToName[stakingAppAddress] ?? "App" +} + +export const getSakingAppLabel = (stakingAppName: StakingAppName) => { + return stakingAppNameToAppLabel[stakingAppName] +} diff --git a/src/utils/getStakingAppNameFromAddress.ts b/src/utils/getStakingAppNameFromAddress.ts deleted file mode 100644 index dbfe61051..000000000 --- a/src/utils/getStakingAppNameFromAddress.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { threshold } from "./getThresholdLib" - -const stakingAppAddressToName: { [key: string]: string } = { - [threshold.multiAppStaking.ecdsa.address]: "TBTC", - [threshold.multiAppStaking.randomBeacon.address]: "Random Beacon", -} - -export const getStakingAppNameFromAddress = (stakingAppAddress: string) => { - return stakingAppAddressToName[stakingAppAddress] ?? "App" -}