Skip to content

Commit 3dff671

Browse files
Gargronhiyuki2578
authored andcommitted
Add header to trends section and change refresh rate to 15 minutes (mastodon#11641)
1 parent 5f70831 commit 3dff671

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

app/javascript/mastodon/features/getting_started/components/trends.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
33
import PropTypes from 'prop-types';
44
import ImmutablePropTypes from 'react-immutable-proptypes';
55
import Hashtag from 'mastodon/components/hashtag';
6+
import { FormattedMessage } from 'react-intl';
67

78
export default class Trends extends ImmutablePureComponent {
89

@@ -17,7 +18,7 @@ export default class Trends extends ImmutablePureComponent {
1718

1819
componentDidMount () {
1920
this.props.fetchTrends();
20-
this.refreshInterval = setInterval(() => this.props.fetchTrends(), 3600000);
21+
this.refreshInterval = setInterval(() => this.props.fetchTrends(), 900 * 1000);
2122
}
2223

2324
componentWillUnmount () {
@@ -35,6 +36,8 @@ export default class Trends extends ImmutablePureComponent {
3536

3637
return (
3738
<div className='getting-started__trends'>
39+
<h4><FormattedMessage id='trends.trending_now' defaultMessage='Trending now' /></h4>
40+
3841
{trends.take(3).map(hashtag => <Hashtag key={hashtag.get('name')} hashtag={hashtag} />)}
3942
</div>
4043
);

app/javascript/styles/mastodon/components.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,6 +2765,15 @@ a.account__display-name {
27652765
animation: fade 150ms linear;
27662766
margin-top: 10px;
27672767

2768+
h4 {
2769+
font-size: 12px;
2770+
text-transform: uppercase;
2771+
color: $darker-text-color;
2772+
padding: 10px;
2773+
font-weight: 500;
2774+
border-bottom: 1px solid lighten($ui-base-color, 8%);
2775+
}
2776+
27682777
@media screen and (max-height: 810px) {
27692778
.trends__item:nth-child(3) {
27702779
display: none;

0 commit comments

Comments
 (0)