1
0
mirror of https://github.com/flarum/core.git synced 2025-07-12 04:16:24 +02:00

Use Link component for links instead of mithril route patch (#2315)

This new component now also supports external links.
This commit is contained in:
Alexander Skvortsov
2020-10-02 16:56:40 -04:00
committed by GitHub
parent b66d16e44b
commit 5ecb74fb59
16 changed files with 104 additions and 71 deletions

View File

@ -2,6 +2,7 @@ import Post from './Post';
import { ucfirst } from '../../common/utils/string';
import usernameHelper from '../../common/helpers/username';
import icon from '../../common/helpers/icon';
import Link from '../../common/components/Link';
/**
* The `EventPost` component displays a post which indicating a discussion
@ -29,9 +30,9 @@ export default class EventPost extends Post {
const data = Object.assign(this.descriptionData(), {
user,
username: user ? (
<a className="EventPost-user" route={app.route.user(user)}>
<Link className="EventPost-user" href={app.route.user(user)}>
{username}
</a>
</Link>
) : (
username
),