npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@easyly/sign-react

v1.1.0

Published

React.js package for contracts by Easyly

Downloads

109

Readme

React.JS Contracts

React components for Contracts by Easyly

build status npm version

React.js front-end package of creating, editing & signing contracts. To interact with the API - see sign-js

Minimal example

First, install this package

npm install @easyly/sign-react

Create/Edit contract template using hooks

import React from 'react';
import ReactDOM from 'react-dom';
import {ContractEditor} from "@easyly/sign-react";

const App = () => {

    const save = async (data) => {
        // data = {contractId:10, type:"save/update"}
    }

    return <ContractEditor publishKey={"XXXXXXXXXXXXXX"} onSave={save} />
};

ReactDOM.render(<App />, document.body);

<ContractEditor> Props:

{
    // API publish key can be found in your account
    publishKey: string,
    
    // Optional: contract id to edit
    id: int,
    
    // Optional: id of the sub account of the contract
    // if not speecified - contract template will be saved on main account
    subAccountId: int,
    
    // Called whenever contract 'save' button is clicked
    // returns an object with the new template id and if it was an edit or a new save
    onSave: (data: Object) => void,
}

View & Sign a sent contract using hooks

import React from 'react';
import ReactDOM from 'react-dom';
import {ContractSign} from "@easyly/sign-react";

const App = () => {

  const onSubmit = async (data) => {
      // Signature submitted
      // data = {status:true/false,contractKey:"contractKey"}
  }
  
  return (
    <div>
        <ContractEditor
            contractKey={"XXXXXXXXXXXXXX"}
            subAccountId={"0"}
            onSubmit={onSubmit}        
        />
    </div>
  );
};

ReactDOM.render(<App />, document.body);

<ContractSign> Props:

{
    // contract key that was received when sent the contract
    contractKey: string,
        
    // Optional: API publish key can be found in your account
    // if provided - 'private' signatures will be allowed to be signed
    // should be used only on your end point - not the customer
    publishKey: string,
    
    // Called whenever contract 'submit' button is clicked
    // returns a status of the request and the contract key back {status:true/false,contractKey:'XXXX'}
    onSubmit: (data: Object) => void,
}

Minimum requirements

The minimum supported version of React is v16.8. If you use an older version, upgrade React to use this library. If you prefer not to upgrade your React version, we recommend using legacy.

Contributing

If you would like to contribute to React Stripe.js, please make sure to read our contributor guidelines.