]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Make hashtag search results link to the hashtag URL
authorThibaut Girka <thib@sitedethib.com>
Wed, 16 Jan 2019 13:25:58 +0000 (14:25 +0100)
committerThibaut Girka <thib@sitedethib.com>
Wed, 16 Jan 2019 13:25:58 +0000 (14:25 +0100)
Port 6cfb357940b3855ce53f6d1dfd87b1b32840a302 to glitch-soc

app/javascript/flavours/glitch/components/hashtag.js

index 88689cc6cb0aa9f8a5178a14d6c494ca834f5bec..d75edd9947d264cb2edef49b4a5168bb4d963fda 100644 (file)
@@ -1,16 +1,16 @@
 import React from 'react';
 import { Sparklines, SparklinesCurve } from 'react-sparklines';
-import { Link } from 'react-router-dom';
 import { FormattedMessage } from 'react-intl';
 import ImmutablePropTypes from 'react-immutable-proptypes';
+import Permalink from './permalink';
 import { shortNumberFormat } from 'flavours/glitch/util/numbers';
 
 const Hashtag = ({ hashtag }) => (
   <div className='trends__item'>
     <div className='trends__item__name'>
-      <Link to={`/timelines/tag/${hashtag.get('name')}`}>
+      <Permalink href={hashtag.get('url')} to={`/timelines/tag/${hashtag.get('name')}`}>
         #<span>{hashtag.get('name')}</span>
-      </Link>
+      </Permalink>
 
       <FormattedMessage id='trends.count_by_accounts' defaultMessage='{count} {rawCount, plural, one {person} other {people}} talking' values={{ rawCount: hashtag.getIn(['history', 0, 'accounts']), count: <strong>{shortNumberFormat(hashtag.getIn(['history', 0, 'accounts']))}</strong> }} />
     </div>