community-platform
community-platform copied to clipboard
Help to migrate src/components/Modal/Modal.tsx
We are looking to migrate src/components/Modal/Modal.tsx
to packages/components/src/Modal/Modal.tsx
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.
Picking up as this component is used within the Comment
component #1717