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

Help to migrate src/components/Modal/Modal.tsx

Open thisislawatts opened this issue 2 years ago • 1 comments

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?

  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

Picking up as this component is used within the Comment component #1717

thisislawatts avatar Jun 08 '22 14:06 thisislawatts