Skip to content

Commit

Permalink
Use message timestamp, if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Juha Mustonen committed Jul 11, 2016
1 parent 1b5a477 commit e45b400
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,15 @@ key | required | description
## License

Distributed under the MIT license

## Changelog

# Release 0.2.0

- Added since time information
- Fixed issue when having multiple pulse widgets
- Improved style

# Release 0.1.0

- Initial somewhat working version
5 changes: 3 additions & 2 deletions src/components/Channel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import reactMixin from 'react-mixin';
import { ListenerMixin } from 'reflux';
import Mozaik from 'mozaik/browser';
import classNames from 'classnames';
import moment from 'moment';
import Since from './Since.jsx';

class Channel extends Component {
Expand Down Expand Up @@ -54,12 +55,12 @@ class Channel extends Component {

// Override actual content
if (message) {
const now = new Date();
const time = message.ts ? moment.unix(message.ts) : new Date();
content.empty = false;
content.text = message.text;
content.author = message.user.real_name;
content.avatar = message.user.profile.image_48;
content.date = (<Since time={now}></Since>);
content.date = (<Since time={time}></Since>);
}

// Construct classes
Expand Down
5 changes: 3 additions & 2 deletions styl/_slack.styl
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
.slack-channel__message
position: absolute
top: 45%
top: 20%
width: 100%
text-align: center
font-size 2rem
line-height 2.5rem

.slack-channel__message--value
color white
margin: 0 1.6vmin

.slack-channel__message--empty
color: lighten($widget-bg-color, 20);
text-shadow: 0 2px 0 $label-bg-color;
text-shadow: 0 -2px 0 $label-bg-color;

.slack-channel__footer
position absolute
Expand Down

0 comments on commit e45b400

Please sign in to comment.