From 0cbac411d8fbcc1d1f4e99ad75c245d1ea930b5c Mon Sep 17 00:00:00 2001
From: valentunn <70131744+valentunn@users.noreply.github.com>
Date: Mon, 11 Sep 2023 16:51:21 +0700
Subject: [PATCH] Nomination pool/UI fixes (#1105)
* Fix button colors
* Fix start staking more info text
* Fix validation progress restoration after warning confirmation
---
.../nova/common/validation/ValidationExecutor.kt | 5 +++--
common/src/main/res/drawable/primary_chip_background.xml | 2 +-
common/src/main/res/drawable/secondary_chip_background.xml | 2 +-
common/src/main/res/values/colors.xml | 3 ++-
common/src/main/res/values/strings.xml | 4 ++--
.../repository/ParachainStakingConstantsRepository.kt | 2 +-
.../staking/start/landing/StartStakingLandingViewModel.kt | 1 +
7 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/common/src/main/java/io/novafoundation/nova/common/validation/ValidationExecutor.kt b/common/src/main/java/io/novafoundation/nova/common/validation/ValidationExecutor.kt
index fb40f0467e..68f2d9b8f7 100644
--- a/common/src/main/java/io/novafoundation/nova/common/validation/ValidationExecutor.kt
+++ b/common/src/main/java/io/novafoundation/nova/common/validation/ValidationExecutor.kt
@@ -59,6 +59,7 @@ class ValidationExecutor : Validatable {
payload = payload,
autoFixPayload = autoFixPayload,
notValidStatus = it,
+ progressConsumer = progressConsumer,
revalidate = { newPayload ->
scope.launch {
requireValid(
@@ -102,8 +103,8 @@ class ValidationExecutor : Validatable {
private fun
createFlowActions(
payload: P,
- progressConsumer: ProgressConsumer? = null,
- autoFixPayload: (original: P, failureStatus: S) -> P = { original, _ -> original },
+ progressConsumer: ProgressConsumer?,
+ autoFixPayload: (original: P, failureStatus: S) -> P,
notValidStatus: ValidationStatus.NotValid,
revalidate: (newPayload: P) -> Unit,
successBlock: (newPayload: P) -> Unit,
diff --git a/common/src/main/res/drawable/primary_chip_background.xml b/common/src/main/res/drawable/primary_chip_background.xml
index 91500f9cb0..3a61cd89e1 100644
--- a/common/src/main/res/drawable/primary_chip_background.xml
+++ b/common/src/main/res/drawable/primary_chip_background.xml
@@ -10,7 +10,7 @@
-
-
+
diff --git a/common/src/main/res/drawable/secondary_chip_background.xml b/common/src/main/res/drawable/secondary_chip_background.xml
index 92769fa81d..70cadaf58e 100644
--- a/common/src/main/res/drawable/secondary_chip_background.xml
+++ b/common/src/main/res/drawable/secondary_chip_background.xml
@@ -21,7 +21,7 @@
-
-
+
diff --git a/common/src/main/res/values/colors.xml b/common/src/main/res/values/colors.xml
index fd450040dc..214f5012c9 100644
--- a/common/src/main/res/values/colors.xml
+++ b/common/src/main/res/values/colors.xml
@@ -80,7 +80,8 @@
#2FC864
#E53450
#1A999EC7
- #1A999EC7
+ #181920
+
#353D67
#101636
diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml
index 16a39f1edf..d999b8e7f1 100644
--- a/common/src/main/res/values/strings.xml
+++ b/common/src/main/res/values/strings.xml
@@ -139,9 +139,9 @@
participate in governance
Monitor your stake
- Rewards & staking status vary over time. %s from time to time
+ Rewards and staking status vary over time. %s from time to time
- Find out more information about\nMoonbeam staking over at the %s
+ Find out more information about\n%1$s staking over at the %2$s
Nova Wiki
See %s
diff --git a/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/data/parachainStaking/repository/ParachainStakingConstantsRepository.kt b/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/data/parachainStaking/repository/ParachainStakingConstantsRepository.kt
index cb88fab49e..688d23d683 100644
--- a/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/data/parachainStaking/repository/ParachainStakingConstantsRepository.kt
+++ b/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/data/parachainStaking/repository/ParachainStakingConstantsRepository.kt
@@ -39,7 +39,7 @@ class RuntimeParachainStakingConstantsRepository(
override suspend fun minimumDelegatorStake(chainId: ChainId): BigInteger {
return numberConstantOrNull(chainId, "MinDelegatorStk")
- // Starting from runtime 1500, MinDelegatorStk was removed and only MinDelegation remained
+ // Starting from runtime 2500, MinDelegatorStk was removed and only MinDelegation remained
?: minimumDelegation(chainId)
}
diff --git a/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/presentation/staking/start/landing/StartStakingLandingViewModel.kt b/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/presentation/staking/start/landing/StartStakingLandingViewModel.kt
index cfcef52d75..ee2feca9d8 100644
--- a/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/presentation/staking/start/landing/StartStakingLandingViewModel.kt
+++ b/feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/presentation/staking/start/landing/StartStakingLandingViewModel.kt
@@ -223,6 +223,7 @@ class StartStakingLandingViewModel(
return SpannableFormatter.format(
resourceManager.getString(R.string.start_staking_fragment_more_info),
+ chain.name,
clickablePart
)
}