Skip to content

Commit 5e890ac

Browse files
JamesJames
authored andcommitted
Remove App.css
1 parent 372c9e2 commit 5e890ac

File tree

2 files changed

+28
-34
lines changed

2 files changed

+28
-34
lines changed

src/App.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/App.js

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,40 @@
11
import React from 'react';
2-
import './App.css';
32
import reactLogo from './Assets/react-logo.png';
43
import PostList from './Components/PostList';
54
import PostProvider, {PostContext} from './Contexts/PostProvider';
65
import UserSelectDropdown from './Components/UserSelectDropdown';
76
import PostListItem from './Components/PostListItem';
87
import Spinner from './Components/Spinner';
98

10-
function App() {
11-
return (
12-
<div className="container">
13-
<div className="row mt-5">
14-
<div className="col-12 d-flex justify-content-center">
15-
<img src={reactLogo} alt="React Logo" style={{ width: '200px' }} />
16-
</div>
17-
<div className="col-12">
18-
<PostProvider>
19-
<PostContext.Consumer>
20-
{({ isLoading, posts, getPostsForUserWithId, deletePostWithId }) => (
21-
<>
22-
<UserSelectDropdown handleChange={userId => getPostsForUserWithId(userId)} />
23-
{isLoading ? <Spinner /> : (
24-
<PostList>
25-
{posts.map(post => (
26-
<PostListItem
27-
{...post}
28-
handleDeleteClicked={deletePostWithId}
29-
/>
30-
))}
31-
</PostList>
32-
)}
33-
</>
34-
)}
35-
</PostContext.Consumer>
36-
</PostProvider>
37-
</div>
9+
const App = () => (
10+
<div className="container">
11+
<div className="row mt-5">
12+
<div className="col-12 d-flex justify-content-center">
13+
<img src={reactLogo} alt="React Logo" style={{ width: '200px' }} />
14+
</div>
15+
<div className="col-12">
16+
<PostProvider>
17+
<PostContext.Consumer>
18+
{({ isLoading, posts, getPostsForUserWithId, deletePostWithId }) => (
19+
<>
20+
<UserSelectDropdown handleChange={userId => getPostsForUserWithId(userId)} />
21+
{isLoading ? <Spinner /> : (
22+
<PostList>
23+
{posts.map(post => (
24+
<PostListItem
25+
{...post}
26+
handleDeleteClicked={deletePostWithId}
27+
/>
28+
))}
29+
</PostList>
30+
)}
31+
</>
32+
)}
33+
</PostContext.Consumer>
34+
</PostProvider>
3835
</div>
3936
</div>
40-
);
41-
}
37+
</div>
38+
);
4239

4340
export default App;

0 commit comments

Comments
 (0)