Changing writing microblogs to Material-UI

This commit is contained in:
2019-11-01 13:02:37 -04:00
parent ae89e3d63b
commit 3fa4cd7033
3 changed files with 173 additions and 58 deletions

View File

@@ -31,6 +31,11 @@ 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;
@@ -44,8 +49,8 @@ class Home extends Component {
(<img src={noImage} height="50" width="50"/>)
}
</Typography>
<Typography variant="h7"><b>{post.userHandle}</b></Typography>
<Typography variant="body2" color={"textSecondary"}>{post.createdAt}</Typography>
<Typography variant="h5"><b>{post.userHandle}</b></Typography>
<Typography variant="body2" color={"textSecondary"}>{this.formatDate(post.createdAt)}</Typography>
<br />
<Typography variant="body1"><b>{post.microBlogTitle}</b></Typography>
<Typography variant="body2">{post.body}</Typography>

View File

@@ -97,6 +97,11 @@ class user 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 classes = this.props;
@@ -132,7 +137,7 @@ class user extends Component {
}
</Typography>
<Typography variant="h7"><b>{post.userHandle}</b></Typography>
<Typography variant="body2" color={"textSecondary"}>{post.createdAt}</Typography>
<Typography variant="body2" color={"textSecondary"}>{this.formatDate(post.createdAt)}</Typography>
<br />
<Typography variant="body1"><b>{post.microBlogTitle}</b></Typography>
<Typography variant="body2">{post.body}</Typography>