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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(button): primary & secondary styles #402

Merged
merged 2 commits into from
Aug 5, 2018
Merged

Conversation

mhuggins
Copy link
Contributor

@mhuggins mhuggins commented Aug 5, 2018

Description

  • Adds a PrimaryButton component, which reflects the existing button styles.
  • Updates the Button component to represent secondary actions.
  • Smooths the primary button background color to match designs
  • Uses React.forwardRef to forward refs to the raw DOM element, which prevents us from having to manually implement component functions like focus and blur.

Motivation and Context

Designs have primary and secondary buttons, this brings the styles inline with design.

How Has This Been Tested?

Smoke testing.

Screenshots (if appropriate)

screen shot 2018-08-05 at 8 56 33 am

Types of changes

  • Chore (tests, refactors, and fixes)
  • New feature (adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have read the CONTRIBUTING guidelines and confirm that my code follows the code style of this project.
  • Tests for the changes have been added (for bug fixes/features)

Documentation

  • Docs need to be added/updated (for bug fixes/features)

Closing issues

N/A

@mhuggins mhuggins added the PR: needs review Pull request label Aug 5, 2018
@mhuggins mhuggins changed the title Chore/smooth button chore(button): primary & secondary buttons Aug 5, 2018
@mhuggins mhuggins changed the title chore(button): primary & secondary buttons chore(button): primary & secondary styles Aug 5, 2018
@codecov
Copy link

codecov bot commented Aug 5, 2018

Codecov Report

Merging #402 into develop will increase coverage by 0.08%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #402      +/-   ##
===========================================
+ Coverage    50.54%   50.62%   +0.08%     
===========================================
  Files          147      148       +1     
  Lines         1189     1195       +6     
  Branches       153      153              
===========================================
+ Hits           601      605       +4     
- Misses         494      496       +2     
  Partials        94       94
Impacted Files Coverage Δ
...nt/components/TransactionsPanel/Receive/Receive.js 100% <ø> (ø) ⬆️
.../account/components/TransactionsPanel/Send/Send.js 42.1% <ø> (ø) ⬆️
...erer/login/components/LoginFormWIF/LoginFormWIF.js 0% <ø> (ø) ⬆️
...ponents/LoginFormPassphrase/LoginFormPassphrase.js 0% <ø> (ø) ⬆️
...r/register/components/RegisterForm/RegisterForm.js 0% <ø> (ø) ⬆️
...ponents/LoginFormWalletFile/LoginFormWalletFile.js 0% <ø> (ø) ⬆️
...mponents/AccountDetails/SaveAccount/SaveAccount.js 5.88% <ø> (ø) ⬆️
...ogin/components/LoginFormLedger/LoginFormLedger.js 15% <ø> (ø) ⬆️
...ed/components/Forms/PrimaryButton/PrimaryButton.js 66.66% <66.66%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 584371f...ecb4f1b. Read the comment docs.

</Button>
<Button className={classNames(styles.action, styles.cancel)} onClick={onCancel}>
</PrimaryButton>
<Button
Copy link
Member

Choose a reason for hiding this comment

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

maybe rename SecondaryButton? It's not very clear which style is applied from the name

Copy link
Contributor Author

@mhuggins mhuggins Aug 5, 2018

Choose a reason for hiding this comment

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

There are places where we only display a single button and it's not secondary to anything, which is why I left it as just Button. It's only a secondary button when there's not a primary button visible, otherwise it's just the default button style.

@DalderupMaurice DalderupMaurice added PR: reviewed w/ comments Reviewed but needs to be looked at and removed PR: needs review Pull request labels Aug 5, 2018
@mhuggins
Copy link
Contributor Author

mhuggins commented Aug 5, 2018

Looks like forwardRef is not supported by enzyme yet: enzymejs/enzyme#1604 and enzymejs/enzyme#1592. I'll take that commit out of this PR and put it into a separate one.

@mhuggins
Copy link
Contributor Author

mhuggins commented Aug 5, 2018

Updated to remove that last forwardRef commit.

@mhuggins mhuggins added PR: needs review Pull request and removed PR: reviewed w/ comments Reviewed but needs to be looked at labels Aug 5, 2018
@DalderupMaurice
Copy link
Member

Hmm still seems to fail 🤔

};

export default React.forwardRef((props, ref) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, I must have included this in the wrong commit. I'll get it fixed.

@DalderupMaurice DalderupMaurice added PR: good to merge Reviewed and approved and removed PR: needs review Pull request labels Aug 5, 2018
@DalderupMaurice
Copy link
Member

Seem to be a conflict after merging the stylelint thing 😅
This piece of code could be left out right? In this case you can resolve it through GH Itself :P

@mhuggins
Copy link
Contributor Author

mhuggins commented Aug 5, 2018

Rebased, should be good soon!

@mhuggins mhuggins merged commit 6c6e385 into develop Aug 5, 2018
@mhuggins mhuggins deleted the chore/smooth-button branch August 5, 2018 15:47
@scottudont
Copy link

scottudont commented Aug 5, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: good to merge Reviewed and approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants