Skip to content

[Customer Center] Make colors nullable#4134

Merged
vegaro merged 10 commits into
integration/customer_support_workflowfrom
make-colors-nullable
Aug 1, 2024
Merged

[Customer Center] Make colors nullable#4134
vegaro merged 10 commits into
integration/customer_support_workflowfrom
make-colors-nullable

Conversation

@vegaro

@vegaro vegaro commented Jul 30, 2024

Copy link
Copy Markdown
Member
  • Adapt changes from https://github.com/RevenueCat/khepri/pull/9707/ which makes colors nullable and adds new colors for buttons
  • Change background and text color in all screens
  • Modified buttons to use .buttonStyle(.borderedProminent) so they look native by default
  • Applied accent color to back button in navigation view

@RevenueCat-Danger-Bot

RevenueCat-Danger-Bot commented Jul 31, 2024

Copy link
Copy Markdown
1 Warning
⚠️ This PR increases the size of the repo by more than 100.00 KB (increased by 109.53 KB).

Generated by 🚫 Danger

@vegaro vegaro marked this pull request as ready for review July 31, 2024 17:13
@vegaro vegaro requested a review from a team July 31, 2024 17:14

@fire-at-will fire-at-will left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The changes here look good to me!

Button("Didn't receive purchase") {}
.buttonStyle(ManageSubscriptionsButtonStyle())
.environment(\.appearance, CustomerCenterConfigData.Appearance(mode: .system))
.environment(\.appearance, CustomerCenterConfigData.Appearance(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: It'd be nice to extract this CustomerCenterConfigData.Appearance to a constant somewhere so that it can be reused across previews

@vegaro vegaro requested a review from tonidero August 1, 2024 10:13

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not super-familiar with swift UI but changes LGTM!

textColor: .init(light: "#000000", dark: "#ffffff"),
backgroundColor: .init(light: "#000000", dark: "#ffffff"),
buttonTextColor: .init(light: "#000000", dark: "#ffffff"),
buttonBackgroundColor: .init(light: "#000000", dark: "#ffffff")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should the defaults be all null? So we fallback to the system colors?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

right right, not sure what I was thinking!

.buttonStyle(.borderedProminent)
.controlSize(.large)
.applyIf(background != nil, apply: { $0.tint(background) })
.applyIf(textColor != nil, apply: { $0.foregroundColor(textColor) })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see we're just not applying custom colors if they are null... But I'm wondering if we should customize the default style of these to be the accentColor or something like that... But I'm ok going with just the defaults for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's actually done by .boderedProminent and it's the reason why I am using that style by default, otherwise it would just look like text. So I think we are covered

@vegaro vegaro force-pushed the make-colors-nullable branch from a8442e3 to d779ca1 Compare August 1, 2024 12:33
@vegaro vegaro merged commit 167a609 into integration/customer_support_workflow Aug 1, 2024
@vegaro vegaro deleted the make-colors-nullable branch August 1, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants