Socket
Socket
Sign inDemoInstall

react-kinops-discussions

Package Overview
Dependencies
15
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-kinops-discussions

Utilities and components for development with React and Kinops Discussions


Version published
Weekly downloads
0
decreased by-100%
Maintainers
4
Created
Weekly downloads
 

Readme

Source

React Kinops Common

Helpful components for developing Kinetic Kinops bundles with React.

Quick Start

Step 1: Add the library

yarn add react-kinops-discussion react-kinops-common

Step 1b. Setup react-kinops-common.

See the react-kinops-common repo for more information.

Step 2. Add the reducers to your existing Redux.

Then you will want to include the shared reducers into your store:

import { reducers as discussionReducers } from 'react-kinops-discussions';

// Change this in your store creation:
combineReducers({ ...reducers })

// To this:
combineReducers({ ...reducers, ...discussionReducers })

Step 3. Add the sagas to your existing sagas.

Then you need to merge your sagas with the shared sagas:

import { saga as discussionsSagas, combineSagas } from 'react-kinops-discussions';

// From this:
sagaMiddleware.run(sagas));
// To this:
sagaMiddleware.run(combineSagas([sagas, discussionsSagas]));

Step 4. Include the shared CSS

import 'react-kinops-discussions/styles/master.scss';

Step 5. Add the components

import { Discussion } from 'react-kinops-discussions';

// Example.
export const Layout = ({ discussionId }) =>
  <div>
    <Discussion isMobileModal discussionId={discussionId} />
  </div>;

The Discussion component takes four possible props:

  • discussionId - the GUID for the Kinops Discussion
  • isModal - if the discussion should always be rendered in a modal.
  • isMobileModal - if the discussion should be rendered in a modal when in mobile mode.
  • renderClose - a render prop defining the React component and behavior for the close button on the top left.

When using either modal mode you must dispatch an action to open the discussion modal:

import { actions } from 'react-kinops-discussions';

dispatch(actions.openModal(discussionId, 'discussion'));

FAQs

Last updated on 06 Mar 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc