diff options
Diffstat (limited to 'app/javascript/mastodon/components/hashtag.jsx')
-rw-r--r-- | app/javascript/mastodon/components/hashtag.jsx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/javascript/mastodon/components/hashtag.jsx b/app/javascript/mastodon/components/hashtag.jsx index e516fc086..19d87508b 100644 --- a/app/javascript/mastodon/components/hashtag.jsx +++ b/app/javascript/mastodon/components/hashtag.jsx @@ -1,11 +1,14 @@ // @ts-check import React from 'react'; import { Sparklines, SparklinesCurve } from 'react-sparklines'; +// @ts-expect-error import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { Link } from 'react-router-dom'; +// @ts-expect-error import ShortNumber from 'mastodon/components/short_number'; +// @ts-expect-error import Skeleton from 'mastodon/components/skeleton'; import classNames from 'classnames'; @@ -19,11 +22,11 @@ class SilentErrorBoundary extends React.Component { error: false, }; - componentDidCatch () { + componentDidCatch() { this.setState({ error: true }); } - render () { + render() { if (this.state.error) { return null; } @@ -50,11 +53,13 @@ export const accountsCountRenderer = (displayNumber, pluralReady) => ( /> ); +// @ts-expect-error export const ImmutableHashtag = ({ hashtag }) => ( <Hashtag name={hashtag.get('name')} to={`/tags/${hashtag.get('name')}`} people={hashtag.getIn(['history', 0, 'accounts']) * 1 + hashtag.getIn(['history', 1, 'accounts']) * 1} + // @ts-expect-error history={hashtag.get('history').reverse().map((day) => day.get('uses')).toArray()} /> ); @@ -63,6 +68,7 @@ ImmutableHashtag.propTypes = { hashtag: ImmutablePropTypes.map.isRequired, }; +// @ts-expect-error const Hashtag = ({ name, to, people, uses, history, className, description, withGraph }) => ( <div className={classNames('trends__item', className)}> <div className='trends__item__name'> @@ -86,7 +92,9 @@ const Hashtag = ({ name, to, people, uses, history, className, description, with {withGraph && ( <div className='trends__item__sparkline'> <SilentErrorBoundary> + {/* @ts-expect-error */} <Sparklines width={50} height={28} data={history ? history : Array.from(Array(7)).map(() => 0)}> + {/* @ts-expect-error */} <SparklinesCurve style={{ fill: 'none' }} /> </Sparklines> </SilentErrorBoundary> |