Gathering detailed insights and metrics for cm-pg-components
Gathering detailed insights and metrics for cm-pg-components
Gathering detailed insights and metrics for cm-pg-components
Gathering detailed insights and metrics for cm-pg-components
npm install cm-pg-components
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
18
13
34
This repository contains all React components needed by Portfolio, Campaign and Licenses and will be released as an npm package.
This project works with:
To install node you can download the latest release or install nvm. NVM is recommended.
After install nvm, in the root of project run:
1nvm install
Install dependencies:
1npm install
Run components documentation:
1npm run storybook
The project runs in http://localhost:6006
To test locally we have two ways:
Build the package and link it with the app. Make sure that you set as true the LOCAL_DEV variable in the environment variables.
In appsuite-shared directory:
npm run build
npm link
In the app directory
npm link cm-pg-components
Remember after any change the code execute:
npm run build
Storybook is a components repository, each component that has a stories.jsx file will be listed in that repository.
This file imports the component and passes properties to it. The file must be located in the same directory the file component
/Button
-- index.js
-- Button.stories.jsx
Button.stories.jsx
1import React from 'react' 2import ModalErrors from './' 3 4const defaultsArgs = { 5 href: '#', 6 className: 'my-class' 7} 8 9const ButonToTest = args => ( 10 <Button { ...args }> 11 This is a button 12 </Button> 13) 14 15export const Default = Template.bind({}) 16Default.args = { 17 ...defaultsArgs 18} 19 20export const Secondary = Template.bind({}) 21Secondary.args = { 22 ...defaultsArgs, 23 color: 'secondary' 24} 25 26export default { 27 title: 'Buttons/Button', 28 component: Button 29} 30
ReactJs works with reusable components regardless of context. The components work as an independent whole, in that sense each component has its own images, styles, translations, etc. Follow these rules when creating a component:
The components are stored in the components
directory. This directory is global and can be used by any part of the applications.
A nested component is a component that is defined inside another component; it can only be used by its parent; when a component is needed but it will not be used in more than one place.
/src
/components
/molecules
/Notifications
/components
/ButtonDismiss
/index.js
/actions.js
/index.js
/reducer.js
No vulnerabilities found.
No security vulnerabilities found.