-
Notifications
You must be signed in to change notification settings - Fork 6
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
feature: Components - breaking the ice #1109
base: master
Are you sure you want to change the base?
Conversation
|
||
/// Returns the current simulated state. | ||
func getState() async -> PaymentMethodState { | ||
// TODO: Replace simulated state with actual state mapping from your processing logic. |
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.
⚠️ TODOs should be resolved (Replace simulated state with a...). (todo
)
|
||
/// Simulate payment submission. | ||
func submit() async -> Result<PaymentResult, Error> { | ||
// TODO: Replace with real payment submission logic. |
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.
⚠️ TODOs should be resolved (Replace with real payment subm...). (todo
)
Text("Default UI for \(method.name)") | ||
.font(.headline) | ||
.padding() | ||
// TODO: Add form fields, validations, and error messaging as needed. |
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.
⚠️ TODOs should be resolved (Add form fields, validations, ...). (todo
)
|
||
/// Initialize with default payment methods. | ||
init() { | ||
// TODO: In a production system, fetch or update available payment methods dynamically. |
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.
⚠️ TODOs should be resolved (In a production system, fetch ...). (todo
)
return AsyncStream { continuation in | ||
self.paymentMethodsContinuation = continuation | ||
continuation.yield(self._paymentMethods) | ||
// TODO: Implement dynamic updates if payment methods change. |
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.
⚠️ TODOs should be resolved (Implement dynamic updates if p...). (todo
)
|
||
/// Returns the current state for PayPal. | ||
func getState() async -> PaymentMethodState { | ||
// TODO: Replace with actual state logic for PayPal. |
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.
⚠️ TODOs should be resolved (Replace with actual state logi...). (todo
)
|
||
/// Submits the PayPal payment. | ||
func submit() async -> Result<PaymentResult, Error> { | ||
// TODO: Implement PayPal-specific submission logic. |
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.
⚠️ TODOs should be resolved (Implement PayPal-specific subm...). (todo
)
Text("PayPal Payment UI for \(method.name)") | ||
.font(.headline) | ||
.padding() | ||
// TODO: Add PayPal-specific UI elements and configuration. |
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.
⚠️ TODOs should be resolved (Add PayPal-specific UI element...). (todo
)
.font(.title) | ||
.padding() | ||
|
||
|
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.
⚠️ Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace
)
PrimerUIManager.primerRootViewController?.show(viewController: pucvc) | ||
|
||
if #available(iOS 15.0, *) { | ||
// TODO: TEMP - JUST FOR TESTING |
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.
⚠️ TODOs should be resolved (TEMP - JUST FOR TESTING). (todo
)
Generated by 🚫 Danger Swift against 997823e |
|
Appetize link: https://appetize.io/app/qwiy3pgfeqhvhlzibaq42h7zm4 |
return .success(PaymentResult(success: true, message: "Payment processed successfully")) | ||
} | ||
|
||
#if canImport(SwiftUI) |
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.
Do we require #canImport(SwiftUI)
given our current iOS target?
This is a WIP PR for all the Components related for now, keeping it in the draft.
Screen.Recording.2025-02-06.at.16.08.43.mov