var React = require('react')
var GetIPFS = require('getipfs.jsx')
var Icon = require('icon.jsx')
var Link = require('react-router').Link
var { Error, Loading, Saving } = require('status-components.jsx')
module.exports = function (boardsAPI) {
return React.createClass({
getInitialState () {
return { }
},
componentDidMount () {
boardsAPI.use(boards => {
boards.init()
boards.getEventEmitter().on('init', err => {
if (!err && this.isMounted()) {
this.init(boards)
}
})
if (this.isMounted() && boards.isInit) {
this.init(boards)
}
})
},
init (boards) {
if (this.state.init) return
this.setState({ api: boards, init: true })
// TODO: DOWNLOAD POST
},
handleChange (event) {
var obj = {}
obj[event.target.id] = event.target.value
this.setState(obj)
},
skip () {
this.setState({ loading: false, updating: false, error: false })
},
refresh () {
this.setState({ loading: true })
// boardsAPI.use(b => this.getBoardSettings(b))
// TODO: DOWNLOAD POST
},
save () {
this.setState({ updating: true })
// TODO: SAVE POST IMPL
},
additionalButtons () {
if (this.state.api && this.props.params.posthash) {
var url = '/@' + this.state.api.getMyID() + '/' + this.props.params.boardname + '/post/' + this.props.params.posthash
return
View
} else {
return
}
},
render () {
if (this.state.api) {
if (this.state.error) {
return Pressing the Skip button will not abort the publish operation.
This App uses IPFS to store your Posts. When you are offline, other users or servers that viewed your content will serve it to others.
Warning: due to a bug in go-ipfs, it may take up to a minute for your changes to be visibile. Your Post will not appear or appear unchanged during this time.