Skip to content

fix small bugs #2

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 24 additions & 24 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
import './App.css';
import React from 'react';
import { useRoutes } from 'react-router-dom'
import ReadPosts from './pages/ReadPosts'
import CreatePost from './pages/CreatePost'
import EditPost from './pages/EditPost'
import { Link } from 'react-router-dom'
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 = [
// {'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
Expand Down
6 changes: 3 additions & 3 deletions client/src/pages/CreatePost.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import './CreatePost.css'
import React, { useState } from 'react';
import './CreatePost.css';

const CreatePost = () => {

Expand Down Expand Up @@ -27,7 +27,7 @@ const CreatePost = () => {
<br/>

<label for="description">Description</label><br />
<textarea rows="5" cols="50" id="description" onChange={handleChange}>
<textarea rows="5" cols="50" id="description" name="description" onChange={handleChange}>
</textarea>
<br/>
<input type="submit" value="Submit" />
Expand Down
6 changes: 3 additions & 3 deletions client/src/pages/EditPost.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import React, { useState } from 'react';
import { useParams } from 'react-router-dom';
import './EditPost.css'
import './EditPost.css';

const EditPost = ({data}) => {

Expand Down Expand Up @@ -29,7 +29,7 @@ const EditPost = ({data}) => {
<br/>

<label for="description">Description</label><br />
<textarea rows="5" cols="50" id="description" value={post.description} onChange={handleChange} >
<textarea rows="5" cols="50" id="description" name="description" value={post.description} onChange={handleChange} >
</textarea>
<br/>
<input type="submit" value="Submit" />
Expand Down