0.1.0 • Published 3 years ago

@wal3/rc-login v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@wal3/rc-login

Made with create-react-library

NPM JavaScript Style Guide

NOTE: This component is currently under construction and may change substantially.

Install

npm install --save @wal3/rc-login

Usage

TODO: expand on the example...

import Login from '@wal3/rc-login'

const App = () => {
  return (
    <Login
      title="Login Example"
      logo={logo}
      emailDomain="wal3geo.com"
      onDialogSubmit={loginSubmitHandler}
    >
      <MyApplication/>
    </Login>
  )
}

Properties

PropertyTypeDescriptionDefault
onDialogSubmitfunctionRequired. Function which handles the API call to the server to validate the user
loginDialogfunctionA React component which implements a login dialog. A default component is used if this prop is missing.LoginDialog

Any additional props sent to Login will be passed on to the LoginDialog component. For example, title, logo and emailDomain in the example above which are props needed for the default LoginDialog.

Default LoginDialog component properties

PropertyTypeDescriptionDefault
messagestringRequired. Message shown to user. From a useState in the parent component.'Enter User Id and Password'
setMessagefunctionRequired. Function to set the message. From a useState in the parent component.
titlestringThe title shown on the dialog.''
logoimageAn image shown before the title.null
emailDomainstringThe part after the "@" in an email address which limits the user id to emails in that domain.null
onCancelfunctionFunction to handle click of 'cancel' button.null
onSubmitfunctionRequired function from login which gets credentials. TODO: needs better descriptionnull
onForgotPasswordfunctionNot Implemented Yet.null
onRegisterfunctionNot Implemented Yet.null

License

MIT © worthlutz