0.0.26 • Published 6 years ago

plurall-components v0.0.26

Weekly downloads
100
License
-
Repository
-
Last release
6 years ago

Plurall React Componetes

How to run

Clone this repository and cd plurall-react-components

The first time you need run

yarn && yarn build

To run project

yarn bootstrap && yarn start

if yout development components or new component you nedd run this in other terminal tab

yarn start:watch

to publish in npm

export NPM_TOKEN=token-do-plurall-dev
yarn deploy

open localhost:6006/

Using components locally

To test a component locally in an external application, uninstall the component and reinstall it pointing to the location on your machine where the component source code is located.

For exemple, if you cloned the repository inside a folder called projects and want to test locally the Header component, run

npm uninstall plurall-header
npm install --save ~/projects/plurall-react-components/packages/plurall-component-header

Your package.json will be updated, and will now fetch the component from your local disk, instead of a remote repository:

"plurall-header": "file:../plurall-react-components/packages/plurall-component-header"

Create a new component

  • Create a new folder in /packages/ with this format plurall-component-nomeComponent
  • run npm init for create a new component - Follow the steps to create or look at the button, for example.
  • Create a src folder inside
  • Crate a index.js

    • For example:

          import YourComponetName from './YourComponetName';
      
          export {
              YourComponetName,
          };
  • Create a YourComponetName.js

    • For Example

      import React from 'react'
      import PropTypes from 'prop-types'
      
      class YourComponetName extends React.Component {
          render() {
          const { children } = this.props;
          return (
            <div>
              {children}
              <style jsx>{`
                  div { color: red }
              `}</style>
            </div>
          );
        }
      }
      
      YourComponetName.propTypes = {
          children: PropTypes.node
      };
      
      export default YourComponetName
  • Now goto stories/index.js and add new component, for example:

import { MyComponent } from '../packages/plurall-component-YourComponetName/src'
storiesOf('MyComponent', module)
  .addWithInfo('Default', () => (
    <MyComponent />
  ))
0.0.26

6 years ago

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago