node package manager

@mitchallen/react-cognito-login

@mitchallen/react-cognito-login

CognitoLogin React component

Continuous Integration Coverage Status Downloads Version License

UNDER CONSTRUCTION

Installation

$ npm init
$ npm install @mitchallen/react-cognito-login --save

Usage

1: Add this line near the top of your file (like src/App.js):

import CognitoLogin from '@mitchallen/react-cognito-login';

NOTE: CognitoLogin must be Capitalized or component won't render.

2: Somewhere in the middle of the render method add this line:

<CognitoLogin />

Testing

Run the Tests

To test, go to the root folder and type (sans $):

$ npm test

Component Testing

Prerequisite

If you've never installed create-react-app (you may need to use sudo):

$ npm install -g create-react-app

Create a local npm link

In the original component folder (you may need to use sudo):

$ npm link

Create a test package

Create a root test folder and then do the following:

$ create-react-app react-cognito-login-test
$ cd react-cognito-login-test
$ npm link @mitchallen/react-cognito-login

Modify src/App.js

1: Add this line near the top:

import CognitoLogin from '@mitchallen/react-cognito-login';

NOTE: CognitoLogin must be Capitalized or component won't render.

2: Somewhere in the middle of the render method add this line:

<CognitoLogin />

Run The Test App

$ npm start

Cleanup

Remember to unlink when done.


Repo(s)


Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.


Version History

Version 0.1.3

  • rebuilt before publishing

Version 0.1.2

  • Added call to props.userHasAuthenticated(true) on successful login
  • Removed call to props.updateUserToken

Version 0.1.1

  • Button reverts state when token updated

Version 0.1.0

  • initial release