diff --git a/functions/handlers/post.js b/functions/handlers/post.js index 583a2ae..063f634 100644 --- a/functions/handlers/post.js +++ b/functions/handlers/post.js @@ -10,6 +10,7 @@ exports.putPost = (req, res) => { createdAt: new Date().toISOString(), likeCount: 0, commentCount: 0, + microBlogTopics: req.body.microBlogTopics }; diff --git a/twistter-frontend/src/App.css b/twistter-frontend/src/App.css index d828517..0312f35 100644 --- a/twistter-frontend/src/App.css +++ b/twistter-frontend/src/App.css @@ -45,4 +45,5 @@ .container { margin: 80px auto 0 auto; max-width: 1200px; + color: #1da1f2; } diff --git a/twistter-frontend/src/App.js b/twistter-frontend/src/App.js index afd3646..a0a4720 100644 --- a/twistter-frontend/src/App.js +++ b/twistter-frontend/src/App.js @@ -5,13 +5,13 @@ import './App.css'; import { BrowserRouter as Router } from 'react-router-dom'; import Route from 'react-router-dom/Route'; -import NavBar, { Navbar } from './components/layout/NavBar'; +import Navbar from './components/layout/NavBar'; + +import home from './pages/Home'; +import register from './pages/Register'; +import login from './pages/Login'; +import user from './pages/User'; -// Pages -import home from './Home.js'; -import register from './Register.js'; -import login from './Login.js'; -import user from './pages/user'; import writeMicroblog from './Writing_Microblogs.js'; import edit from './pages/edit.js'; import userLine from './Userline.js'; @@ -20,10 +20,9 @@ class App extends Component { render() { return ( -
+
-
diff --git a/twistter-frontend/src/Logout.js b/twistter-frontend/src/Logout.js new file mode 100644 index 0000000..df36575 --- /dev/null +++ b/twistter-frontend/src/Logout.js @@ -0,0 +1,22 @@ +/* eslint-disable */ +import React, { Component} from 'react'; +import './App.css'; +import logo from './images/twistter-logo.png'; +import TextField from '@material-ui/core/TextField'; + +class Logout extends Component { + render() { + return( +
+ logo +

+ Logout of your Twistter Account +

+

+ +
+ ); + }; +} + +export default Logout; diff --git a/twistter-frontend/src/Userline.js b/twistter-frontend/src/Userline.js index 51d74f4..e8168ce 100644 --- a/twistter-frontend/src/Userline.js +++ b/twistter-frontend/src/Userline.js @@ -9,7 +9,8 @@ class Userline extends Component { { super(props); this.state = { - microBlogs : [] + microBlogs : [], + } } @@ -21,12 +22,16 @@ class Userline extends Component { const post = res.data; this.setState({microBlogs : post}) - }) + }) + + } render() { + let sortedPosts = []; + return (
    { this.state.microBlogs.map(microBlog =>

    {microBlog.body}

    )} diff --git a/twistter-frontend/src/Writing_Microblogs.js b/twistter-frontend/src/Writing_Microblogs.js index 1858193..0c3ddcc 100644 --- a/twistter-frontend/src/Writing_Microblogs.js +++ b/twistter-frontend/src/Writing_Microblogs.js @@ -11,6 +11,7 @@ class Writing_Microblogs extends Component { this.state = { value: '', title: '', + topics: '', characterCount: 10 }; @@ -19,12 +20,18 @@ class Writing_Microblogs extends Component { this.handleChange = this.handleChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); this.handleChangeforPost = this.handleChangeforPost.bind(this); + this.handleChangeforTopics = this.handleChangeforTopics.bind(this); + } handleChange(event) { this.setState( {title: event.target.value }); } + handleChangeforTopics(event) { + this.setState( {topics: event.target.value}); + } + handleSubmit(event) { // alert('A title for the microblog was inputted: ' + this.state.title + '\nA microblog was posted: ' + this.state.value); @@ -33,15 +40,16 @@ class Writing_Microblogs extends Component { { body: this.state.value, userHandle: "new user", userImage: "bing-url", - microBlogTitle: this.state.title - + microBlogTitle: this.state.title, + microBlogTopics: this.state.topics.split(', ') + }, { headers: { 'Content-Type': 'application/json'} } ) console.log(response.data); event.preventDefault(); - this.setState({value: '', title: '',characterCount: 10}) + this.setState({value: '', title: '',characterCount: 10, topics: ''}) } handleChangeforPost(event) { @@ -55,13 +63,18 @@ class Writing_Microblogs extends Component { } - render() { return (
    -
    +
    - +