Skip to content

feat(UI): implement ToggleButton component - #48567

Merged
ahmaxed merged 10 commits into
freeCodeCamp:mainfrom
rajgaur98:main
Mar 15, 2023
Merged

ahmaxed merged 10 commits into
freeCodeCamp:mainfrom
rajgaur98:main

Conversation

@rajgaur98

Copy link
Copy Markdown
Contributor

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.

Closes #48424

@gitpod-io

gitpod-io Bot commented Nov 22, 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 Nov 22, 2022
@rajgaur98 rajgaur98 changed the title feat: toggle button skeleton and basic style ToggleButton UI Component Nov 22, 2022
@ghost

ghost commented Nov 22, 2022 •

Copy link
Copy Markdown

👀 Review this PR in a CodeSee Review Map

View the CodeSee Map of this change

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@rajgaur98 rajgaur98 changed the title ToggleButton UI Component feat: toggle button skeleton and basic style Nov 22, 2022
@rajgaur98
rajgaur98 force-pushed the main branch 2 times, most recently from b39cdc9 to 1e29ee4 Compare December 4, 2022 16:57
@rajgaur98 rajgaur98 changed the title feat: toggle button skeleton and basic style UI component ToggleButton implementation Dec 4, 2022
@rajgaur98
rajgaur98 marked this pull request as ready for review December 4, 2022 16:59
@rajgaur98
rajgaur98 requested review from a team, Nirajn2311 and Sboonny December 4, 2022 16:59
@Nirajn2311
Nirajn2311 requested review from ahmaxed and removed request for Nirajn2311 December 5, 2022 12:06
@rajgaur98
rajgaur98 force-pushed the main branch 3 times, most recently from 14f633c to 5e2f87f Compare December 7, 2022 07:03
@ahmaxed ahmaxed self-assigned this Dec 8, 2022

@Sboonny Sboonny left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @rajgaur98, thank you for your patience. The current tests are falling because of the changes in the package-lock files.

You can revert the changes, and use npm i -w=tools/ui-components package_name @headlessui/react @headlessui/tailwindcss to add the packages without too many noises and failed test

@rajgaur98

Copy link
Copy Markdown
Contributor Author

Hi @rajgaur98, thank you for your patience. The current tests are falling because of the changes in the package-lock files.

You can revert the changes, and use npm i -w=tools/ui-components package_name @headlessui/react @headlessui/tailwindcss to add the packages without too many noises and failed test

Thanks for reviewing @Sboonny . I have updated the code.

@rajgaur98
rajgaur98 requested review from Sboonny and removed request for ahmaxed December 14, 2022 07:34

@Sboonny Sboonny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nicely done. Small issues:

  • Trim of space
  • missing prop

@ahmaxed

ahmaxed commented Dec 15, 2022 •

Copy link
Copy Markdown
Member

Thanks for the hard work here. Here are a few guidelines for this implementation:

  • props should match the naming convention of the learn implementation so they could be used only by changing the import statement of the consumer file. I understand that the ToggleButton cannot be tested on learn currently since it would need the ToggleButtonGroup component.
  • '^' is not necessary when adding a new component package as it might cause incompatibility issues down the line.

@rajgaur98

Copy link
Copy Markdown
Contributor Author

Thanks for the hard work here. Here are a few guidelines for this implementation:

  • props should match the naming convention of the learn implementation so they could be used only by changing the import statement of the consumer file. I understand that the ToggleButton cannot be tested on learn currently since it would need the ToggleButtonGroup component.
  • '^' is not necessary when adding a new component as it might cause incompatibility issues down the line.

Thanks @ahmadabdolsaheb , 1) for example, do you mean that size prop should be replaces with bsSize as it's given in the bootstrap implementation?

<TB
    bsSize='sm'
    bsStyle='primary'
    className={`toggle-${getActiveClass(value)}`}
    disabled={value}
    type='radio'
    value={1}
>
  1. And do you mean packages should not have ^ and not components right?

@Sboonny

Sboonny commented Dec 15, 2022

Copy link
Copy Markdown
Member

And do you mean packages should not have ^ and not components right?

Yeab 👍

@ahmaxed

ahmaxed commented Dec 15, 2022

Copy link
Copy Markdown
Member
  • Yes style and size need bs.
  • Yes the ^ should be removed for the newly added packages.

@Sboonny Sboonny added the status: waiting update Is awaiting update, after feedback or request for changes label Dec 19, 2022
@raisedadead

Copy link
Copy Markdown
Member

We are officially on Node.js 18 now. We have changed the merge requirements accordingly.

You will need to rebase this PR against the main branch OR Click the "Update branch" button to get the new checks going.

Thanks for your contribution.

@Sboonny Sboonny added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Jan 27, 2023

@Sboonny Sboonny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✨ 🎉 AWESOME! 🎉 ✨

Hi @rajgaur98, thanks for this pull request and for contributing to the code-base for the first time. We are looking forward to more contributions from you in the future.

Cheers & happy contributing!

@rajgaur98

Copy link
Copy Markdown
Contributor Author

✨ 🎉 AWESOME! 🎉 ✨

Hi @rajgaur98, thanks for this pull request and for contributing to the code-base for the first time. We are looking forward to more contributions from you in the future.

Cheers & happy contributing!

Thanks for reviewing @Sboonny and team!

Comment thread tools/ui-components/tailwind.config.js Resolved
@ahmaxed

ahmaxed commented Feb 21, 2023

Copy link
Copy Markdown
Member

Thank you for the detailed pr. Looking forward to see how this component will interact with the FormGroupGroup to replicate the react-bootstrap component usage in our repository.

@ahmaxed ahmaxed added status: waiting update Is awaiting update, after feedback or request for changes and removed status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. labels Feb 21, 2023
@ahmaxed

ahmaxed commented Mar 8, 2023

Copy link
Copy Markdown
Member

@Sboonny Sboonny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

to please eslint

@ahmaxed
ahmaxed merged commit f03c4a2 into freeCodeCamp:main Mar 15, 2023
@ahmaxed

ahmaxed commented Mar 15, 2023

Copy link
Copy Markdown
Member

@rajgaur98 thanks to you we have a toggle button.
I encourage you to consider creating the ToggleButtonGroup component as well. happy coding.

@rajgaur98

Copy link
Copy Markdown
Contributor Author

@rajgaur98 thanks to you we have a toggle button. I encourage you to consider creating the ToggleButtonGroup component as well. happy coding.

Thanks, I will be taking on ToggleButtonGroup and looking out for other issues.

@Sboonny Sboonny mentioned this pull request Mar 15, 2023
37 of 49 tasks
@Sboonny

Sboonny commented Mar 20, 2023

Copy link
Copy Markdown
Member

Hi @rajgaur98 I am pinging, because you are taking toggleButtonGroup, wait until this PR is sorted #49664, because you may not need to add it, and toggleButton can be enough.

@Sboonny Sboonny removed the status: waiting update Is awaiting update, after feedback or request for changes label Mar 20, 2023
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement ToggleButton component

5 participants