-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
46 lines (41 loc) · 1002 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { useState } from 'react'
import './App.css';
import Input from './components/Input'
import Post from './components/Post'
const DEFAULT_POSTS = [
{
id: 0,
username: 'brian',
text: 'Weather is so good rn'
},
{
id: 0,
username: 'brian',
text: 'Weather is bad'
},
{
id: 0,
username: 'brian',
text: 'asdklfkjasldkfjalksdjf'
},
{
id: 0,
username: 'brian',
text: '2o35462098345709283457'
},
]
function App() {
const [posts, setPosts] = useState(DEFAULT_POSTS)
return (
<div className="appContainer">
<div className="nav">
<img className="logo" alt="logo" src="https://img.freepik.com/free-vector/twitter-new-2023-x-logo-white-background-vector_1017-45422.jpg?size=338&ext=jpg&ga=GA1.1.1700460183.1712016000&semt=ais" />
</div>
<Input setPosts={setPosts} />
<div className="postContainer">
{posts.map((post) => <Post post={post} />)}
</div>
</div>
);
}
export default App;