Giter VIP home page Giter VIP logo

react-reactions's Introduction

  • 4 Different Selectors - Slack, Facebook, Pokemon and Github
  • 4 Different Counters - Github, Youtube, Facebook and Slack

Install via npm:

npm install react-reactions --save

Selectors

Slack

import React from 'react';
import { SlackSelector } from 'react-reactions';

const Component = () => {
  return (
    <SlackSelector />
  )
}

Props:

active: String of active tab. Defaults to mine

scrollHeight: String pixel height of scroll container. Defaults to 270px

removeEmojis: Array of emojis to remove from emoji list

frequent: Array of emojis to set Frequently Used. Defaults to ['๐Ÿ‘', '๐Ÿ‰', '๐Ÿ™Œ', '๐Ÿ—ฟ', '๐Ÿ˜Š', '๐Ÿฌ', '๐Ÿ˜น', '๐Ÿ‘ป', '๐Ÿš€', '๐Ÿš', '๐Ÿ‡', '๐Ÿ‡จ๐Ÿ‡ฆ']

onSelect: Function callback when emoji is selected


Github

import React from 'react';
import { GithubSelector } from 'react-reactions';

const Component = () => {
  return (
    <GithubSelector />
  )
}

Props:

reactions: Array of emoji to dispay. Defaults to ['๐Ÿ‘', '๐Ÿ‘Ž', '๐Ÿ˜„', '๐ŸŽ‰', '๐Ÿ˜•', 'โค๏ธ']

onSelect: Function callback when emoji is selected


Facebook

import React from 'react';
import { FacebookSelector } from 'react-reactions';

const Component = () => {
  return (
    <FacebookSelector />
  )
}

Props:

reactions: Array of strings for reactions to display. Defaults to ['like', 'love', 'haha', 'wow', 'sad', 'angry']

iconSize: String icon pixel size. Defaults to 38px

onSelect: Function callback when emoji is selected


Pokemon

import React from 'react';
import { PokemonSelector } from 'react-reactions';

const Component = () => {
  return (
    <PokemonSelector />
  )
}

Props:

reactions: Array of strings for reactions to display. Defaults to ['like', 'love', 'haha', 'wow', 'sad', 'angry']

iconSize: String icon pixel size. Defaults to 38px

onSelect: Function callback when emoji is selected


Counters

Github

import React from 'react';
import { GithubCounter } from 'react-reactions';

const Component = () => {
  return (
    <GithubCounter />
  )
}

Props:

counters: Array of counter objects structured such that:

{
  emoji: '๐Ÿ‘', // String emoji reaction
  by: 'case', // String of persons name
}

user: String name of user so that user displays as You

onSelect: Function callback when emoji is selected

onAdd: Function callback when add reaction is clicked


Youtube

import React from 'react';
import { YoutubeCounter } from 'react-reactions';

const Component = () => {
  return (
    <YoutubeCounter />
  )
}

Props:

like: String number of likes

dislike: String number of dislikes

onLikeClick: Function callback when like is clicked

onDislikeClick: Function callback when dislike is clicked


Facebook

import React from 'react';
import { FacebookCounter } from 'react-reactions';

const Component = () => {
  return (
    <FacebookCounter />
  )
}

Props:

counters: Array of counter objects structured such that:

{
  emoji: 'like', // String name of reaction
  by: 'Case Sandberg', // String of persons name
}

user: String name of user so that user displays as You

important: Array of strings for important users to display their name

bg: String of hex color for outline of overlapping reactions. Defaults to #fff

onClick: Function callback when clicked


Slack

import React from 'react';
import { SlackCounter } from 'react-reactions';

const Component = () => {
  return (
    <SlackCounter />
  )
}

Props:

counters: Array of counter objects structured such that:

{
  emoji: '๐Ÿ—ฟ', // String emoji reaction
  by: 'case', // String of persons name
}

user: String name of user so that user displays as You

onSelect: Function callback when emoji is selected

onAdd: Function callback when add reaction is clicked


100% inline styles via ReactCSS

Pokemon Illustrations by Chris Owens

react-reactions's People

Contributors

casesandberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-reactions's Issues

Show count data only

can i use this component to display the facebook reaction counts only. the counts will be fetched from facebook api. i just need it to show all those facebook reaction emojis with there respective counts below them. no click functionality needed. if we can't do it with this is there any other component for same.

How to change Styles?

I want to make some changes to the reactions container and alignment.
Does anyone know how to?

Can't import module

I can't seem to be able to integrate this module. (I use type script).

Keep getting this - 'Error: Can't resolve 'react-reactions' '.

Tried :
const FacebookSelector = require('react-reactions');
import * as Selectors from 'react-reactions';
import { FacebookSelector } from 'react-reactions';

None seem to work. I'll appreciate any help.

React app unable to compile

After installing via 'yarn add react-reactions', and attempting to include the SlackSelector. React app can no longer compile

./node_modules/react-reactions/src/index.js
SyntaxError: ...../node_modules/react-reactions/src/index.js: Support for the experimental syntax 'exportDefaultFrom' isn't >currently enabled (3:8):

1 | export default 'Reactions'
2 |
3 | export FacebookSelector from './components/facebook/FacebookSelector'
4 | export GithubSelector from './components/github/GithubSelector'
5 | export PokemonSelector from './components/pokemon/PokemonSelector'
6 | export SlackSelector from './components/slack/SlackSelector'

Add @babel/plugin-proposal-export-default-from (https://git.io/vb4yH) to the 'plugins' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-export-default-from (https://git.io/vb4SO) to the 'plugins' section to enable parsing.

Are there other dependencies / installation steps besides what's documented? Any help appreciated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.