2.1.4 • Published 3 years ago

@cyberconnect/react-follow-button v2.1.4

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

React Follow Button

A Component React for CyberConncet Follow/Unfollow

Getting Started

  • yarn add @cyberconnect/react-follow-button or npm install @cyberconnect/react-follow-button
  • Your application will also need react-dom and react installed.

Basic button


See demo here.

Now for the first time users it will show two signs with their wallet when clicking button, and there may be 5-10 seconds between those two sign.

import {
  FollowButton,
  Env,
  Blockchain,
} from '@cyberconnect/react-follow-button';

function App() {
  <div className="App">
    <FollowButton
      provider={ethProvider}
      namespace="CyberConnect"
      toAddr="0xe6aab1f16ff560d309ed7ce8e08d290306a0906c"
      env={Env.STAGING}
      chain={Blockchain.ETH}
      onSuccess={(e) => {
        console.log(e);
      }}
      onFailure={(e) => {
        console.log(e);
      }}
    />
  </div>;
}

See API for more details of those props.

When the button triggered, the callbacks will be called with the following event object:

onSuccess:
{
    code: EVENT_NAME,
    toAddr: "xxx"
}

onFailure:
{
    code: ERROR_CODE,
    message: "error message"
}
2.1.4

3 years ago

2.1.2

3 years ago

2.1.3

3 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago