GithubHelp home page GithubHelp logo

disqus-react's Introduction

disqus-react

npm version

A package for integrating Disqus services into React applications.

Installation

Using npm:

$ npm install --save disqus-react

Using yarn:

$ yarn add disqus-react

Usage

DiscussionEmbed

This is the component that will load the main Disqus comments section.

import { DiscussionEmbed } from 'disqus-react';

<DiscussionEmbed
    shortname='example'
    config={
        url: this.props.article.url,
        identifier: this.props.article.id,
        title: this.props.article.title,
    }
/>

This component is limited to one instance in the DOM at a time and will handle updates to both the config and shortname props and reload appropriately with the new discussion thread.

CommentCount

This component will display the comment count for the Disqus thread associated with the provided config.

import { CommentCount } from 'disqus-react';

<Disqus.CommentCount
    shortname='example'
    config={
        url: this.props.article.url,
        identifier: this.props.article.id,
        title: this.props.article.title,
    }
>
    {/* Placeholder Text */}
    Comments
</Disqus.CommentCount>

Multiple instances of this component can be included on the same page with different config variables (e.g. an article list showing the comment count for each). However, all threads on the site must be under the same primary site shortname. If the component receives a new shortname, all instances will be reset with counts for threads matching the updated site.

CommentEmbed

This component can be used to embed a Disqus comment into your page.

import { CommentEmbed } from 'disqus-react';

<CommentEmbed
    commentId={this.props.article.featuredCommentId}
    showMedia={true}
    showParentComment={true}
    width={420}
    height={320}
/>

Multiple instances of this component may be include on the same page with different commentId variables and does not require that the embedded comment be under the same primary site shortname.

Contributing

If you'd like to contribute to this package feel free to submit a bug report, feature request, or pull request. Though we would ask that you first read through the contributing guidelines.

disqus-react's People

Contributors

tterb avatar ryanvalentin avatar dependabot[bot] avatar lmammino avatar mateja176 avatar lavrton avatar icandivideby0 avatar hsh2001 avatar zhangyijiang avatar alexmateos avatar camilasousa avatar poohitan avatar

Watchers

James Cloos avatar

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.