-
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
)
|
||
/// 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
)
return AsyncStream { continuation in | ||
self.selectedMethodContinuation = continuation | ||
continuation.yield(self._selectedMethod) | ||
// TODO: Implement dynamic updates if the selection changes. |
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 t...). (todo
)
Text("Apple Pay UI for \(method.name)") | ||
.font(.headline) | ||
.padding() | ||
// TODO: Add Apple Pay-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 Apple Pay-specific UI elem...). (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
)
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 c01c621 |
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?
self.clientToken = clientToken | ||
self.onPaymentFinished = onPaymentFinished | ||
self.customContent = nil | ||
// TODO: Validate the client token if necessary. |
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 (Validate the client token if n...). (todo
)
self.clientToken = clientToken | ||
self.onPaymentFinished = onPaymentFinished | ||
self.customContent = customContent | ||
// TODO: Validate the client token if necessary. |
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 (Validate the client token if n...). (todo
)
} | ||
.padding() | ||
.task { | ||
async let _ = await viewModel.loadPaymentMethods() |
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.
⚠️ Prefer_ = foo()
overlet _ = foo()
when discarding a result from a function. (redundant_discardable_let
)
c69ac71
to
e1f3d85
Compare
|
b767d9e
to
dc87349
Compare
7851c12
to
6b2a93e
Compare
ff17eb1
to
b1c6e64
Compare
b1c6e64
to
ad68c0e
Compare
ef4abec
to
cbdc264
Compare
import SwiftUI | ||
|
||
extension Color { | ||
/// Initializes a Color from a hex string (e.g. "#f5f5f5" or "f5f5f5"). |
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.
⚠️ A doc comment should be attached to a declaration. (orphaned_doc_comment
)
8968212
to
7656ea1
Compare
This is a WIP PR for all the Components related work for now, keeping it in the draft.
Screen.Recording.2025-02-06.at.16.08.43.mov