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

popchat

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

popchat

A react module to manage your chatheads onscreen, on any page. 1. Load the component on any parent component. It takes in 4 props, they are 1. `chatHead`: Takes in a string to as the name of the tab 2. `messages`: Takes an array of messages to disp

latest
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

Guide

A react module to manage your chatheads onscreen, on any page.

  • Load the component on any parent component. It takes in 4 props, they are
    • chatHead: Takes in a string to as the name of the tab
    • messages: Takes an array of messages to display. The array contains object of following structure,
          const messages = [
              {
                  sender: 'me',   //displayed in pale background
                  text: 'hey there!' 
              },
              {
                  sender: 'others',//displayed in background color specified in themeColor prop
                  text: 'what's up
              }
          ]
      
    • getMessage: A function to retriev the message in the bubbel input, fired on pressing the Enter. Here's to define,
        const getMessage = (msg) => { 
            //process msg, the message in string 
            console.log(msg)
        } 
    
    • themeColor: Optional prop t ospecify the theme color of the component, violet by default.

Here's a complete picture,

      const msgs = [
    {
      sender: 'me',
      text: 'hey, whatsup!'
    },
    {
      sender: 'others',
      text: 'hey, whatsup!'
    }, 
    {
      sender: 'others',
      text: 'hey, whatsup!'
    },
    {
      sender: 'me',
      text: 'hey, whatsup!'
    },
  ]
  const getMessage = (msg) => {
    console.log('App', msg)
  }
  
  return (
    <div>
        <Popchat messages={msgs} getMessage={getMessage} themeColor={'lightseagreen'} chatHead={'John Doe'} />
    </div>
  )

Keywords

popchat

FAQs

Package last updated on 12 Sep 2020

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