community-platform icon indicating copy to clipboard operation
community-platform copied to clipboard

Help to migrate src/components/DropdownIndicator/index.tsx

Open thisislawatts opened this issue 2 years ago • 2 comments

We are looking to migrate src/components/DropdownIndicator/index.tsx to packages/components/src/DropdownIndicator/DropdownIndicator.tsx

This component was introduced to workaround a limitation of react-select. It may be possible to completely remove this item, please review before migrating.

Why?

  • Improve structure of the components
  • Improve documentation for our existing components
  • Make it easier for our design team to review and refine the components
  • Decouple our components from application state
  • Convert our class based components to functional components
  • Allow reuse of our components outside of the primary single page application (SPA)#

Definition of Migrated

  • The component file exists in packages/components/src
  • There is a companion *.stories.tsx which includes an example for each use case of the component

How?

  1. Create a new component in ./packages/components
  2. Move existing component into new component
  3. Update all references to import the new component from oa-components
  4. Delete all files from ./src/components

🐉 Things to watch out for:

  • If the original component file exported multiple components these should be split into multiple separate files
  • If the component you're working on imports another component from src/components you will need to migrate that item first. Please make sure to claim ownership on the associated issue.
  • We want to use functional components, read more around how to refactor a class component
  • You may spot an opportunity to create a new component to encapsulate some elements which are being used frequently across the UI. Yay, a new component is born 🐥
  • The component may not need to exist.

thisislawatts avatar Jun 05 '22 14:06 thisislawatts

I would like to work on this one if OK. I looked at the linked issue and the workaround is still needed There is no need for a .stories.tsx file here I guess.

Xyli0 avatar Jun 21 '22 16:06 Xyli0

Aiming to address via: https://github.com/ONEARMY/community-platform/pull/1934

thisislawatts avatar Sep 19 '22 06:09 thisislawatts

Closing issue as it was solved by #1934

tudi2d avatar Nov 04 '22 12:11 tudi2d