Skip to content

Nav bar #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
40f3538
Update README.md
Destinek Apr 3, 2023
58a30de
Merge pull request #1 from Destinek/patch-1
Destinek Apr 3, 2023
7edbec9
add new post from with bug
J-Neuwford Apr 8, 2023
5ed4a82
bug: displays posts from db but not not new posts
J-Neuwford Apr 8, 2023
c931f3a
added placeholder refresh to show new posts
J-Neuwford Apr 8, 2023
dc76593
displays newest post first
J-Neuwford Apr 8, 2023
998e412
added notation for readability
J-Neuwford Apr 9, 2023
787139b
refactored add post code
J-Neuwford Apr 10, 2023
e2119e0
Merge pull request #2 from Destinek/adding-posts-to-feed
francescoGuglielmi Apr 11, 2023
da8ca18
refactor
J-Neuwford Apr 11, 2023
3df0fe8
Merge pull request #3 from Destinek/adding-posts-to-feed
Destinek Apr 11, 2023
5d31e0f
commit for pull
kamafe Apr 11, 2023
e709056
Merge branch 'main' of https://github.com/Destinek/acebook-earth
kamafe Apr 11, 2023
9e9a56a
response type bug
J-Neuwford Apr 11, 2023
5c4bb66
can now like posts
J-Neuwford Apr 11, 2023
9b6ea30
fixed like bug
J-Neuwford Apr 12, 2023
33adf38
Merge pull request #4 from Destinek/post-likes
Destinek Apr 12, 2023
d6d071e
basic implementation of comments and basic style for a neater look
Apr 12, 2023
27056b7
Merge pull request #5 from Destinek/comments
J-Neuwford Apr 13, 2023
1a2d9c0
updated user schema and signup form
J-Neuwford Apr 13, 2023
b5bc66e
added usernames to posts
J-Neuwford Apr 13, 2023
31d9507
Merge pull request #6 from Destinek/adding-username-to-posts
francescoGuglielmi Apr 13, 2023
0707f0d
added default profile picture
J-Neuwford Apr 13, 2023
42a7986
NavBar
kamafe Apr 13, 2023
b5d69d8
Merge pull request #7 from Destinek/default_profile_pics
J-Neuwford Apr 13, 2023
766164f
navbar proper
kamafe Apr 13, 2023
ba8c315
Merge branch 'main' into nav-bar
kamafe Apr 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor
J-Neuwford committed Apr 11, 2023
commit da8ca1854dc4a55dff1c89c27a8c6685bd85ff36
13 changes: 9 additions & 4 deletions frontend/src/components/feed/Feed.js
Original file line number Diff line number Diff line change
@@ -45,16 +45,21 @@ const Feed = ({ navigate }) => {
})
.then((response) => response.json())
.then((data) => {

//sets posts to all posts + the new post
setPosts([...posts, data])
setMessage('')
setPosts([...posts, data])
setMessage('')

// this refreshes the whole window which is not ideal.
window.location.reload();
})
.catch((error) => console.error(error));
};

// handleLikeButton ??
// stringify (likes)
//setLikes(post.likes + 1)
//reload

// LOGOUT --------------------------------
const logout = () => {
window.localStorage.removeItem("token")
@@ -68,7 +73,7 @@ const Feed = ({ navigate }) => {
{
posts.map(
(post) => (
<Post post={post} key={ post._id } /> )
<Post post={post} key={ post._id } />)
)}
</div>
)
6 changes: 5 additions & 1 deletion frontend/src/components/post/Post.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import React from 'react';

const Post = ({post}) => {

return(
<article data-cy="post" key={ post._id }>{ post.message }</article>
<>
<article data-cy="post" key={ post._id }>{ post.message }</article>
</>

)
}