-
Notifications
You must be signed in to change notification settings - Fork 319
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
[Customer Center] SubscriptionDetailsView gets its strings from CommonLocalizedString. #4083
[Customer Center] SubscriptionDetailsView gets its strings from CommonLocalizedString. #4083
Conversation
RevenueCatUI/CustomerCenter/Views/ManageSubscriptionsView.swift
Outdated
Show resolved
Hide resolved
124e143
to
4645dd1
Compare
96df80f
to
60ae1dc
Compare
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.
Looks great!
var explanation: String { | ||
return subscriptionInformation.active ? ( | ||
subscriptionInformation.willRenew ? | ||
localization.commonLocalizedString(for: .subEarliestRenewal) : | ||
localization.commonLocalizedString(for: .subEarliestExpiration) | ||
) : localization.commonLocalizedString(for: .subExpired) | ||
} |
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.
NABD but any reason to keep this as a computed property? Or could we simplify it like this
var explanation: String { | |
return subscriptionInformation.active ? ( | |
subscriptionInformation.willRenew ? | |
localization.commonLocalizedString(for: .subEarliestRenewal) : | |
localization.commonLocalizedString(for: .subEarliestExpiration) | |
) : localization.commonLocalizedString(for: .subExpired) | |
} | |
var explanation = subscriptionInformation.active ? ( | |
subscriptionInformation.willRenew ? | |
localization.commonLocalizedString(for: .subEarliestRenewal) : | |
localization.commonLocalizedString(for: .subEarliestExpiration) | |
) : localization.commonLocalizedString(for: .subExpired) |
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.
No reason! I even asked ChatGPT if this was idiomatic SwiftUI haha. Thanks for the suggestion! Please keep em coming.
I'll do this here and for expirationString
below.
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.
This is now done: 2fc4bb6
60ae1dc
to
bedd434
Compare
dcbfb7d
into
integration/customer_support_workflow
As the title says.
SubscriptionDetailsView
gets its strings fromCommonLocalizedString
.SubscriptionInformation
.SubscriptionInformation
having to care about localization, and having to add@available
annotations, since it's only available on iOS 15 and up.