Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update copy: tBTC #273

Merged
merged 3 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -44,7 +45,8 @@ const InitiateDeauthorization: FC<{
<ModalBody>
<InfoBox variant="modal">
<H5 mb={4}>
You're about to initiate the decrease of your TBTC authoriation.
You're about to initiate the decrease of your{" "}
{getSakingAppLabel(stakingAppName)} authorization.
</H5>
<BodyLg>
Initiation and confirmation of deauthorization is a two step action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ const MapOperatorToStakingProviderModal: FC<BaseModalProps> = () => {
mb={"5"}
>
{isOperatorMappedOnlyInRandomBeacon ? (
<LabelSm>tbtc app</LabelSm>
<LabelSm>tBTC app</LabelSm>
) : isOperatorMappedOnlyInTbtc ? (
<LabelSm>random beacon app</LabelSm>
) : (
<LabelSm>TBTC + Random Beacon apps (requires 2txs)</LabelSm>
<LabelSm>tBTC + Random Beacon apps (requires 2txs)</LabelSm>
)}
<StakeAddressInfo stakingProvider={account ? account : AddressZero} />
<MapOperatorToStakingProviderForm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { formatTokenAmount } from "../../../utils/formatAmount"
import { ExplorerDataType } from "../../../utils/createEtherscanLink"
import { ExternalHref } from "../../../enums"
import { BaseModalProps } from "../../../types"
import { getStakingAppNameFromAddress } from "../../../utils/getStakingAppNameFromAddress"
import { getStakingAppNameFromAddress } from "../../../utils/getStakingAppLabel"
import StakingTimeline from "../../StakingTimeline"
import ButtonLink from "../../ButtonLink"

Expand Down
4 changes: 2 additions & 2 deletions src/components/StakingTimeline/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const LegacyStakesDepositSteps: FC = () => {
>
<BodyMd>
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 <Link to="/staking">Staking Page</Link> and select “Configure
Stake”.
</BodyMd>
Expand Down Expand Up @@ -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{" "}
<Link to="/staking">Staking page</Link> and select “Configure Stake”.
</FlowStep>
<FlowStep
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Staking/HowItWorks/StakingApplications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,22 @@ const StakingApplications: PageComponent = () => {
</Stack>
<Stack spacing={6}>
<ApplicationDetailsCard
preTitle="TBTC APP"
preTitle="tBTC APP"
title="tBTC is the only truly decentralized solution for bridging Bitcoin to Ethereum."
description="tBTC replaces a centralized custodian with a randomly selected group of operators running nodes on the Threshold Network. This group of independent operators works together to secure your deposited Bitcoin through threshold cryptography."
imgSrc={iconMap.tbtc[colorMode]}
ctaButtons={
<VStack mb={6}>
<ButtonLink to="/staking" isFullWidth>
Authorize TBTC
Authorize tBTC
</ButtonLink>
<ButtonLink
isExternal
href={ExternalHref.tbtcNodeDocs}
isFullWidth
variant="outline"
>
TBTC Node Docs
tBTC Node Docs
</ButtonLink>
</VStack>
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Staking/StakeDetailsPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const StakeDetailsPage: FC = () => {
<StakeDetailRow label="PRE Node Status">
<NodeStatusLabel isAuthorized />
</StakeDetailRow>
<StakeDetailRow label="TBTC Node Status">
<StakeDetailRow label="tBTC Node Status">
<NodeStatusLabel isAuthorized={tbtcApp.isAuthorized} />
</StakeDetailRow>
<StakeDetailRow label="Random Beacon Node Status">
Expand Down
21 changes: 21 additions & 0 deletions src/utils/getStakingAppLabel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { threshold } from "./getThresholdLib"
import { StakingAppName } from "../store/staking-applications"

const stakingAppNameToAppLabel: Record<StakingAppName, string> = {
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]
}
10 changes: 0 additions & 10 deletions src/utils/getStakingAppNameFromAddress.ts

This file was deleted.