documents-controldoc

1.0.67 • Public • Published

documents-controldoc

NPM JavaScript Style Guide

Install

npm install --save documents-controldoc

Usage

import React, { Component } from "react";

import Documents from "documents-controldoc";

class Example extends Component {
  render() {
    return <Documents />;
  }
}

DEVELOP

Put in src/index.js

import ReactDOM from "react-dom";
...

ReactDOM.render(<MultipleDocuments />, document.getElementById("root"));

In package.json put the following:

{
  "scripts": {
    "start": "react-scripts start"
  }
}

If you want to have document_types, person_email and company_email for example, put the following in src/components/index.jsx

const person_email = "elliot.alderson@gmail.com";
const company_email = "gideon@allsafe.com";
const document_types = [
      {
        value: "1",
        label: "Contrato de Trabajo",
        for_client: false
      },
      {
        value: "2",
        label: "Anexo de Contrato",
        for_client: false
      },
      {
        value: "3",
        label: "CPDT",
        for_client: true
      }
    ];
const signer_types = [
  {
    value: "1",
    label: "Trabajador",
    type: "person"
  },
  {
    value: "2",
    label: "Empleador",
    type: "company"
  },
  {
    value: "3",
    label: "Cliente",
    type: "client"
  }
];
const comapnySigners = [
  {
    value: "email1@mail.com",
    label: "EMAIL 1 - email1@mail.com"
  },
  {
    value: "email2@mail.com",
    label: "EMAIL 2 - email2@mail.com"
  },
  {
    value: "email3@mail.com",
    label: "EMAIL 3 - email3@mail.com"
  }
]

...

<MultipleForm
      documents={ props.documents }
      document_types={ document_types }
      signer_types={ signer_types }
      person_email={ person_email }
      company_email={ company_email }
      t={ t }
      name={ props.form_name || "person_sending[documents_attributes]" }
      companySigners={companySigners}
/>

License

MIT © rcereceda

Readme

Keywords

none

Package Sidebar

Install

npm i documents-controldoc

Weekly Downloads

0

Version

1.0.67

License

MIT

Unpacked Size

6.47 MB

Total Files

6

Last publish

Collaborators

  • rcereceda
  • eliascaceresy
  • emmanuel92