Skip to content

chore(ui-components): minor adjustments in Button component - #45480

Merged
ahmaxed merged 1 commit into
freeCodeCamp:mainfrom
huyenltnguyen:chore/minor-button-adjustments
Mar 23, 2022
Merged

ahmaxed merged 1 commit into
freeCodeCamp:mainfrom
huyenltnguyen:chore/minor-button-adjustments

Conversation

@huyenltnguyen

@huyenltnguyen huyenltnguyen commented Mar 20, 2022 •

Copy link
Copy Markdown
Member

Checklist:

  • I have read freeCodeCamp's contribution guidelines.
  • My pull request has a descriptive title (not a vague title like Update index.md)
  • My pull request targets the main branch of freeCodeCamp.
  • I have tested these changes either locally on my machine, or GitPod.

Ref #45357

This PR:

Note: It is easier to review the PR if you enable the "Hide whitespace changes" option.

Screenshot

Before After
Screen Shot 2022-03-20 at 12 15 22 Screen Shot 2022-03-20 at 11 23 08

@gitpod-io

gitpod-io Bot commented Mar 20, 2022

Copy link
Copy Markdown

@github-actions github-actions Bot added the scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. label Mar 20, 2022
@ghost

ghost commented Mar 20, 2022

Copy link
Copy Markdown

👀 Review this PR in a CodeSee Review Map

Preview the Review Map

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

Comment thread .eslintrc.json Resolved
Comment on lines +10 to +12
controls: {
include: ['children', 'variant', 'size']
}

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.

We extend the Button's interface from HTML attributes in order to accept attributes such as aria-disabled, aria-label, etc. This turns the Storybook controls into a clutter.

export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {

What I'm doing here is filtering the controls and only show what we are interested in.

Ref: https://storybook.js.org/docs/react/essentials/controls#filtering-controls

Comment on lines +14 to +21
argTypes: {
variant: {
options: ['primary', 'danger']
},
size: {
options: ['small', 'medium', 'large']
}
}

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.

I'm explicitly listing the options in order to remove the undefined option (not sure where that comes from).

@huyenltnguyen huyenltnguyen mentioned this pull request Mar 20, 2022
4 of 10 tasks
@huyenltnguyen
huyenltnguyen marked this pull request as ready for review March 20, 2022 05:22
@huyenltnguyen
huyenltnguyen requested a review from a team March 20, 2022 05:22
@raisedadead raisedadead added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Mar 22, 2022
@ahmaxed

ahmaxed commented Mar 22, 2022

Copy link
Copy Markdown
Member

Other than the above-mentioned nitpick, this is LGMT.

@ahmaxed
ahmaxed merged commit 06a1aa3 into freeCodeCamp:main Mar 23, 2022
@huyenltnguyen
huyenltnguyen deleted the chore/minor-button-adjustments branch March 26, 2022 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants