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

PayID tab UI elements #2012

Open
wants to merge 8 commits into
base: payto-base
Choose a base branch
from
Open

PayID tab UI elements #2012

wants to merge 8 commits into from

Conversation

neelSharma12
Copy link
Contributor

@neelSharma12 neelSharma12 commented Feb 12, 2025

Summary

- Added Identifier picker UI. - Added First name input field. - Added last name input field.

Ticket

COIOS-865

Simulator Screenshot - iPhone 16 - 2025-02-12 at 09 33 46
Simulator Screenshot - iPhone 16 - 2025-02-12 at 09 26 29

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not contain a valid label. Please add one of the following labels: ['new', 'changed', 'fixed', 'removed', 'deprecated', 'chore', 'improvement']

@neelSharma12 neelSharma12 added the new a pull request that adds a new feature label Feb 12, 2025
}

public var identifier: String {
switch self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be self.rawValue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is added in case we need different identifier from rawValue for api call.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case rawValue can and should be identifier. What else is there to make this enum's elements unique? Nice catch!

}

let item = FormStringPickerItem(
preselectedIdentifier: selectableValues[0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be a crash

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the selectableValues is nil?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the list is are empty accessing the first element will crash - ideally use selectableValues.first and try to unwrap the optional

context: Dummy.context
)

setupRootViewController(sut.viewController)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sut.viewController.loadIfNeeded()


// MARK: - Private

private func contentView(formVC: FormViewController) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these used for? The function name could be a bit more descriptive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is for constructing UI but I can rename it :)

Copy link
Contributor

✅ No changes detected

Comparing payID-ui to payto-base


Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCashAppPay, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenWeChatPay


// MARK: - Private

private func payIDContentView(formVC: FormViewController) {
Copy link
Contributor

@goergisn goergisn Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function still does not really say what it does - based on the name I'd assume it returns a contentView but it actually appends item to the form.

Maybe instead call it func appendNameInputItems(to formVC: FormViewController) or something similar to not have to go through the function implementation to figure out what it does.

Also if the function is only used once - it might be even ok to move the calls from the function body to the call site. So all the appending to the form happens in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new a pull request that adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants