mirror of
https://github.com/fazo96/ipfs-boards
synced 2025-01-25 14:54:19 +01:00
updated postpage
This commit is contained in:
parent
e2d1fd1ed8
commit
ce187c3ddc
@ -43,7 +43,7 @@ module.exports = function(boardsAPI){
|
||||
<div className="icons">
|
||||
<UserID id={this.props.post.op}></UserID>
|
||||
<Icon name="clock-o" className="not-first"/> {this.getDate()}
|
||||
<Icon name="comments" className="not-first" /> <Link to={this.postLink()}>View</Link>
|
||||
<Icon name="comments" className="not-first" /> <Link className="nounderline" to={this.postLink()}>View</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,4 +1,5 @@
|
||||
var React = require('react')
|
||||
var Link = require('react-router').Link
|
||||
|
||||
module.exports = function(boardsAPI){
|
||||
var UserID = require('userID.jsx')(boardsAPI)
|
||||
@ -10,6 +11,7 @@ module.exports = function(boardsAPI){
|
||||
},
|
||||
componentDidMount: function(){
|
||||
boardsAPI.use(boards => {
|
||||
boards.init()
|
||||
boards.getEventEmitter().on('init', err => {
|
||||
if(!err && this.isMounted()){
|
||||
this.init(boards)
|
||||
@ -31,9 +33,22 @@ module.exports = function(boardsAPI){
|
||||
}
|
||||
})
|
||||
},
|
||||
getContext(){
|
||||
if(this.props.params.userid){
|
||||
if(this.props.params.boardname)
|
||||
return <div>Posted by <UserID id={this.props.params.userid} /> in <Link to={'@/'+this.props.params.userid+'/'+this.props.params.boardname}>#{this.props.params.boardname}</Link></div>
|
||||
else
|
||||
return <div>Posted by <UserID id={this.props.params.userid} /></div>
|
||||
} else return <div><h6 className="light">You are viewing a single post</h6></div>
|
||||
},
|
||||
render: function(){
|
||||
if(this.state.api)
|
||||
return <Post post={this.state.post} board={this.props.params.boardname} />
|
||||
return <div className="post-page">
|
||||
<div className="text-center">
|
||||
{this.getContext()}
|
||||
</div>
|
||||
<Post post={this.state.post} board={this.props.params.boardname} />
|
||||
</div>
|
||||
else return <GetIPFS />
|
||||
}
|
||||
})
|
||||
|
@ -20,6 +20,10 @@ a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.black {
|
||||
color: black
|
||||
}
|
||||
|
||||
.center-block {
|
||||
margin:auto;
|
||||
display:block;
|
||||
@ -75,6 +79,10 @@ a:hover {
|
||||
color: #707070;
|
||||
}
|
||||
|
||||
.post .icons .a {
|
||||
color: #707070;
|
||||
}
|
||||
|
||||
.post .icons .user-id {
|
||||
display: inline-block;
|
||||
}
|
||||
@ -83,6 +91,10 @@ a:hover {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
.post-page .user-id {
|
||||
display: inline
|
||||
}
|
||||
|
||||
.navbar {
|
||||
border-bottom: 1px solid #eee;
|
||||
display: block;
|
||||
|
Loading…
Reference in New Issue
Block a user