-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[NT-262] Remember this card UI #848
Changes from 7 commits
2ee766a
ac82294
8779b12
1fe85fb
fa3a55d
3fd0ed0
ff214a1
16fcd81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -22,6 +22,10 @@ internal final class AddNewCardViewController: UIViewController, | |||||||
@IBOutlet private var creditCardTextField: STPPaymentCardTextField! | ||||||||
@IBOutlet private var creditCardValidationErrorLabel: UILabel! | ||||||||
@IBOutlet private var creditCardValidationErrorContainer: UIView! | ||||||||
@IBOutlet private var reusableCardStackViewContainer: UIView! | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooooh, good old storyboard thingys 🍿 |
||||||||
@IBOutlet private var reusableCardStackView: UIStackView! | ||||||||
@IBOutlet private var reusableCardLabel: UILabel! | ||||||||
@IBOutlet private var reusableCardSwitch: UISwitch! | ||||||||
@IBOutlet private var scrollView: UIScrollView! | ||||||||
@IBOutlet private var stackView: UIStackView! | ||||||||
@IBOutlet private var zipcodeView: SettingsFormFieldView! | ||||||||
|
@@ -46,6 +50,10 @@ internal final class AddNewCardViewController: UIViewController, | |||||||
return Storyboard.Settings.instantiate(AddNewCardViewController.self) | ||||||||
} | ||||||||
|
||||||||
func configure(with intent: AddNewCardIntent) { | ||||||||
self.viewModel.inputs.configure(with: intent) | ||||||||
} | ||||||||
|
||||||||
override func viewDidLoad() { | ||||||||
super.viewDidLoad() | ||||||||
|
||||||||
|
@@ -125,9 +133,6 @@ internal final class AddNewCardViewController: UIViewController, | |||||||
_ = self.scrollView | ||||||||
|> \.alwaysBounceVertical .~ true | ||||||||
|
||||||||
_ = self.stackView | ||||||||
|> \.layoutMargins .~ .init(leftRight: Styles.grid(2)) | ||||||||
|
||||||||
_ = self.zipcodeView.titleLabel | ||||||||
|> \.text %~ { _ in | ||||||||
localizedPostalCode() | ||||||||
|
@@ -136,11 +141,25 @@ internal final class AddNewCardViewController: UIViewController, | |||||||
_ = self.zipcodeView | ||||||||
|> \.autocapitalizationType .~ .allCharacters | ||||||||
|> \.returnKeyType .~ .done | ||||||||
|
||||||||
_ = self.reusableCardLabel | ||||||||
|> \.font .~ .ksr_body() | ||||||||
|> \.text %~ { _ in Strings.Remember_this_card() } | ||||||||
|
||||||||
_ = self.reusableCardStackView | ||||||||
|> checkoutAdaptableStackViewStyle( | ||||||||
self.traitCollection.preferredContentSizeCategory.isAccessibilityCategory | ||||||||
) | ||||||||
|
||||||||
_ = self.reusableCardSwitch | ||||||||
|> baseSwitchControlStyle | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we would only have 1 accessible element (the toggle - whose focus area would be the whole cell) but because we're faking a table view cell here we don't get that functionality...so because of that I think we should also add VoiceOver label on the switch that will simply duplicate the label but since it's a
Suggested change
(not sure if this will pass SwiftFormat) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also note that there seems to be an issue with Basically even if you align right edges the switch still overlaps a little. Checked this out in view inspector. Basically what helped was to align left edge of the switch to the right edge of superview minus the switch width. |
||||||||
} | ||||||||
|
||||||||
override func bindViewModel() { | ||||||||
super.bindViewModel() | ||||||||
|
||||||||
self.reusableCardStackViewContainer.rac.hidden = self.viewModel.outputs.reusableCardSwitchIsHidden | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we order this alphabetically (so before the |
||||||||
|
||||||||
self.creditCardValidationErrorContainer.rac.hidden = | ||||||||
self.viewModel.outputs.creditCardValidationErrorContainerHidden | ||||||||
self.cardholderNameTextField.rac.becomeFirstResponder = | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alphabetize