Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FXIOS-9109 [Component Library] Disabled state for primary button #20205

Merged

Conversation

cyndichin
Copy link
Contributor

@cyndichin cyndichin commented May 10, 2024

馃摐 Tickets

Jira ticket
Github issue

馃挕 Description

Update our component PrimaryRoundedButton to update its color based on its disabled state.
Added two new tokens actionPrimaryDisabled and textInvertedDisabled

馃摑 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed, I updated documentation / comments for complex code and public methods
  • If needed, added a backport comment (example @Mergifyio backport release/v120)

Screenshots

Dark Light
Simulator Screenshot - iPhone 15 Plus - 2024-05-10 at 15 09 03 Simulator Screenshot - iPhone 15 Plus - 2024-05-10 at 15 09 12

@cyndichin cyndichin marked this pull request as ready for review May 10, 2024 19:03
@cyndichin cyndichin requested a review from a team as a code owner May 10, 2024 19:03
@cyndichin cyndichin requested a review from nbhasin2 May 10, 2024 19:03
@cyndichin cyndichin force-pushed the cc/FXIOS-9109_update-disable-state-for-primary-button branch from d770fab to bc6b676 Compare May 10, 2024 19:08
@cyndichin
Copy link
Contributor Author

cyndichin commented May 10, 2024

@isabelrios @clarmso it seems that Deploy Docc step always fails on individual PRs, but when I check the history it passes when merged into main. Is this something you have more context on? It seems we can merge regardless.

@mobiletest-ci-bot
Copy link

Messages
馃摉 Edited 6 files
馃摉 Created 0 files

Generated by 馃毇 Danger Swift against bc6b676

@isabelrios
Copy link
Contributor

isabelrios commented May 14, 2024

@isabelrios @clarmso it seems that Deploy Docc step always fails on individual PRs, but when I check the history it passes when merged into main. Is this something you have more context on? It seems we can merge regardless.

I'm not really familiar with that step, not sure who owns / maintains it. I can take a look to try to fix it while we ask about the owner and what is the expected / the reason of that step...
Luckily, that does not block PR to be merged...

@@ -52,6 +53,13 @@ class ButtonsViewController: UIViewController, Themeable {
a11yIdentifier: "a11yPrimary")
primaryButton.configure(viewModel: primaryViewModel)

let primaryViewModelDisabled = PrimaryRoundedButtonViewModel(
title: "Primary Disabled",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
title: "Primary Disabled",
title: "Primary Disabled",

do we need to make these strings go inside strings files instead of directly adding the string here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding here as this is part of the sample component library

Comment on lines +57 to +61
if self?.state == .disabled {
container.foregroundColor = self?.foregroundColorDisabled
} else {
container.foregroundColor = self?.foregroundColor
}
Copy link
Contributor

Choose a reason for hiding this comment

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

On one side I like this because its readable and on another side I feel ternary operator works well for clean approach

container.foregroundColor = self?.state == .disabled ? self?.foregroundColorDisabled : self?.foregroundColor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, I also prefer ternary. discussed live, but will keep this as is since easier to read

@cyndichin
Copy link
Contributor Author

thanks for reviewing @nbhasin2!

@cyndichin cyndichin merged commit 727366b into main May 14, 2024
13 of 14 checks passed
@cyndichin cyndichin deleted the cc/FXIOS-9109_update-disable-state-for-primary-button branch May 14, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants