diff --git a/Kickstarter-iOS/Views/Controllers/PledgeAmountViewController.swift b/Kickstarter-iOS/Views/Controllers/PledgeAmountViewController.swift index 2d8fa27a95..b5ba693681 100644 --- a/Kickstarter-iOS/Views/Controllers/PledgeAmountViewController.swift +++ b/Kickstarter-iOS/Views/Controllers/PledgeAmountViewController.swift @@ -220,4 +220,5 @@ private let maxPledgeAmountErrorLabelStyle: LabelStyle = { label in |> \.font .~ UIFont.ksr_caption1() |> \.numberOfLines .~ 0 |> \.textColor .~ UIColor.ksr_red_400 + |> \.textAlignment .~ .right } diff --git a/Library/ViewModels/PledgeAmountViewModel.swift b/Library/ViewModels/PledgeAmountViewModel.swift index 7c0ed2b7f9..507ec16e61 100644 --- a/Library/ViewModels/PledgeAmountViewModel.swift +++ b/Library/ViewModels/PledgeAmountViewModel.swift @@ -155,14 +155,12 @@ public final class PledgeAmountViewModel: PledgeAmountViewModelType, .skipRepeats() self.maxPledgeAmountErrorLabelText = updatedValue - .map { ($0.0, $0.1) } + .map(second) .combineLatest(with: project) - .map(unpack) - .map { min, max, project in - - Strings.Please_enter_a_pledge_amount_between_min_and_max( - min: Format.currency(min, country: project.country, omitCurrencyCode: false), - max: Format.currency(max, country: project.country, omitCurrencyCode: false) + .map { max, project in + Strings.The_maximum_pledge_is_max_pledge( + max_pledge: + Format.currency(max, country: project.country, omitCurrencyCode: false) ) } .skipRepeats() diff --git a/Library/ViewModels/PledgeAmountViewModelTests.swift b/Library/ViewModels/PledgeAmountViewModelTests.swift index ea14926f5f..391e261c91 100644 --- a/Library/ViewModels/PledgeAmountViewModelTests.swift +++ b/Library/ViewModels/PledgeAmountViewModelTests.swift @@ -891,14 +891,14 @@ internal final class PledgeAmountViewModelTests: TestCase { self.vm.inputs.stepperValueChanged(10_100) self.maxPledgeAmountErrorLabelText.assertValues([ - "Please enter a pledge amount between US$ 25 and US$ 10,000." + "The maximum pledge is US$ 10,000." ]) self.vm.inputs.selectedShippingAmountChanged(to: 30.0) self.maxPledgeAmountErrorLabelText.assertValues([ - "Please enter a pledge amount between US$ 25 and US$ 10,000.", - "Please enter a pledge amount between US$ 25 and US$ 9,970." + "The maximum pledge is US$ 10,000.", + "The maximum pledge is US$ 9,970." ]) } diff --git a/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_ErrorMessageAppears_And_TextColorIsRedWhenAboveMaximumPledgeAmount_device_pad@2x.png b/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_ErrorMessageAppears_And_TextColorIsRedWhenAboveMaximumPledgeAmount_device_pad@2x.png index 82627c9854..831f05800b 100644 Binary files a/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_ErrorMessageAppears_And_TextColorIsRedWhenAboveMaximumPledgeAmount_device_pad@2x.png and b/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_ErrorMessageAppears_And_TextColorIsRedWhenAboveMaximumPledgeAmount_device_pad@2x.png differ diff --git a/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_ErrorMessageAppears_And_TextColorIsRedWhenAboveMaximumPledgeAmount_device_phone4_7inch@2x.png b/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_ErrorMessageAppears_And_TextColorIsRedWhenAboveMaximumPledgeAmount_device_phone4_7inch@2x.png index b633dac129..14cece0c95 100644 Binary files a/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_ErrorMessageAppears_And_TextColorIsRedWhenAboveMaximumPledgeAmount_device_phone4_7inch@2x.png and b/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_ErrorMessageAppears_And_TextColorIsRedWhenAboveMaximumPledgeAmount_device_phone4_7inch@2x.png differ diff --git a/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_StepperIncrementButtonDisabled_WhenStepperValueSetToMaximumStepperValue_device_pad@2x.png b/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_StepperIncrementButtonDisabled_WhenStepperValueSetToMaximumStepperValue_device_pad@2x.png index fd075f5838..3f1087f0bf 100644 Binary files a/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_StepperIncrementButtonDisabled_WhenStepperValueSetToMaximumStepperValue_device_pad@2x.png and b/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_StepperIncrementButtonDisabled_WhenStepperValueSetToMaximumStepperValue_device_pad@2x.png differ diff --git a/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_StepperIncrementButtonDisabled_WhenStepperValueSetToMaximumStepperValue_device_phone4_7inch@2x.png b/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_StepperIncrementButtonDisabled_WhenStepperValueSetToMaximumStepperValue_device_phone4_7inch@2x.png index c839b18c4c..336eed0b0c 100644 Binary files a/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_StepperIncrementButtonDisabled_WhenStepperValueSetToMaximumStepperValue_device_phone4_7inch@2x.png and b/Screenshots/_64/Kickstarter_Framework_iOSTests.PledgeAmountViewControllerTests/testView_StepperIncrementButtonDisabled_WhenStepperValueSetToMaximumStepperValue_device_phone4_7inch@2x.png differ