about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/admin/Trends.js
diff options
context:
space:
mode:
authorRenaud Chaput <renchap@gmail.com>2023-02-20 03:20:59 +0100
committerGitHub <noreply@github.com>2023-02-20 03:20:59 +0100
commit44a7d87cb1f5df953b6c14c16c59e2e4ead1bcb9 (patch)
tree71b60ccd9b23ec8f8d72fa3562f0bc343c6e456e /app/javascript/mastodon/components/admin/Trends.js
parentf0e1b12c101e0dd0ddaaef8bdcc166624dba62d5 (diff)
Rename JSX files with proper `.jsx` extension (#23733)
Diffstat (limited to 'app/javascript/mastodon/components/admin/Trends.js')
-rw-r--r--app/javascript/mastodon/components/admin/Trends.js73
1 files changed, 0 insertions, 73 deletions
diff --git a/app/javascript/mastodon/components/admin/Trends.js b/app/javascript/mastodon/components/admin/Trends.js
deleted file mode 100644
index d01b8437e..000000000
--- a/app/javascript/mastodon/components/admin/Trends.js
+++ /dev/null
@@ -1,73 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import api from 'mastodon/api';
-import { FormattedMessage } from 'react-intl';
-import classNames from 'classnames';
-import Hashtag from 'mastodon/components/hashtag';
-
-export default class Trends extends React.PureComponent {
-
-  static propTypes = {
-    limit: PropTypes.number.isRequired,
-  };
-
-  state = {
-    loading: true,
-    data: null,
-  };
-
-  componentDidMount () {
-    const { limit } = this.props;
-
-    api().get('/api/v1/admin/trends/tags', { params: { limit } }).then(res => {
-      this.setState({
-        loading: false,
-        data: res.data,
-      });
-    }).catch(err => {
-      console.error(err);
-    });
-  }
-
-  render () {
-    const { limit } = this.props;
-    const { loading, data } = this.state;
-
-    let content;
-
-    if (loading) {
-      content = (
-        <div>
-          {Array.from(Array(limit)).map((_, i) => (
-            <Hashtag key={i} />
-          ))}
-        </div>
-      );
-    } else {
-      content = (
-        <div>
-          {data.map(hashtag => (
-            <Hashtag
-              key={hashtag.name}
-              name={hashtag.name}
-              to={hashtag.id === undefined ? undefined : `/admin/tags/${hashtag.id}`}
-              people={hashtag.history[0].accounts * 1 + hashtag.history[1].accounts * 1}
-              uses={hashtag.history[0].uses * 1 + hashtag.history[1].uses * 1}
-              history={hashtag.history.reverse().map(day => day.uses)}
-              className={classNames(hashtag.requires_review && 'trends__item--requires-review', !hashtag.trendable && !hashtag.requires_review && 'trends__item--disabled')}
-            />
-          ))}
-        </div>
-      );
-    }
-
-    return (
-      <div className='trends trends--compact'>
-        <h4><FormattedMessage id='trends.trending_now' defaultMessage='Trending now' /></h4>
-
-        {content}
-      </div>
-    );
-  }
-
-}