Skip to content

Commit

Permalink
Merge pull request #1 from kateusacova/css-feed-and-post
Browse files Browse the repository at this point in the history
Basic CSS for post, feed and app
  • Loading branch information
kateusacova authored Oct 31, 2022
2 parents 38a4c22 + 59ff09b commit 3681ed6
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 35 deletions.
Binary file removed frontend/cypress/videos/making_a_post.cy.js.mp4
Binary file not shown.
Binary file removed frontend/cypress/videos/signing_in.cy.js.mp4
Binary file not shown.
Binary file removed frontend/cypress/videos/signing_up.cy.js.mp4
Binary file not shown.
39 changes: 9 additions & 30 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions frontend/src/components/app/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
html {
background-color: #Bde0fe;
}
18 changes: 18 additions & 0 deletions frontend/src/components/feed/Feed.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

h2 {
text-align: center;
}
11 changes: 7 additions & 4 deletions frontend/src/components/feed/Feed.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
import Post from '../post/Post'
import Post from '../post/Post';
import './Feed.css';

const Feed = ({ navigate }) => {
const [posts, setPosts] = useState([]);
Expand All @@ -26,17 +27,19 @@ const Feed = ({ navigate }) => {
window.localStorage.removeItem("token")
navigate('/login')
}



if(token) {
return(
<>
<h2>Posts</h2>
<h2>Posts &#128075;</h2>
<button onClick={logout}>
Logout
</button>
<div id='feed' role="feed">
{posts.map(
(post) => ( <Post post={ post } key={ post._id } /> )
(post) => (
<Post post={ post } key={ post._id } /> )
)}
</div>
</>
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/components/post/Post.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#singlePost {
background: #ffffff;
width: 700px;
margin: auto;
margin-top: 10px;
padding: 10px;
border-radius: 10px;
box-shadow: 1px 1px 3px 3px rgba(0,0,0,0.15);
}
3 changes: 2 additions & 1 deletion frontend/src/components/post/Post.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import './Post.css';

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

Expand Down
1 change: 1 addition & 0 deletions frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ root.render(
</BrowserRouter>
);


// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
Expand Down

0 comments on commit 3681ed6

Please sign in to comment.