-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy pathApp.js
65 lines (54 loc) · 1.78 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import React from 'react';
import { Link, useRoutes } from 'react-router-dom';
import './App.css';
import CreatePost from './pages/CreatePost';
import EditPost from './pages/EditPost';
import ReadPosts from './pages/ReadPosts';
const App = () => {
const descr = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'
// const posts = [
// {'id':'1',
// 'title': 'Cartwheel in Chelsea 🤸🏽♀️',
// 'author':'Harvey Milian',
// 'description': descr},
// {'id':'2',
// 'title': 'Love Lock in Paris 🔒',
// 'author':'Beauford Delaney',
// 'description':descr},
// {'id':'3',
// 'title': 'Wear Pink on Fridays 🎀',
// 'author':'Onika Tonya',
// 'description':descr},
// {'id':'4',
// 'title': 'Adopt a Dog 🐶',
// 'author':'Denise Michelle',
// 'description':descr},
// ]
const posts = []
// Sets up routes
let element = useRoutes([
{
path: "/",
element:<ReadPosts data={posts}/>
},
{
path:"/edit/:id",
element: <EditPost data={posts} />
},
{
path:"/new",
element: <CreatePost />
}
]);
return (
<div className="App">
<div className="header">
<h1>👍 Bet 1.0</h1>
<Link to="/"><button className="headerBtn"> Explore Challenges 🔍 </button></Link>
<Link to="/new"><button className="headerBtn"> Submit Challenge 🏆 </button></Link>
</div>
{element}
</div>
);
}
export default App;