Skip to content

feat(ui-tools): add dropDown component - #47043

Merged
Sembauke merged 18 commits into
freeCodeCamp:mainfrom
shootermv:feat/ui-tools-add-dropdown-button
Apr 24, 2023
Merged

Sembauke merged 18 commits into
freeCodeCamp:mainfrom
shootermv:feat/ui-tools-add-dropdown-button

Conversation

@shootermv

@shootermv shootermv commented Jul 26, 2022 •

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.

image
Closes #47356

@gitpod-io

gitpod-io Bot commented Jul 26, 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 Jul 26, 2022
@ghost

ghost commented Jul 26, 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

@Sboonny
Sboonny requested review from ahmaxed and huyenltnguyen and removed request for majestic-owl448 and scissorsneedfoodtoo July 26, 2022 16:57
@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 Jul 26, 2022
@ahmaxed ahmaxed self-assigned this Jul 27, 2022
@ahmaxed

ahmaxed commented Jul 30, 2022

Copy link
Copy Markdown
Member

@shootermv, Thank you for this pull request. Not sure if this pr is a work in progress, but I wanted to point a few things that are missing. The main aim of the component library is to replace the react-bootstrap library with minimum to no modifications on the lean's client side.

So our components should be identical to the used react-bootstrap ones:

  • they should receive the same props
  • have a similar logic
  • look the same
  • output the same elements

To clarify the technical specifications, it would be great if you could research the current usage as described in the documentation and create an issue. Then, you could finalize this pr accordingly.

@huyenltnguyen

Copy link
Copy Markdown
Member

What @ahmadabdolsaheb said, but I would also add that we should try to keep the component library "dumb", in that they don't know about the business logic of the consumers / the apps that use them. It is so that they can be shared across multiple apps (/learn is the main consumer, but we are aiming to use the library in Code Radio and Chapter as well). This means the drop down shouldn't have "Account Settings" or "Sign out" options built in.

Let us know if you need our help with the development process 🙂

@huyenltnguyen huyenltnguyen 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 Aug 1, 2022
@shootermv
shootermv force-pushed the feat/ui-tools-add-dropdown-button branch from 5d8d64d to cf49041 Compare August 2, 2022 06:46
@shootermv

Copy link
Copy Markdown
Contributor Author

can i see some place that project currently has this dropdownButton functionality?

@shootermv
shootermv force-pushed the feat/ui-tools-add-dropdown-button branch from cf49041 to 8a8b2dc Compare August 2, 2022 07:04
@ahmaxed

ahmaxed commented Aug 2, 2022

Copy link
Copy Markdown
Member

@shootermv, here are multiple use cases: https://github.com/freeCodeCamp/freeCodeCamp/search?q=DropdownButton
Doing a search for DropdownButton on your editor will give you better results.

@shootermv
shootermv force-pushed the feat/ui-tools-add-dropdown-button branch 2 times, most recently from 4c47481 to 6413700 Compare August 5, 2022 07:27
@ahmaxed ahmaxed mentioned this pull request Aug 9, 2022
37 of 49 tasks
@ahmaxed
ahmaxed marked this pull request as draft August 12, 2022 12:55
@ahmaxed

ahmaxed commented Aug 12, 2022

Copy link
Copy Markdown
Member

@shootermv, the component is taking shape pretty nicely. Let me know if I could be of any help or if you need any further clarification.

@shootermv

Copy link
Copy Markdown
Contributor Author

currently i added buttonText and options props, dont sure what to do next

@ahmaxed

ahmaxed commented Aug 22, 2022

Copy link
Copy Markdown
Member

@shootermv so the implementation in this pr has different styles and functionality comparing to the bootstrap component in the codebase. I highly recommend reviewing the #44668 issue, the related documentation (mentioned in the same issue) and create an issue accordingly so we could finalize the specifications before proceeding with updating this pr.

@ahmaxed

ahmaxed commented Sep 30, 2022

Copy link
Copy Markdown
Member

@shootermv how is the progress going on your side. Let me know if you need any help.

@Sboonny Sboonny changed the title feat(ui-tools): add dropDownButton component feat(ui-tools): add dropDown component Apr 11, 2023
@Sboonny Sboonny removed the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Apr 12, 2023
@Sboonny
Sboonny marked this pull request as draft April 12, 2023 09:14
@github-actions github-actions Bot added the platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. label Apr 17, 2023
@ahmaxed

ahmaxed commented Apr 17, 2023 •

Copy link
Copy Markdown
Member

Instructions for linking:

  1. Make sure the main is set up correctly in package.json of the ui-components. "main": "./src/index.ts",
  2. go to the ui-components and `pnpm link --global'
  3. 'pnpm run build:css' and move the base.css file from dist to the related location on learn.
  4. go to the client and pnpm link @freecodecamp/ui --global
  5. import { Dropdown, MenuItem } from '@freecodecamp/ui'; and use it everywhere the Dropdown and DropdownButton is used

Actionable items:

  • Make sure the correct props are being used. ( Dropdown.Toggle is missing bsStyle, MenuItem is missing href, etc. )
  • Make sure the component is styled similar to learn. ( :focus has reverse styles, the width of the drop down items should be the same as the dropdown button, the text in the dropdown items should be centered, etc.)
  • Make sure the theme switching work properly.
  • etc.

@Sboonny

Sboonny commented Apr 17, 2023

Copy link
Copy Markdown
Member

About width, I don't think it's a good idea to set width, because the places that use the dropdown, use different width

image

image

The reason that the theme isn't applied, because the styles are using html.dark, div.dark and html.light, div.light, swapping it to dark-pallete and light-pallete, or the other way around should solve this.

@Sboonny

Sboonny commented Apr 17, 2023

Copy link
Copy Markdown
Member

I haven't changed the extra files, to not make testing it annoying.

@ahmaxed

ahmaxed commented Apr 18, 2023 •

Copy link
Copy Markdown
Member

About width, I don't think it's a good idea to set width, because the places that use the dropdown, use different width

We could set width to auto and min width to 100% to avoid really small buttons.

Comment thread tools/ui-components/package.json Resolved
@Sboonny
Sboonny force-pushed the feat/ui-tools-add-dropdown-button branch from f99b1dc to 717cdba Compare April 19, 2023 13:15

@Sembauke Sembauke 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.

So this looks good to me. But one bug appeared when reviewing the stories in story book.

When viewing the drop-up first. Then view the dropdown. The dropdown doesn't dropdown but drops-up instead.

image

Also there does not seem to be a story for the "Menu with Action" story.

@shootermv

shootermv commented Apr 20, 2023 via email

Copy link
Copy Markdown
Contributor Author

@ahmaxed

ahmaxed commented Apr 20, 2023

Copy link
Copy Markdown
Member

Thanks for reviewing the pr. Muhammed and I will make the necessary changes.

@Sembauke

Copy link
Copy Markdown
Member

Congrats on getting this in @shootermv, @ahmadabdolsaheb and @Sboonny 🥳

@huyenltnguyen

Copy link
Copy Markdown
Member

@shootermv I wasn't able to review the PR, but wanted to say thank you for the extreme patience and for the contribution to the component library. I really appreciate it 🙂

@shootermv

shootermv commented Apr 28, 2023 via email

Copy link
Copy Markdown
Contributor Author

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 DropDownButton component

7 participants