mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-18 11:08:47 +00:00
Fix merge errors, but posts are not displaying on home.js
This commit is contained in:
parent
a459e6581e
commit
f30a9ae27c
@ -142,67 +142,63 @@ class Home extends Component {
|
|||||||
console.log(hiddenBool);
|
console.log(hiddenBool);
|
||||||
let postMarkup = this.state.posts ? (
|
let postMarkup = this.state.posts ? (
|
||||||
// <<<<<<< admin-delete
|
// <<<<<<< admin-delete
|
||||||
this.state.posts.map(post => post.hidden ? null :
|
this.state.posts.map(post => !post.hidden && this.state.following && this.state.following.includes(post.userHandle) ? (
|
||||||
this.state.following ?
|
<Card className={classes.card} key={post.postId}>
|
||||||
this.state.following.includes(post.userHandle) ? (
|
<CardContent>
|
||||||
<Card className={classes.card} key={post.postId}>
|
<Typography>
|
||||||
<CardContent>
|
{/* {
|
||||||
<Typography>
|
this.state.imageUrl ? (<img src={this.state.imageUrl} height="50" width="50" />) :
|
||||||
{/* {
|
(<img src={noImage} height="50" width="50"/>)
|
||||||
this.state.imageUrl ? (<img src={this.state.imageUrl} height="50" width="50" />) :
|
} */}
|
||||||
(<img src={noImage} height="50" width="50"/>)
|
{
|
||||||
} */}
|
post.profileImage ? (<img src={post.profileImage} height="50" width="50" />) :
|
||||||
{
|
(<img src={noImage} height="50" width="50"/>)
|
||||||
post.profileImage ? (<img src={post.profileImage} height="50" width="50" />) :
|
}
|
||||||
(<img src={noImage} height="50" width="50"/>)
|
</Typography>
|
||||||
}
|
<Typography variant="h5"><b>{post.userHandle}</b></Typography>
|
||||||
</Typography>
|
<Typography variant="body2" color={"textSecondary"}>{this.formatDate(post.createdAt)}</Typography>
|
||||||
<Typography variant="h5"><b>{post.userHandle}</b></Typography>
|
<br />
|
||||||
<Typography variant="body2" color={"textSecondary"}>{this.formatDate(post.createdAt)}</Typography>
|
<Typography variant="body1"><b>{post.microBlogTitle}</b></Typography>
|
||||||
<br />
|
<Typography variant="body2">{post.quoteBody}</Typography>
|
||||||
<Typography variant="body1"><b>{post.microBlogTitle}</b></Typography>
|
<br />
|
||||||
<Typography variant="body2">{post.quoteBody}</Typography>
|
<Typography variant="body2">{post.body}</Typography>
|
||||||
<br />
|
<br />
|
||||||
<Typography variant="body2">{post.body}</Typography>
|
<Typography variant="body2"><b>Topics:</b> {post.microBlogTopics.join(", ")}</Typography>
|
||||||
<br />
|
<br />
|
||||||
<Typography variant="body2"><b>Topics:</b> {post.microBlogTopics.join(", ")}</Typography>
|
{!hiddenBool &&
|
||||||
<br />
|
<Button
|
||||||
{!hiddenBool &&
|
onClick={this.flagPost}
|
||||||
<Button
|
data-key={post.postId}
|
||||||
onClick={this.flagPost}
|
variant = "contained"
|
||||||
data-key={post.postId}
|
color = "primary"
|
||||||
variant = "contained"
|
>
|
||||||
color = "primary"
|
Hide Post
|
||||||
>
|
</Button>
|
||||||
Hide Post
|
}
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
|
|
||||||
<Typography id={post.postId} data-likes={post.likeCount} variant="body2" color={"textSecondary"}>Likes {post.likeCount}</Typography>
|
<Typography id={post.postId} data-likes={post.likeCount} variant="body2" color={"textSecondary"}>Likes {post.likeCount}</Typography>
|
||||||
{/* <Like microBlog = {post.postId} count = {post.likeCount} name = {username}></Like> */}
|
{/* <Like microBlog = {post.postId} count = {post.likeCount} name = {username}></Like> */}
|
||||||
<Button
|
<Button
|
||||||
onClick={this.handleClickLikeButton}
|
onClick={this.handleClickLikeButton}
|
||||||
data-key={post.postId}
|
data-key={post.postId}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
color="primary"
|
color="primary"
|
||||||
>{
|
>{
|
||||||
this.state.likes && this.state.likes.includes(post.postId) ? 'Unlike' : 'Like'
|
this.state.likes && this.state.likes.includes(post.postId) ? 'Unlike' : 'Like'
|
||||||
}</Button>
|
}</Button>
|
||||||
<Quote microblog = {post.postId}></Quote>
|
<Quote microblog = {post.postId}></Quote>
|
||||||
|
|
||||||
{/* <button>Quote</button> */}
|
{/* <button>Quote</button> */}
|
||||||
|
|
||||||
<Typography variant="body2" color={"textSecondary"}>Likes {post.likeCount} Comments {post.commentCount}</Typography>
|
<Typography variant="body2" color={"textSecondary"}>Likes {post.likeCount} Comments {post.commentCount}</Typography>
|
||||||
|
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
) : (
|
|
||||||
<p></p>
|
|
||||||
)
|
|
||||||
) : (
|
) : (
|
||||||
<p></p>
|
<p></p>
|
||||||
)
|
)
|
||||||
|
)
|
||||||
// =======
|
// =======
|
||||||
// this.state.posts.map(post =>
|
// this.state.posts.map(post =>
|
||||||
// this.state.following ? (
|
// this.state.following ? (
|
||||||
@ -214,7 +210,7 @@ class Home extends Component {
|
|||||||
// <p></p>
|
// <p></p>
|
||||||
// )
|
// )
|
||||||
// >>>>>>> master
|
// >>>>>>> master
|
||||||
)
|
|
||||||
) : (
|
) : (
|
||||||
<p>Loading post...</p>
|
<p>Loading post...</p>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user