diff --git a/twistter-frontend/src/Writing_Microblogs.js b/twistter-frontend/src/Writing_Microblogs.js
index 4d7484d..2283e61 100644
--- a/twistter-frontend/src/Writing_Microblogs.js
+++ b/twistter-frontend/src/Writing_Microblogs.js
@@ -3,6 +3,27 @@ import { BrowserRouter as Router } from "react-router-dom";
import Route from "react-router-dom/Route";
import axios from "axios";
+// Material-UI
+import TextField from '@material-ui/core/TextField';
+import Typography from '@material-ui/core/Typography';
+import Button from '@material-ui/core/Button';
+import withStyles from "@material-ui/styles/withStyles";
+
+const styles = {
+ container: {
+ position: "fixed"
+ },
+ form: {
+ width: "300px",
+ height: "50px",
+ marginTop: "180px",
+ marginLeft: "50px"
+ },
+ textField: {
+ marginBottom: 15
+ }
+}
+
class Writing_Microblogs extends Component {
constructor(props) {
super(props);
@@ -27,7 +48,7 @@ class Writing_Microblogs extends Component {
this.setState({ topics: event.target.value });
}
- handleSubmit(event) {
+ handleSubmit = (event) => {
// alert('A title for the microblog was inputted: ' + this.state.title + '\nA microblog was posted: ' + this.state.value);
const postData = {
body: this.state.value,
@@ -67,6 +88,7 @@ class Writing_Microblogs extends Component {
}
handleChangeforPost(event) {
+
this.setState({ value: event.target.value });
}
@@ -77,65 +99,68 @@ class Writing_Microblogs extends Component {
}
render() {
+ const { classes } = this.props;
return (
-
-
-
-
-
-
-
+
+
);
}
}
-export default Writing_Microblogs;
+export default withStyles(styles)(Writing_Microblogs);
diff --git a/twistter-frontend/src/pages/Home.js b/twistter-frontend/src/pages/Home.js
index f08543e..74ecddc 100644
--- a/twistter-frontend/src/pages/Home.js
+++ b/twistter-frontend/src/pages/Home.js
@@ -9,6 +9,7 @@ import Grid from "@material-ui/core/Grid";
import Card from "@material-ui/core/Card";
import CardContent from "@material-ui/core/CardContent";
import Typography from "@material-ui/core/Typography";
+import withStyles from '@material-ui/styles/withStyles';
// component
import '../App.css';
@@ -18,6 +19,12 @@ import Writing_Microblogs from '../Writing_Microblogs';
import ReactModal from 'react-modal';
+const styles = {
+ card: {
+ marginBottom: 5
+ }
+}
+
class Home extends Component {
state = {
@@ -36,27 +43,28 @@ class Home extends Component {
.catch(err => console.log(err));
}
-
+ formatDate(dateString) {
+ let newDate = new Date(Date.parse(dateString));
+ return newDate.toDateString();
+ }
+
render() {
- let authenticated = this.props.user.authenticated;
- let username = this.props.user.credentials.handle;
+ let authenticated = this.props.user.authenticated;
+ let {classes} = this.props;
+ let username = this.props.user.credentials.handle;
+
let postMarkup = this.state.posts ? (
- this.state.posts.map(post => (
-
+ this.state.posts.map(post =>
+
- {this.state.imageUrl ? (
-
- ) : (
-
- )}
-
-
- {post.userHandle}
-
-
- {post.createdAt}
+ {
+ this.state.imageUrl ? (
) :
+ (
)
+ }
+ {post.userHandle}
+ {this.formatDate(post.createdAt)}
{post.microBlogTitle}
{post.quoteBody}
@@ -70,7 +78,7 @@ class Home extends Component {
- ))
+ )
) : (
Loading post...
);
@@ -333,8 +341,9 @@ const mapStateToProps = (state) => ({
});
Home.propTypes = {
- user: PropTypes.object.isRequired
-};
+ user: PropTypes.object.isRequired,
+ clases: PropTypes.object.isRequired
+}
Like.propTypes = {
user: PropTypes.object.isRequired
@@ -344,4 +353,4 @@ Quote.propTypes = {
user: PropTypes.object.isRequired
}
-export default connect(mapStateToProps)(Home, Like, Quote);
+export default connect(mapStateToProps)(withStyles(styles)(Home, Like, Quote));
diff --git a/twistter-frontend/src/pages/Login.js b/twistter-frontend/src/pages/Login.js
index 336255a..fbf2c68 100644
--- a/twistter-frontend/src/pages/Login.js
+++ b/twistter-frontend/src/pages/Login.js
@@ -119,7 +119,7 @@ export class Login extends Component {
diff --git a/twistter-frontend/src/pages/editProfile.js b/twistter-frontend/src/pages/editProfile.js
index 7272e76..d90b601 100644
--- a/twistter-frontend/src/pages/editProfile.js
+++ b/twistter-frontend/src/pages/editProfile.js
@@ -28,6 +28,14 @@ const styles = {
positon: "relative",
marginBottom: 30
},
+ back: {
+ float: "left",
+ marginLeft: 15
+ },
+ delete: {
+ float: "right",
+ marginRight: 15
+ },
progress: {
position: "absolute"
}
@@ -135,7 +143,17 @@ export class edit extends Component {
return (
-
+
+
+
Edit Profile
@@ -154,6 +172,7 @@ export class edit extends Component {
variant="outlined"
onChange={this.handleChange}
fullWidth
+ autoComplete='off'
/>
@@ -168,6 +187,7 @@ export class edit extends Component {
variant="outlined"
onChange={this.handleChange}
fullWidth
+ autoComplete='off'
/>
@@ -185,6 +205,7 @@ export class edit extends Component {
variant="outlined"
onChange={this.handleChange}
fullWidth
+ autoComplete='off'
/>
)}
-
-
-
-
+
-
+
+
+
);
}
diff --git a/twistter-frontend/src/pages/user.js b/twistter-frontend/src/pages/user.js
index bf5a51b..97258b0 100644
--- a/twistter-frontend/src/pages/user.js
+++ b/twistter-frontend/src/pages/user.js
@@ -47,7 +47,7 @@ const styles = {
// marginRight: "10%"
},
card: {
- marginBottom: 10
+ marginBottom: 5
},
profileImage: {
marginTop: 20
@@ -152,6 +152,11 @@ class user extends Component {
.catch(err => console.log(err));
}
+ formatDate(dateString) {
+ let newDate = new Date(Date.parse(dateString));
+ return newDate.toDateString();
+ }
+
render() {
const { classes } = this.props;
let authenticated = this.props.user.authenticated;
@@ -223,6 +228,7 @@ class user extends Component {
{post.microBlogTitle}
{post.quoteBody}
+
{post.body}
@@ -311,7 +317,8 @@ const mapStateToProps = state => ({
});
user.propTypes = {
- user: PropTypes.object.isRequired
+ user: PropTypes.object.isRequired,
+ clases: PropTypes.object.isRequired
};
export default connect(mapStateToProps)(withStyles(styles)(user));