summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2016-02-01 14:30:16 -0800
committerReed Garmsen <rgarmsen2295@gmail.com>2016-02-02 11:54:01 -0800
commit92816619cc584c7c172c4e4fdde17624cf7f913f (patch)
treea28fed455824c0011b4a6303598bb242e75035c2 /web
parentfe39f2400f616e14fbaec67b1d22e80d1583e1f1 (diff)
downloadchat-92816619cc584c7c172c4e4fdde17624cf7f913f.tar.gz
chat-92816619cc584c7c172c4e4fdde17624cf7f913f.tar.bz2
chat-92816619cc584c7c172c4e4fdde17624cf7f913f.zip
Changed clock icon in repeat posts to simple timestamp
Diffstat (limited to 'web')
-rw-r--r--web/react/components/post.jsx1
-rw-r--r--web/react/components/post_header.jsx7
-rw-r--r--web/react/components/post_info.jsx7
-rw-r--r--web/react/components/time_since.jsx17
-rw-r--r--web/react/utils/constants.jsx3
-rw-r--r--web/sass-files/sass/partials/_post.scss20
6 files changed, 31 insertions, 24 deletions
diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx
index 695d7daef..53fe7fb5d 100644
--- a/web/react/components/post.jsx
+++ b/web/react/components/post.jsx
@@ -214,6 +214,7 @@ export default class Post extends React.Component {
commentCount={commentCount}
handleCommentClick={this.handleCommentClick}
isLastComment={this.props.isLastComment}
+ sameUser={this.props.sameUser}
/>
<PostBody
post={post}
diff --git a/web/react/components/post_header.jsx b/web/react/components/post_header.jsx
index f18024343..037b48096 100644
--- a/web/react/components/post_header.jsx
+++ b/web/react/components/post_header.jsx
@@ -52,6 +52,7 @@ export default class PostHeader extends React.Component {
handleCommentClick={this.props.handleCommentClick}
allowReply='true'
isLastComment={this.props.isLastComment}
+ sameUser={this.props.sameUser}
/>
</li>
</ul>
@@ -62,11 +63,13 @@ export default class PostHeader extends React.Component {
PostHeader.defaultProps = {
post: null,
commentCount: 0,
- isLastComment: false
+ isLastComment: false,
+ sameUser: false
};
PostHeader.propTypes = {
post: React.PropTypes.object,
commentCount: React.PropTypes.number,
isLastComment: React.PropTypes.bool,
- handleCommentClick: React.PropTypes.func
+ handleCommentClick: React.PropTypes.func,
+ sameUser: React.PropTypes.bool
};
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index 2bff675a9..0fb9d7f4a 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -220,6 +220,7 @@ export default class PostInfo extends React.Component {
<li className='col'>
<TimeSince
eventTime={post.create_at}
+ sameUser={this.props.sameUser}
/>
</li>
<li className='col col__reply'>
@@ -251,12 +252,14 @@ PostInfo.defaultProps = {
post: null,
commentCount: 0,
isLastComment: false,
- allowReply: false
+ allowReply: false,
+ sameUser: false
};
PostInfo.propTypes = {
post: React.PropTypes.object,
commentCount: React.PropTypes.number,
isLastComment: React.PropTypes.bool,
allowReply: React.PropTypes.string,
- handleCommentClick: React.PropTypes.func
+ handleCommentClick: React.PropTypes.func,
+ sameUser: React.PropTypes.bool
};
diff --git a/web/react/components/time_since.jsx b/web/react/components/time_since.jsx
index 32947bd60..0b549b1e6 100644
--- a/web/react/components/time_since.jsx
+++ b/web/react/components/time_since.jsx
@@ -14,7 +14,7 @@ export default class TimeSince extends React.Component {
componentDidMount() {
this.intervalId = setInterval(() => {
this.forceUpdate();
- }, 30000);
+ }, Constants.TIME_SINCE_UPDATE_INTERVAL);
}
componentWillUnmount() {
clearInterval(this.intervalId);
@@ -23,6 +23,14 @@ export default class TimeSince extends React.Component {
const displayDate = Utils.displayDate(this.props.eventTime);
const displayTime = Utils.displayTime(this.props.eventTime);
+ if (this.props.sameUser) {
+ return (
+ <time className='post__time'>
+ {Utils.displayTime(this.props.eventTime)}
+ </time>
+ );
+ }
+
const tooltip = (
<Tooltip id={'time-since-tooltip-' + this.props.eventTime}>
{displayDate + ' at ' + displayTime}
@@ -42,10 +50,13 @@ export default class TimeSince extends React.Component {
);
}
}
+
TimeSince.defaultProps = {
- eventTime: 0
+ eventTime: 0,
+ sameUser: false
};
TimeSince.propTypes = {
- eventTime: React.PropTypes.number.isRequired
+ eventTime: React.PropTypes.number.isRequired,
+ sameUser: React.PropTypes.bool
};
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx
index e1a4b8a8a..ad0e4b2fe 100644
--- a/web/react/utils/constants.jsx
+++ b/web/react/utils/constants.jsx
@@ -462,5 +462,6 @@ export default {
MIN_USERNAME_LENGTH: 3,
MAX_USERNAME_LENGTH: 15,
MIN_PASSWORD_LENGTH: 5,
- MAX_PASSWORD_LENGTH: 50
+ MAX_PASSWORD_LENGTH: 50,
+ TIME_SINCE_UPDATE_INTERVAL: 30000
};
diff --git a/web/sass-files/sass/partials/_post.scss b/web/sass-files/sass/partials/_post.scss
index e62d37f38..73c7bd9cb 100644
--- a/web/sass-files/sass/partials/_post.scss
+++ b/web/sass-files/sass/partials/_post.scss
@@ -456,7 +456,7 @@ body.ios {
&:hover {
.post__time {
-
+ @include opacity(0.5);
}
}
@@ -480,27 +480,15 @@ body.ios {
}
.post__time {
- display: inline-block;
- font: normal normal normal 14px/1 FontAwesome;
- font-size: inherit;
+ font: normal normal normal FontAwesome;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
- font-size: 0;
position: absolute;
top: -3px;
- left: 17px;
- width: 30px;
- height: 30px;
+ left: -1.0em;
line-height: 37px;
-
- &:before {
- @include opacity(0);
- content: "\f017";
- content: "\f017";
- font-size: 19px;
- }
-
+ @include opacity(0);
}
}