一発で引用の投稿者に飛ぶようにした

This commit is contained in:
YoheiZuho 2023-08-15 11:35:53 +00:00
parent 3860092d5d
commit f3c93cfb4f
2 changed files with 21 additions and 3 deletions

View File

@ -275,6 +275,15 @@ class Status extends ImmutablePureComponent {
this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'quote', 'id'], status.getIn(['quote', 'id']))}`);
}
handleQuoteUserClick = () =>{
if (!this.context.router) {
return;
}
const { status } = this.props;
this.location.href(`/@${status.getIn(['account', 'acct'])}`);
}
handleExpandedToggle = () => {
this.props.onToggleHidden(this._properStatus());
};
@ -644,8 +653,8 @@ class Status extends ImmutablePureComponent {
}
};
const identity = (status, account) => (
<a onClick={quote ? this.handleQuoteClick : this.handleAccountClick} href={`/@${status.getIn(['account', 'acct'])}`} title={status.getIn(['account', 'acct'])} className='status__display-name' target='_blank' rel='noopener noreferrer'>
const identity = (status, account, _0, quote = false) => (
<a onClick={quote ? this.handleQuoteUserClick : this.handleAccountClick} href={`/@${status.getIn(['account', 'acct'])}`} title={status.getIn(['account', 'acct'])} className='status__display-name' rel='noopener noreferrer'>
<div className='status__avatar'>
{statusAvatar(status, account)}
</div>

View File

@ -93,6 +93,15 @@ class DetailedStatus extends ImmutablePureComponent {
const { status } = this.props;
this.context.router.history.push(`/statuses/${status.getIn(['quote', 'id'])}`);
}
handleQuoteUserClick = () =>{
if (!this.context.router) {
return;
}
const { status } = this.props;
this.location.href(`/@${status.getIn(['account', 'acct'])}`);
}
_measureHeight (heightJustChanged) {
if (this.props.measureHeight && this.node) {
@ -176,7 +185,7 @@ class DetailedStatus extends ImmutablePureComponent {
const language = status.getIn(['translation', 'language']) || status.get('language');
const identity = (status, _0, _1, quote = false) => (
<a href={`/@${status.getIn(['account', 'acct'])}`} onClick={quote ? this.handleQuoteClick : this.handleAccountClick} data-acct={status.getIn(['account', 'acct'])} className='detailed-status__display-name'>
<a href={`/@${status.getIn(['account', 'acct'])}`} onClick={quote ? this.handleQuoteUserClick : this.handleAccountClick} data-acct={status.getIn(['account', 'acct'])} className='detailed-status__display-name'>
<div className='detailed-status__display-avatar'><Avatar account={status.get('account')} size={46} /></div>
<DisplayName account={status.get('account')} localDomain={this.props.domain} />
</a>