show all posts within a distance of 10km
This commit is contained in:
@@ -21,6 +21,10 @@ h1 {
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
color: #ff9908;
|
||||||
|
}
|
||||||
|
|
||||||
.new-post-form {
|
.new-post-form {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -5,14 +5,22 @@ import { faCaretUp, faCaretDown } from '@fortawesome/free-solid-svg-icons';
|
|||||||
const Post = ({ post, upvotePost, downvotePost }) => {
|
const Post = ({ post, upvotePost, downvotePost }) => {
|
||||||
return (
|
return (
|
||||||
<div className="post">
|
<div className="post">
|
||||||
|
<div className="post-container">
|
||||||
|
<div className="post-title">
|
||||||
|
<h3>{post.title}</h3>
|
||||||
|
</div>
|
||||||
<div className="post-content">
|
<div className="post-content">
|
||||||
<p>{post.text}</p>
|
<p>{post.content}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="votes">
|
<div className="votes">
|
||||||
<button onClick={(e) => { e.stopPropagation(); upvotePost(post.id); }}>
|
<button onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
upvotePost(post.id);
|
||||||
|
}}>
|
||||||
<FontAwesomeIcon icon={faCaretUp} />
|
<FontAwesomeIcon icon={faCaretUp} />
|
||||||
</button>
|
</button>
|
||||||
<span>{post.upvotes - post.downvotes}</span>
|
<span>{post.reactions.positive - post.reactions.negative}</span>
|
||||||
<button onClick={(e) => { e.stopPropagation(); downvotePost(post.id); }}>
|
<button onClick={(e) => { e.stopPropagation(); downvotePost(post.id); }}>
|
||||||
<FontAwesomeIcon icon={faCaretDown} />
|
<FontAwesomeIcon icon={faCaretDown} />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user