lhfrontend

1.0.5 • Public • Published

lhfrontend

A Boiler Plate the Create Apps with a Login Screen and Pre-Build Menus. For a usage see the example folder. There's a few components to use in forms, documetation yet to come.

NPM JavaScript Style Guide

Install

npm install --save lhfrontend

Usage

import React, { Component } from 'react'
import { BrowserRouter } from 'react-router-dom';

import { Principal } from 'lhfrontend'
import 'lhfrontend/dist/index.css'


const App = () => {
  const [usuario, setUsuario] = React.useState(null);
  const [empresa, setEmpresa] = React.useState(null);
  // const usuario = { id: 1, nome: 'Exemplo' };

  return <BrowserRouter>
    <Principal 
      appName='Example App'
      usuario={usuario} // Loged User
      setUsuario={setUsuario} 
      empresa={empresa} // Company
      setEmpresa={setEmpresa}
      getEmpresaPorSysname={ sysname => {
        // Allow the user to search for the company prior the login,
        // Set the company to go strait to login screen.
        return Promise.resolve({
          id: 4, sysname, nome: 'Exemple Company'
        });
      }}
      efetuarLogin={ ({ empresa_id, usuario , senha })=>{
        // Return a Promise that 
        return Promise.resolve({
            id: 1, empresa_id, usuario, nome: 'Exemplo User'
        });
      }}
      menus={menus.data.menus}>

    </Principal>
  </BrowserRouter>;
}

export default App;

License

MIT © lokidarkeden

Readme

Keywords

none

Package Sidebar

Install

npm i lhfrontend

Weekly Downloads

3

Version

1.0.5

License

MIT

Unpacked Size

191 kB

Total Files

9

Last publish

Collaborators

  • lokidarkeden