show all posts within a distance of 10km

This commit is contained in:
Pete Gerlach
2024-06-11 14:23:39 +02:00
parent b87c215525
commit 0ab53963fb
2 changed files with 16 additions and 4 deletions

View File

@@ -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;

View File

@@ -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>