Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
added post date
Browse files Browse the repository at this point in the history
  • Loading branch information
snwolak committed Jun 13, 2018
1 parent f2e586b commit c091d75
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/Blog/BlogModal.js
Expand Up @@ -5,6 +5,7 @@ import store from "../store";
import FollowBtn from "../Components/Post/FollowBtn";
import { getAccounts } from "../actions/getAccounts";
import PostsLoader from "./PostsLoader";

const ModalStyle = {
overlay: {
backgroundColor: "rgba(80,80,80, 0.3)"
Expand Down
7 changes: 7 additions & 0 deletions src/Blog/Post.js
Expand Up @@ -19,6 +19,9 @@ import Icon from "react-icons-kit";
import { ic_message } from "react-icons-kit/md/ic_message";
import { ic_favorite } from "react-icons-kit/md/ic_favorite";
import store from "../store";
import {
FormattedRelative,
} from 'react-intl';
const md = new Remarkable({
html: true,
linkify: true
Expand Down Expand Up @@ -85,6 +88,7 @@ class Post extends Component {
).toFixed(2)}{" "}
</span>
<span>

{
<Icon
icon={ic_message}
Expand All @@ -103,8 +107,11 @@ class Post extends Component {
style={heartIconStyle}
onClick={this.handleVoteBtn}
/>

</span>
</FooterActions>

<FormattedRelative value={Date.parse(this.props.post.created)}/>
</CardFooter>
{this.state.shouldOpenComments ? (
<Comments
Expand Down
6 changes: 5 additions & 1 deletion src/Components/Post/Post.styles.js
Expand Up @@ -60,7 +60,11 @@ export const CardTitle = styled.div`
font-weight: 500;
}
`;

export const UsernameContainer = styled.span`
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
`;
export const CardAvatar = styled.div`
background: url(${props => props.url});
width: 40px;
Expand Down
28 changes: 19 additions & 9 deletions src/Components/Post/index.js
Expand Up @@ -9,6 +9,7 @@ import {
CardHeader,
CardAvatar,
CardTitle,
UsernameContainer,
BtnContainer,
CardFooter,
TagContainer,
Expand All @@ -19,6 +20,7 @@ import FollowBtn from "./FollowBtn";
import Lightbox from "react-image-lightbox";
import HoverIntet from "react-hoverintent";
import LazyLoad from "react-lazyload";
import { FormattedRelative } from "react-intl";
import followSteem from "../.././Functions/followSteem";
import Comments from "./Comments";
import PostCardText from "./PostCardText";
Expand Down Expand Up @@ -150,15 +152,23 @@ class Post extends Component {
}/avatar`}
/>
<CardTitle>
<HoverIntet
onMouseOver={this.handleProfileHover}
onMouseOut={this.handleProfileUsernameHover}
sensitivity={10}
interval={600}
timeout={250}
>
<b onClick={this.handleBlogModal}>{this.props.post.author}</b>
</HoverIntet>
<UsernameContainer>
<HoverIntet
onMouseOver={this.handleProfileHover}
onMouseOut={this.handleProfileUsernameHover}
sensitivity={10}
interval={600}
timeout={250}
>
<b onClick={this.handleBlogModal}>
{this.props.post.author}{" "}
</b>
</HoverIntet>
<FormattedRelative
value={Date.parse(this.props.post.created)}
/>
</UsernameContainer>

<p>{this.props.post.title}</p>
{this.state.isHover ? (
<ProfileHover
Expand Down

0 comments on commit c091d75

Please sign in to comment.