);
diff --git a/src/components/Compose/Compose.js b/src/components/Compose/Compose.js
index 57a3aed..73f8492 100644
--- a/src/components/Compose/Compose.js
+++ b/src/components/Compose/Compose.js
@@ -20,8 +20,13 @@ export default class Compose extends Component {
this.setState({ text });
}
- createPost() {}
-
+ createPost() {
+ const { text } = this.state;
+ const { createPostFn } = this.props;
+
+ createPostFn( text );
+ this.setState({ text: '' });
+ }
render() {
// Destructuring
const { text } = this.state;
diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js
index 8bd5f2d..4c552f4 100644
--- a/src/components/Header/Header.js
+++ b/src/components/Header/Header.js
@@ -20,7 +20,7 @@ export default class Header extends Component {
{/* Displays the search bar */}
-
+
{/* Displays the profile icon */}
diff --git a/src/components/Header/Search/Search.js b/src/components/Header/Search/Search.js
index 5778c53..12a22c8 100644
--- a/src/components/Header/Search/Search.js
+++ b/src/components/Header/Search/Search.js
@@ -1,8 +1,8 @@
-import React, { Component } from 'react';
+import React, { Component } from "react";
-import './Search.css';
+import "./Search.css";
-import { MdSearch } from 'react-icons/md';
+import { MdSearch } from "react-icons/md";
//////////////////////////////////////////////////////// THIS COMPONENT IS BEING RENDERED IN THE *HEADER* COMPONENT
@@ -11,7 +11,10 @@ export default class Search extends Component {
return (
-
+ this.props.searchPost(e.target.value)}
+ />
diff --git a/src/components/Post/Edit/Edit.js b/src/components/Post/Edit/Edit.js
index 29e4d05..6e9d321 100644
--- a/src/components/Post/Edit/Edit.js
+++ b/src/components/Post/Edit/Edit.js
@@ -19,7 +19,13 @@ export default class Edit extends Component {
this.setState({ text: value });
}
- updatePost() {}
+ updatePost() {
+ const { text } = this.state;
+ const { id, updatePostFn, hideEdit } = this.props;
+
+ updatePostFn( id, text );
+ hideEdit();
+ }
render() {
// More destructuring!
diff --git a/src/components/Post/Post.js b/src/components/Post/Post.js
index c7cb520..7d37e13 100644
--- a/src/components/Post/Post.js
+++ b/src/components/Post/Post.js
@@ -56,6 +56,7 @@ export default class Post extends Component {
// const editing = this.state.editing
// const showMasterMenu = this.state.showMasterMenu
const { editing, showMasterMenu } = this.state;
+ const { text, date, id, updatePostFn, deletePostFn } = this.props;
return (
// Main body of post
@@ -70,7 +71,7 @@ export default class Post extends Component {
style={{ display: showMasterMenu ? 'flex' : 'none' }}
>
Edit
- Delete
+ deletePostFn(id)}>Delete
@@ -80,10 +81,10 @@ export default class Post extends Component {
- DevMountain
- @DevMountain
+ Vince Ludovice
+ @vince.ludovice
- - POST DATE GOES HERE
+ - {date}
{/* This is where the text goes. Notice the turnary statement. The turnary statement decides to display either the text OR the editor view
@@ -97,9 +98,14 @@ export default class Post extends Component {
{// This has been pulled off of this.state via destructuring
editing ? (
-
+
) : (
- POST TEXT GOES HERE
+ {text}
)}