1.0.1 • Published 6 years ago

react-vibes v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

react-vibes

React JS - Add Reactions To Your Content or WebPages

https://imgur.com/a/lXdyFpR

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;

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

<ReactVibes

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

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

<ReactVibes

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

 />

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

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