From 4bb2cf7ae8bbe518b0117d61eeaa6fec38c262be Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 13 Oct 2022 14:42:35 +0200 Subject: [PATCH 1/3] Update Authorize staking apps modal Add missing word `app` in the staking app card. Fix typo `RANDOMBEACON -> RANDOM BEACON`. --- .../StakingApplications/AuthorizeStakingApps.tsx | 16 ++++++++++++---- src/pages/Staking/AuthorizeStakingApps/index.tsx | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx b/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx index 708191938..1a671afd0 100644 --- a/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx +++ b/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx @@ -26,13 +26,16 @@ import { import { BaseModalProps } from "../../../types" import { useAuthorizeMultipleAppsTransaction } from "../../../hooks/staking-applications" import { useAppSelector } from "../../../hooks/store" -import { selectStakingAppByStakingProvider } from "../../../store/staking-applications" +import { + selectStakingAppByStakingProvider, + StakingAppName, +} from "../../../store/staking-applications" export type AuthorizeAppsProps = BaseModalProps & { stakingProvider: string totalInTStake: string applications: { - appName: string + appName: StakingAppName address: string authorizationAmount: string }[] @@ -105,8 +108,13 @@ const AuthorizeStakingAppsBase: FC = ({ ) } +const stakingAppNameToAppLabel: Record = { + tbtc: "tBTC", + randomBeacon: "Random Beacon", +} + const StakingApplicationToAuth: FC<{ - appName: string + appName: StakingAppName authorizationAmount: string stakingProvider: string totalInTStake: string @@ -121,7 +129,7 @@ const StakingApplicationToAuth: FC<{ - {appName} - {percentage} + {stakingAppNameToAppLabel[appName]} app - {percentage} Authorization Amount diff --git a/src/pages/Staking/AuthorizeStakingApps/index.tsx b/src/pages/Staking/AuthorizeStakingApps/index.tsx index 2f3ef6386..2bbc6d096 100644 --- a/src/pages/Staking/AuthorizeStakingApps/index.tsx +++ b/src/pages/Staking/AuthorizeStakingApps/index.tsx @@ -162,7 +162,7 @@ const AuthorizeStakingAppsPage: FC = () => { stakingProvider: stakingProviderAddress!, totalInTStake: stake.totalInTStake, applications: selectedApps.map((_) => ({ - appName: _.label, + appName: _.stakingAppId, address: stakinAppNameToAddress[_.stakingAppId], authorizationAmount: stakinAppNameToFormRef[_.stakingAppId].current?.values.tokenAmount, From e2e70362c1841f45f453ec2208be78d8e58ba1a6 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 13 Oct 2022 14:46:04 +0200 Subject: [PATCH 2/3] Update authorize staking app modal Add missing denominator- next to the amount of T authorized the T denominator should be displayed. --- .../Modal/StakingApplications/AuthorizeStakingApps.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx b/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx index 1a671afd0..07d8d80c4 100644 --- a/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx +++ b/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx @@ -132,7 +132,12 @@ const StakingApplicationToAuth: FC<{ {stakingAppNameToAppLabel[appName]} app - {percentage} Authorization Amount - + ) From 8be03c5d7c859e494242ff4fc5900c7ed13a6022 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Mon, 24 Oct 2022 16:00:56 +0200 Subject: [PATCH 3/3] Use function instead of a created map In ea991e we added a function that returns the app label based on the staking app type. This commit uses this function instead of a custom map. --- .../Modal/StakingApplications/AuthorizeStakingApps.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx b/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx index 07d8d80c4..54dddc185 100644 --- a/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx +++ b/src/components/Modal/StakingApplications/AuthorizeStakingApps.tsx @@ -30,6 +30,7 @@ import { selectStakingAppByStakingProvider, StakingAppName, } from "../../../store/staking-applications" +import { getSakingAppLabel } from "../../../utils/getStakingAppLabel" export type AuthorizeAppsProps = BaseModalProps & { stakingProvider: string @@ -108,11 +109,6 @@ const AuthorizeStakingAppsBase: FC = ({ ) } -const stakingAppNameToAppLabel: Record = { - tbtc: "tBTC", - randomBeacon: "Random Beacon", -} - const StakingApplicationToAuth: FC<{ appName: StakingAppName authorizationAmount: string @@ -129,7 +125,7 @@ const StakingApplicationToAuth: FC<{ - {stakingAppNameToAppLabel[appName]} app - {percentage} + {getSakingAppLabel(appName)} app - {percentage} Authorization Amount