Change in-app links to keep you in-app (#20540)
* Change in-app links to keep you in-app * refactor Permalink into Link * rewrite link hrefs in status content * please linter * please linter again
This commit is contained in:
parent
ad66bbed62
commit
07229089a6
21 changed files with 52 additions and 94 deletions
|
@ -98,12 +98,12 @@ class BoostModal extends ImmutablePureComponent {
|
|||
<div className='boost-modal__container'>
|
||||
<div className={classNames('status', `status-${status.get('visibility')}`, 'light')}>
|
||||
<div className='status__info'>
|
||||
<a href={status.get('url')} className='status__relative-time' target='_blank' rel='noopener noreferrer'>
|
||||
<a href={`/@${status.getIn(['account', 'acct'])}\/${status.get('id')}`} className='status__relative-time' target='_blank' rel='noopener noreferrer'>
|
||||
<span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span>
|
||||
<RelativeTimestamp timestamp={status.get('created_at')} />
|
||||
</a>
|
||||
|
||||
<a onClick={this.handleAccountClick} href={status.getIn(['account', 'url'])} className='status__display-name'>
|
||||
<a onClick={this.handleAccountClick} href={`/@${status.getIn(['account', 'acct'])}`} className='status__display-name'>
|
||||
<div className='status__avatar'>
|
||||
<Avatar account={status.get('account')} size={48} />
|
||||
</div>
|
||||
|
|
|
@ -4,16 +4,15 @@ import { Link, withRouter } from 'react-router-dom';
|
|||
import { FormattedMessage } from 'react-intl';
|
||||
import { registrationsOpen, me } from 'mastodon/initial_state';
|
||||
import Avatar from 'mastodon/components/avatar';
|
||||
import Permalink from 'mastodon/components/permalink';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
const Account = connect(state => ({
|
||||
account: state.getIn(['accounts', me]),
|
||||
}))(({ account }) => (
|
||||
<Permalink href={account.get('url')} to={`/@${account.get('acct')}`} title={account.get('acct')}>
|
||||
<Link to={`/@${account.get('acct')}`} title={account.get('acct')}>
|
||||
<Avatar account={account} size={35} />
|
||||
</Permalink>
|
||||
</Link>
|
||||
));
|
||||
|
||||
export default @withRouter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue