Fix merge errors, but posts are not displaying on home.js

This commit is contained in:
Clayton Wilson 2019-12-06 12:07:36 -05:00
parent a459e6581e
commit f30a9ae27c

View File

@ -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>
{/* <Like microBlog = {post.postId} count = {post.likeCount} name = {username}></Like> */}
<Typography id={post.postId} data-likes={post.likeCount} variant="body2" color={"textSecondary"}>Likes {post.likeCount}</Typography> <Button
{/* <Like microBlog = {post.postId} count = {post.likeCount} name = {username}></Like> */} onClick={this.handleClickLikeButton}
<Button data-key={post.postId}
onClick={this.handleClickLikeButton} disabled={loading}
data-key={post.postId} variant="outlined"
disabled={loading} color="primary"
variant="outlined" >{
color="primary" this.state.likes && this.state.likes.includes(post.postId) ? 'Unlike' : 'Like'
>{ }</Button>
this.state.likes && this.state.likes.includes(post.postId) ? 'Unlike' : 'Like' <Quote microblog = {post.postId}></Quote>
}</Button>
<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>
); );