0.0.8 • Published 6 years ago

@espresso-org/aragon-comments v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

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
0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago