-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f73158f
commit 6d5db4b
Showing
3 changed files
with
65 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { useStat } from "react"; | ||
|
||
const AddPost = () => { | ||
const [title, setTitle] = useState(""); | ||
const [content, setContent] = useState(""); | ||
|
||
function onSubmit(e){ | ||
e.preventDefault(); | ||
console.log(title, content); | ||
} | ||
|
||
return ( | ||
<form onSubmit={onSubmit}> | ||
<div classname="row"> | ||
<div className="form-group"> | ||
<input | ||
type="text" | ||
className="mb-2 mt-2 form-control" | ||
placeholder="Title" | ||
value={title} | ||
onChange={(e) => setTitle(e.target.value)} | ||
/> | ||
<textarea | ||
type='text' | ||
className="mb-2 form-control" | ||
placeholder="Post away" | ||
rows="5" | ||
value={content} | ||
onChange={(e) => setContent(e.target.value)} | ||
/> | ||
</div> | ||
<button type="submit" className="btn btn-dark ">Submit</button> | ||
</div> | ||
</form> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
What is each file for? | ||
|
||
`gstyles.js` -> Highlighting which category you're on (used in `Categories.jsx`) | ||
`gstyles.js` -> Highlighting which category you're on (used in `Categories.jsx`) | ||
`Feed/components/AddPost.jsx` -> Creates a form for adding a post in any of the categories (used in `Feed.jsx`) |