community-platform
community-platform copied to clipboard
Help to migrate src/components/DropdownIndicator/index.tsx
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?
-
Create a new component in
./packages/components
- Move existing component into new component
- Update all references to import the new component from
oa-components
- 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.
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.
Aiming to address via: https://github.com/ONEARMY/community-platform/pull/1934
Closing issue as it was solved by #1934