All Projects → markmur → React Slack Feedback

markmur / React Slack Feedback

Licence: mit
Unofficial React component for gathering user feedback to send to slack.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Slack Feedback

Ctfeedbackswift
Feedback mail composer for iOS re-written in Swift of CTFeedback
Stars: ✭ 62 (-17.33%)
Mutual labels:  feedback
Slack Ooo Personal
Personal Slack Out of Office Bot
Stars: ✭ 65 (-13.33%)
Mutual labels:  slack
Showcase Ansible Chatops
Vagrant Demo showing ChatOps with Ansible
Stars: ✭ 71 (-5.33%)
Mutual labels:  slack
Auto
Generate releases based on semantic version labels on pull requests.
Stars: ✭ 1,120 (+1393.33%)
Mutual labels:  slack
Slacko
A neat interface for Slack
Stars: ✭ 64 (-14.67%)
Mutual labels:  slack
Typora Issues
Bugs, suggestions or free discussions about the minimal markdown editor — Typora
Stars: ✭ 1,147 (+1429.33%)
Mutual labels:  feedback
Backup Slack
A script for backing up your message history from Slack
Stars: ✭ 61 (-18.67%)
Mutual labels:  slack
Slamp
Chat with big :emoji: like stamp
Stars: ✭ 74 (-1.33%)
Mutual labels:  slack
Skellington
✨💀✨ The skeleton for your bots
Stars: ✭ 65 (-13.33%)
Mutual labels:  slack
Ex mustang
✨ A simple, clueless bot
Stars: ✭ 67 (-10.67%)
Mutual labels:  slack
Vili
Stars: ✭ 62 (-17.33%)
Mutual labels:  slack
Jonsnow
App Store/Google Play review watcher, deliver new reviews to slack channel
Stars: ✭ 65 (-13.33%)
Mutual labels:  slack
Hubcommander
A Slack bot for GitHub organization management -- and other things too
Stars: ✭ 1,149 (+1432%)
Mutual labels:  slack
Fantasy Football Metrics Weekly Report
Command line application to create weekly reports (containing stats, metrics, and rankings) for Fantasy Football leagues on the following platforms: Yahoo, Fleaflicker, Sleeper, ESPN.
Stars: ✭ 62 (-17.33%)
Mutual labels:  slack
Serverless Slackbot
A boilerplate Serverless Slackbot framework with a custom scripts folder (like Hubot)
Stars: ✭ 72 (-4%)
Mutual labels:  slack
Pinpointkit
Send better feedback
Stars: ✭ 1,115 (+1386.67%)
Mutual labels:  feedback
Busy Beaver
The Chicago Python Community Engagement Slack bot
Stars: ✭ 66 (-12%)
Mutual labels:  slack
Slack Dark Theme
Upgraded version of slack-black-theme
Stars: ✭ 75 (+0%)
Mutual labels:  slack
Logback Slack Appender
Logback appender for Slack messenger
Stars: ✭ 73 (-2.67%)
Mutual labels:  slack
Jbot
Make Slack and Facebook Bots in Java.
Stars: ✭ 1,148 (+1430.67%)
Mutual labels:  slack

React Slack Feedback

View live demo

Customizable React component for gathering user feedback to send to slack.

Build Status XO code style

Usage

Install with yarn or npm:

yarn add react-slack-feedback styled-components

To use the component, import it and render in your app's global component, or individual components (if you don't want it on every page).

NOTE: Your Slack Webhook URL should never be available on the front end. For this reason you must have a server which sends the request to slack. This component will produce the JSON object to send to Slack but it won't send the request for you.

import SlackFeedback, { themes } from 'react-slack-feedback'

ReactDOM.render(
  <SlackFeedback
    channel="#general"
    theme={themes.dark} // (optional) See src/themes/default for default theme
    user="Slack Feedback" // The logged in user (default = "Unknown User")
    onImageUpload={(image, success,error) => 
      uploadImage(image)
        .then(({ url }) => success(url))
        .catch(error)
    }
    onSubmit={(payload, success, error) => 
      sendToServer(payload)
        .then(success)
        .catch(error)
     }
  />,
  document.getElementById('root')
)

function sendToServer(payload, success, error) {
  return fetch('/api/slack', {
    method: 'POST',
    body: JSON.stringify(payload)
  })
  .then(success)
  .catch(error)
}

function uploadImage(image, success, error) {
  var form = new FormData()
  form.append('image', image)

  return fetch('/api/upload', { method: 'POST', data: form })
    .then(({ url }) => success(url))
    .catch(err => error(err))
  )
}

Props

Prop Type Default Required Description
channel String For visual purposes - changing this value will not change the slack channel.
defaultSelectedType String
disabled Boolean false Disable the component entirely. Returns null. Can be used to disable the component on specific pages
errorTimeout Number 8000 (8 seconds)
feedbackTypes Array<{ value: String, label: String }> See code
icon Function () => <SlackIcon />
onClose Function
onImageUpload Function Method that will be called with a file argument
onOpen Function
onSubmit Function required A JSON payload object will be returned when the user submits the form.
sentTimeout Number 5000 (5 seconds)
showChannel Boolean true
showIcon Boolean true
theme Object See themes directory
translations Object See translations file
user String "Unknown User" The logged in user's name (if applicable)

NOTE: All slack channels are lowercase. The string should be identical to the channel name e.g '#feedback'

Callback Functions

Function Arguments Description
onSubmit (payload: Object, success: Function, error: Function) Called when the user hits send. Use the success callback to indicate that the request was successful. Use the error callback to indicate failure.
onImageUpload (image: Object, success: Function, error: Function) Called when an image has been uploaded.

Contributing

Running Locally

To run this module locally:

  1. Clone the repo:
git clone https://github.com/markmur/react-slack-feedback.git
  1. Install the node modules
yarn
  1. Run the demo:
WEBHOOK_URL='YOUR_SLACK_WEBHOOK_URL' yarn start

This will bundle the client with parcel and startup a simple express server.

The server will be listening on http://localhost:8080

The client will be listening on http://localhost:1234

Open http://localhost:1234 to view the demo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].