-
Notifications
You must be signed in to change notification settings - Fork 338
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
[Paywalls V2] Update color spec #4468
Conversation
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 good to me!
One question: Did you mean to remove Tests/TestingApps/PaywallsTester/PaywallsTester/Config/SamplePaywalls.swift
and Tests/TestingApps/PaywallsTester/PaywallsTester/UI/Views/SamplePaywallsList.swift
? I didn't see any mention of it in the PR description so I figured I'd double check
|
||
} | ||
|
||
// struct ColorInfo: Codable, Sendable, Hashable, Equatable { |
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.
Nit: remove commented code
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.
Ha! I did notice this and it gets removed like 2 PRs in 😛
} | ||
} | ||
|
||
public init(from decoder: Decoder) throws { |
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.
I might think about adding in some tests to validate the custom encoding/decoding of the ColorInfo enum. I know from recent experience in Pines that it's easy to make mistakes in these custom enum codable implementations and it's easy to miss until much later in 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.
Yes yes, for sure! Tests coming soon™️
Motivation
Updating color property to hold more types info:
Note: Developers will soon™️ be able to define global colors for the project and paywall components will be able to reference them by name (alias)
ℹ️ This is A LOT of struct-ural changes to make this complie again but no functional changes were made
Description
Previously
Colors were strictly a hex color value
Now
Colors can be a type of
hex
oralias
(a name to a dictionary that will be coming down in the API response with all paywalls that is common on a project)or