New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-vibes

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-vibes

React JS - Add Reactions To Your Content or WebPages

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

react-vibes

React JS - Add Reactions To Your Content or WebPages

How to install ?

yarn add react-vibes

Example:

https://imgur.com/a/lXdyFpR

How to use it ?

import React, {Component} from "react";
import {ReactVibes} from "react-vibes";

class App extends Component {

    constructor() {
        super();
        this.onClickEmoji = this.onClickEmoji.bind(this);
    }

    onClickEmoji = (e) => {
        console.log(e.emoji);
        console.log(e.counter);
    };

    render() {
        return (
            <div className="App">

                <div style={{marginLeft: "600px", marginTop: "200px"}}>

                    <ReactVibes
                        //showAllExcept={ ["happy", "amused", "inLove", "shocked", "angry", "sad"] }
                        //showAllExcept={["shocked", "angry",]}

                        //initialize Counters
                        happyCounter={100}
                        amusedCounter={0}
                        inLoveCounter={200}
                        shockedCounter={12}
                        //angryCounter={0}
                        sadCounter={0}

                        //handle the event of clicks
                        onClick={this.onClickEmoji}

                    />
                </div>

            </div>
        );
    }
}

export default App;

Available Options

===================================

You can init the counters by passing props as the following:

<ReactVibes

happyCounter={100}
amusedCounter={0}
inLoveCounter={200}
shockedCounter={12}
angryCounter={0}
sadCounter={0}
/>

===================================

You can show all emojies except some specific ones; for example we don't want to show `amused, and happy` :

<ReactVibes

showAllExcept={ ["happy", "amused"] }

 />

===================================

There also an event (onClick), using it you can access the current clicked emoji, and the current counter for it:

onClickEmoji = (e) => {
        console.log(e.emoji);
        console.log(e.counter);
    };

Keywords

react

FAQs

Package last updated on 27 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts