@espresso-org/aragon-comments

0.0.8 • Public • Published

Aragon Comments

Aragon Comments offers an easy way for developers to integrate discussion threads to their Aragon app.

Install

npm install --save @espresso-org/aragon-comments

Usage

  1. Import and inherit the HasComments solidity smart contract.
import "@espresso-org/aragon-comments/contracts/HasComments.sol";

contract MyApp is HasComments, AragonApp {
    ...
}
  1. Add the postComment function to your smart contract. This function lets you write custom validation logic on the author and message content before posting a comment to a discussion thread.
contract MyApp is HasComments, AragonApp {

    function postComment(string comment, string threadName) public {
        aragonComments.postComment(comment, msg.sender, threadName);
    }  

}
  1. Import and add the CommentThread react component to your javascript frontend.
import { CommentThread } from '@espresso-org/aragon-comments'

class App extends React.Component {
  render () {
    return (
      <div>
      ...
        <CommentThread 
            aragonApp={this.props.app} 
            thread="my-comment-thread" 
        />
      </div>
    )
  }
}
  1. Make sure to install the Aragon Comments app to your DAO.
aragon dao install <dao address> aragon-comments

Readme

Keywords

none

Package Sidebar

Install

npm i @espresso-org/aragon-comments

Weekly Downloads

1

Version

0.0.8

License

MIT

Unpacked Size

9.97 MB

Total Files

35

Last publish

Collaborators

  • juslar
  • mcormier