Skip to content
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

Error messages #21

Open
wants to merge 126 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
38a4c22
Linked Trello Board in the Card Wall section
kateusacova Oct 31, 2022
51056fa
sign up css file linking with react
Oct 31, 2022
3797f13
Login page css
Ollie-HB Oct 31, 2022
57ecdb9
Signup form styled
tauqeer92 Oct 31, 2022
0eb6647
deleting html file
Oct 31, 2022
59ff09b
Basic CSS for post, feed and app
kateusacova Oct 31, 2022
3681ed6
Merge pull request #1 from kateusacova/css-feed-and-post
kateusacova Oct 31, 2022
9b651d5
Merge pull request #2 from kateusacova/Login-page-css
kateusacova Oct 31, 2022
e85b8e9
deleting screen shot
Nov 1, 2022
64c64e2
Merge pull request #3 from kateusacova/signup-css
kateusacova Nov 1, 2022
17f0389
renaming sumbit button back to submit for signup page
Nov 1, 2022
c2f7fd2
adding sign up button
Nov 1, 2022
5e62c21
post schema
paulinejdavis Nov 1, 2022
193dffa
Merge pull request #4 from kateusacova/post_schema
paulinejdavis Nov 1, 2022
258f061
css aligned across login, signup, posts
Nov 1, 2022
8f445e7
centering the pages
Nov 1, 2022
d2b2ebf
moved body css to app.css
Nov 1, 2022
7587eee
likes and comments schema skeleton created
Nov 1, 2022
304392e
Merge pull request #5 from kateusacova/css-merge
laurenbrabbin Nov 1, 2022
7798518
Name field created on schema and form
tauqeer92 Nov 1, 2022
65d27f5
post model
Nameo91 Nov 1, 2022
e0946af
Merge pull request #6 from kateusacova/post
Nameo91 Nov 1, 2022
1260a4e
Merge branch 'main' into signup_form_schema
tauqeer92 Nov 1, 2022
718f104
Merge pull request #7 from kateusacova/signup_form_schema
tauqeer92 Nov 1, 2022
e4686a8
Merge pull request #8 from kateusacova/likes-and-comments-schemas
laurenbrabbin Nov 1, 2022
203cd76
name added to the form and schema
tauqeer92 Nov 1, 2022
ecce733
adding name to user
Nov 1, 2022
720360d
adding name to user
Nov 1, 2022
f4ebdb6
adding name to user
Nov 1, 2022
f697bed
Merge pull request #9 from kateusacova/user-name
laurenbrabbin Nov 1, 2022
4645a42
finally everything works
tauqeer92 Nov 2, 2022
2a1dda9
fixed signup
tauqeer92 Nov 2, 2022
afab3b5
creating new branch
Nov 2, 2022
6941a6f
created the create post button
Nov 2, 2022
d47065d
created postForm page
Nov 2, 2022
6c35678
create post box
Nameo91 Nov 2, 2022
04780a1
Merge pull request #10 from kateusacova/postfeed
Nameo91 Nov 2, 2022
5e5fec7
Merge branch 'main' into post-interface
laurenbrabbin Nov 2, 2022
9655ddb
Merge pull request #11 from kateusacova/post-interface
laurenbrabbin Nov 2, 2022
389b8e7
removing duplicate handleNameChange in signup form
Nov 2, 2022
fefc52b
updating feed.js frontend
Nov 2, 2022
616217e
create post frontend
Nameo91 Nov 3, 2022
d8d1aec
Merge pull request #12 from kateusacova/create_post_frontend
Nameo91 Nov 3, 2022
9990463
merging signup and login body into the same class
Nov 3, 2022
2e2cbf2
sign up form test working
paulinejdavis Nov 3, 2022
f358c2f
login and sign up page consistent
Nov 3, 2022
b671163
Merge pull request #13 from kateusacova/signup_test
paulinejdavis Nov 3, 2022
83fa46f
splitting post webpage into 3 classes
Nov 3, 2022
9715b3d
merging to main branch
Nov 3, 2022
61f8aa2
Merge pull request #14 from kateusacova/css-classes
laurenbrabbin Nov 3, 2022
c10bb62
API tests pass except posts
tauqeer92 Nov 3, 2022
d25676b
Merge pull request #15 from kateusacova/tests
tauqeer92 Nov 3, 2022
3b5ea0c
fetching api for post
Nameo91 Nov 3, 2022
46df689
Merge branch 'main' into post_fectching_api
Nameo91 Nov 3, 2022
31b28a1
Merge pull request #16 from kateusacova/post_fectching_api
Nameo91 Nov 3, 2022
0ef18ed
resolving merge conflicts in feed.js
Nov 3, 2022
37149bb
footer put into app.js
Nov 3, 2022
c4d1b4e
post css looking better
Nov 3, 2022
149cffb
password encryption
paulinejdavis Nov 3, 2022
35f63d5
nav bar framework set up
Nov 3, 2022
494c548
nav bar framework set up
Nov 3, 2022
2a3d9ac
print user name and image
Nameo91 Nov 3, 2022
5acc811
including post and user in likes and comment schema
Nov 4, 2022
e3deefd
basic navbar set up
Nov 4, 2022
125e7fe
creating nav bar css folder
Nov 4, 2022
9433c26
creating navbar css file
Nov 4, 2022
da9bddf
Merge branch 'main' into populate_user
Nameo91 Nov 4, 2022
6ebee50
Merge pull request #20 from kateusacova/populate_user
Nameo91 Nov 4, 2022
1b7163a
Merge branch 'main' into css-nav
laurenbrabbin Nov 4, 2022
75713ba
Merge pull request #21 from kateusacova/css-nav
laurenbrabbin Nov 4, 2022
e582e3c
hassle
paulinejdavis Nov 4, 2022
3356924
more hassle
paulinejdavis Nov 4, 2022
97569c7
renaming navbar files
Nov 4, 2022
b2d980d
Merge branch 'main' into bcrypt_pd
kateusacova Nov 4, 2022
02e4077
Merge pull request #24 from kateusacova/bcrypt_pd
kateusacova Nov 4, 2022
76af487
bcrypt bug
Nameo91 Nov 4, 2022
89c00fe
Merge pull request #25 from kateusacova/bcrypt_problem
Nameo91 Nov 4, 2022
6446a1b
Latest main branch - all working
kateusacova Nov 4, 2022
676910a
Likes added to Post model, basic model test passing
Ollie-HB Nov 4, 2022
e91bd8c
debug log in encryption
Nameo91 Nov 4, 2022
3369520
Merge pull request #26 from kateusacova/log_in_encryption
Nameo91 Nov 4, 2022
57022b2
Partly completed css for posts and comments
kateusacova Nov 5, 2022
ebf350a
Merge pull request #27 from kateusacova/comments-css
kateusacova Nov 5, 2022
80817a4
Merge branch 'main' into likes
kateusacova Nov 5, 2022
6584645
Merge pull request #28 from kateusacova/likes
kateusacova Nov 5, 2022
72435a1
comments show on console
tauqeer92 Nov 6, 2022
1126d37
adding like count from database into post.js
Nov 7, 2022
dd59614
updating css so create a post element does not overlap with posts
Nov 7, 2022
13c6809
recentering login and signup box
Nov 7, 2022
c6d1d22
CSS and encryption fix
kateusacova Nov 7, 2022
c983b5d
CSS and encryption fix
kateusacova Nov 7, 2022
5b9da6b
Merge branch 'main' into css-rework
kateusacova Nov 7, 2022
1634b47
Merge pull request #29 from kateusacova/css-rework
kateusacova Nov 7, 2022
8b5fedf
shaded heart comment
Nov 7, 2022
1f35fdc
Merge branch 'main' into comments
kateusacova Nov 7, 2022
d749155
Merge pull request #30 from kateusacova/comments
kateusacova Nov 7, 2022
d018ea1
id adding to like count in console but not database
Nov 7, 2022
e09c6ae
displaying comments in progress
Nameo91 Nov 7, 2022
c993def
Merge pull request #31 from kateusacova/display_comments
Nameo91 Nov 7, 2022
a5270b7
commiting end of day work
Nov 7, 2022
ddf2114
deleting likes model
Nov 7, 2022
5a9e9f4
adding upload image on sign up form
Nov 7, 2022
ba8d4bc
posting image in progress
Nameo91 Nov 7, 2022
29f4109
renaming as img
Nov 7, 2022
925bab9
Merge pull request #32 from kateusacova/signup-image
laurenbrabbin Nov 7, 2022
f7e5c57
Merge pull request #33 from kateusacova/post_image
Nameo91 Nov 7, 2022
f589d7a
Fixes done
kateusacova Nov 8, 2022
949d143
Merge pull request #34 from kateusacova/image-buttons-and-post-messag…
kateusacova Nov 8, 2022
315ff27
likes now adding to database
Nov 8, 2022
714f4e0
likes count increasing with every like without refreshing page
Nov 8, 2022
023b722
importing both shaded and regular heart
Nov 8, 2022
e1f06ab
shaded button implemented but not fully working
Nov 8, 2022
9324bd4
All working
kateusacova Nov 8, 2022
37a6f78
upload image
Nameo91 Nov 8, 2022
8f6c184
shaded heart working
Nov 9, 2022
f59c8e7
Merge pull request #35 from kateusacova/comments-and-session-info
kateusacova Nov 9, 2022
4e8f357
Merge branch 'main' into likes
kateusacova Nov 9, 2022
e66317f
Merge pull request #36 from kateusacova/likes
kateusacova Nov 9, 2022
10d390c
Merge branch 'main' into upload_image
kateusacova Nov 9, 2022
4b86b03
Merge pull request #37 from kateusacova/upload_image
kateusacova Nov 9, 2022
c70db97
Session info imported into Post
kateusacova Nov 9, 2022
8217923
Sign up error fixed and sessions added
kateusacova Nov 9, 2022
15eee0e
user can only like once
Nov 9, 2022
3af3bfc
unliking works
Nov 9, 2022
d92d32a
Merge pull request #38 from kateusacova/unliking
laurenbrabbin Nov 9, 2022
57c29a7
Error messages completed
tauqeer92 Nov 9, 2022
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
create post box
Nameo91 committed Nov 2, 2022
commit 6c356786f1746426a8cc1b455ae3a79bca22941c
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 31 additions & 3 deletions frontend/src/components/feed/Feed.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import './Feed.css';

