If you have a widget you love and want to build, this is the place to build it before using it in any mungwin project.
- Checkout
development
branch - Pull the latest changes from
development
withgit pull
- Install the latest changes in
development
withnpm install
- Create and checkout your new branch, name it as
issue_name-issue_number/component_name
or any other relevant name you choose - Design you components
-
mungwin-react-elements
is a dev dependency to this project, so the first place to start is there. - Break down your widget into small components, if you don't find a component in
mungwin-react-elements
, then you have to build it there first, - Link your projects and test first before creating you PR
- in
mungwin-react-elements
root folder, runnpm link
- in
mungwin-react-widgets
root folder, runnpm link mungwin-react-elements
this will link both projects on your local machine, so you can develop components for your widgets inmungwin-react-elements
and use them to developmungwin-react-widgets
before making youPR
- in
- Design your widget
- You can use
css file imports
or@emotion/styled
whichever you choose is up to you - Put your widgets in
src/widgets/your_widget_folder/YourWidget.component.js
- If you choose to use styled components with
@emotion/styled
, put your styles insrc/widgets/your_widget_folder/YourWidget.styles.js
and export them, then import them inYourComponent.js
- If you choose to use css, put your styles in
src/widgets/your_widget_folder/YourWidget.styles.css
, then import them inYourWidget.component.js
- Test your widget with storybook
- Put your widtet stories in
src/widgets/your_widget_folder/YourWidget.stories.js
- Test their functionality, it should look
great
- Export your widget for public consumption in
src/index.js
use the formatexport {default as YourWidget} from './widgets/your_widget_folder/YourWidget.component'
- Lint your code
- Run
npm run lint:fix
- Commit your changes
- Push your code create a
PR