Browse Source

Add visible dates for notifications in Notification column (#9423)

* add RelativeTimestamp elements

* style the elements properly with CSS
pull/4/head
Paweł Ngei 6 years ago
committed by Eugen Rochko
parent
commit
9897cf0701
2 changed files with 16 additions and 2 deletions
  1. +10
    -1
      app/javascript/mastodon/features/notifications/components/notification.js
  2. +6
    -1
      app/javascript/styles/mastodon/components.scss

+ 10
- 1
app/javascript/mastodon/features/notifications/components/notification.js View File

@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import StatusContainer from '../../../containers/status_container';
import AccountContainer from '../../../containers/account_container';
import RelativeTimestamp from '../../../components/relative_timestamp';
import { injectIntl, FormattedMessage } from 'react-intl';
import Permalink from '../../../components/permalink';
import ImmutablePureComponent from 'react-immutable-pure-component';
@ -87,9 +88,11 @@ class Notification extends ImmutablePureComponent {
</div>
<span title={notification.get('created_at')}>
<FormattedMessage id='notification.follow' defaultMessage='{name} followed you' values={{ name: link }} />
<span className='notification__relative_time'>
<RelativeTimestamp timestamp={notification.get('created_at')} />
</span>
</span>
</div>
<AccountContainer id={account.get('id')} withNote={false} hidden={this.props.hidden} />
</div>
</HotKeys>
@ -120,6 +123,9 @@ class Notification extends ImmutablePureComponent {
<i className='fa fa-fw fa-star star-icon' />
</div>
<FormattedMessage id='notification.favourite' defaultMessage='{name} favourited your status' values={{ name: link }} />
<span className='notification__relative_time'>
<RelativeTimestamp className='notification__relative_time' timestamp={notification.get('created_at')} />
</span>
</div>
<StatusContainer id={notification.get('status')} account={notification.get('account')} muted withDismiss hidden={!!this.props.hidden} />
@ -139,6 +145,9 @@ class Notification extends ImmutablePureComponent {
<i className='fa fa-fw fa-retweet' />
</div>
<FormattedMessage id='notification.reblog' defaultMessage='{name} boosted your status' values={{ name: link }} />
<span className='notification__relative_time'>
<RelativeTimestamp className='notification__relative_time' timestamp={notification.get('created_at')} />
</span>
</div>
<StatusContainer id={notification.get('status')} account={notification.get('account')} muted withDismiss hidden={this.props.hidden} />

+ 6
- 1
app/javascript/styles/mastodon/components.scss View File

@ -1489,6 +1489,7 @@ a.account__display-name {
cursor: default;
color: $darker-text-color;
font-size: 15px;
line-height: 22px;
position: relative;
.fa {
@ -1496,7 +1497,7 @@ a.account__display-name {
}
> span {
display: block;
display: inline;
overflow: hidden;
text-overflow: ellipsis;
}
@ -1526,6 +1527,10 @@ a.account__display-name {
}
}
.notification__relative_time {
float: right;
}
.display-name {
display: block;
max-width: 100%;

Loading…
Cancel
Save