const Feed = ({ navigate }) => {
const [posts, setPosts] = useState([]);
const [message, setMessage] = useState("");
const [token, setToken] = useState(window.localStorage.getItem("token"));

useEffect(() => {
@@ -21,18 +22,45 @@ const Feed = ({ navigate }) => {
})
}
}, [])


const handlePostSubmit = async (event) => {
event.preventDefault();

if(token) fetch('/posts', {
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ message: message, user: token})
})
.then(response => response.json())
.then(
data => {
window.localStorage.setItem("token", data.token)
setToken(window.localStorage.getItem("token"))
console.log(data)
})
}

const handleMessageChange = (event) => {
setMessage(event.target.value)
}

const logout = () => {
window.localStorage.removeItem("token")
navigate('/login')
}



if(token) {
return(
<>
<h2>Posts &#128075;</h2>
<form onSubmit={handlePostSubmit}>
<p>Make Post</p>
<textarea placeholder="Share what you think" type="text" value={ message } onChange={handleMessageChange}>
</textarea>
<input id='submitPost' type="submit" value="Post" />
</form>
<button onClick={logout}>
Logout
</button>
6 changes: 5 additions & 1 deletion frontend/src/components/post/Post.js
Original file line number Diff line number Diff line change
@@ -3,8 +3,12 @@ import './Post.css';

const Post = ({post}) => {
return(
<article id='singlePost' data-cy="post" key={ post._id }>{ post.message }</article>
<article id='singlePost' data-cy="post" key={ post._id }></article>
)
}

export default Post;