-
+
{name ? <>#{name}> : }
-
+
{description ? (
{description}
diff --git a/app/javascript/mastodon/components/permalink.jsx b/app/javascript/mastodon/components/permalink.jsx
new file mode 100644
index 000000000..4279efba8
--- /dev/null
+++ b/app/javascript/mastodon/components/permalink.jsx
@@ -0,0 +1,40 @@
+import PropTypes from 'prop-types';
+import { PureComponent } from 'react';
+
+export class Permalink extends PureComponent {
+
+ static contextTypes = {
+ router: PropTypes.object,
+ };
+
+ static propTypes = {
+ className: PropTypes.string,
+ href: PropTypes.string.isRequired,
+ to: PropTypes.string.isRequired,
+ children: PropTypes.node,
+ onInterceptClick: PropTypes.func,
+ };
+
+ handleClick = e => {
+ if (this.props.onInterceptClick && this.props.onInterceptClick()) {
+ e.preventDefault();
+ return;
+ }
+
+ if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
+ e.preventDefault();
+ this.context.router.history.push(this.props.to);
+ }
+ }
+
+ render () {
+ const { href, children, className, onInterceptClick, ...other } = this.props;
+
+ return (
+
+ {children}
+
+ );
+ }
+
+}
diff --git a/app/javascript/mastodon/components/status_content.jsx b/app/javascript/mastodon/components/status_content.jsx
index 02ef29f11..d8735b0a5 100644
--- a/app/javascript/mastodon/components/status_content.jsx
+++ b/app/javascript/mastodon/components/status_content.jsx
@@ -4,12 +4,12 @@ import { PureComponent } from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import classnames from 'classnames';
-import { Link } from 'react-router-dom';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
import { Icon } from 'mastodon/components/icon';
+import { Permalink } from 'mastodon/components/permalink';
import PollContainer from 'mastodon/containers/poll_container';
import { autoPlayGif, languages as preloadedLanguages, expandUsernames } from 'mastodon/initial_state';
@@ -284,9 +284,9 @@ class StatusContent extends PureComponent {
let mentionsPlaceholder = '';
const mentionLinks = status.get('mentions').map(item => (
-
+
@{expandUsernames ? item.get('acct') : item.get('username')}
-
+
)).reduce((aggregate, item) => [...aggregate, item, ' '], []);
const toggleText = hidden ?
:
;
diff --git a/app/javascript/mastodon/features/account_timeline/components/moved_note.jsx b/app/javascript/mastodon/features/account_timeline/components/moved_note.jsx
index b5fda1c8e..8094b26c3 100644
--- a/app/javascript/mastodon/features/account_timeline/components/moved_note.jsx
+++ b/app/javascript/mastodon/features/account_timeline/components/moved_note.jsx
@@ -1,10 +1,10 @@
import { FormattedMessage } from 'react-intl';
-import { Link } from 'react-router-dom';
-
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
+import { Permalink } from 'mastodon/components/permalink';
+
import { AvatarOverlay } from '../../../components/avatar_overlay';
import { DisplayName } from '../../../components/display_name';
@@ -25,12 +25,12 @@ export default class MovedNote extends ImmutablePureComponent {