diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-11-05 21:11:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-05 21:11:24 +0100 |
commit | 7c65f5269277cd8e953efb25fa77dc28441904e7 (patch) | |
tree | af4f71c35a4a55688246252e5f98d68b65234b4a /app/javascript/mastodon/features/account_timeline/components/moved_note.js | |
parent | 30e786225e665f44676ed6f1c6d5200e68b3a378 (diff) |
Change design of moved account banner in web UI (#19790)
Diffstat (limited to 'app/javascript/mastodon/features/account_timeline/components/moved_note.js')
-rw-r--r-- | app/javascript/mastodon/features/account_timeline/components/moved_note.js | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/app/javascript/mastodon/features/account_timeline/components/moved_note.js b/app/javascript/mastodon/features/account_timeline/components/moved_note.js index 2e32d660f..a548160a5 100644 --- a/app/javascript/mastodon/features/account_timeline/components/moved_note.js +++ b/app/javascript/mastodon/features/account_timeline/components/moved_note.js @@ -1,47 +1,35 @@ import React from 'react'; -import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import AvatarOverlay from '../../../components/avatar_overlay'; import DisplayName from '../../../components/display_name'; -import Icon from 'mastodon/components/icon'; +import Permalink from 'mastodon/components/permalink'; export default class MovedNote extends ImmutablePureComponent { - static contextTypes = { - router: PropTypes.object, - }; - static propTypes = { from: ImmutablePropTypes.map.isRequired, to: ImmutablePropTypes.map.isRequired, }; - handleAccountClick = e => { - if (e.button === 0) { - e.preventDefault(); - this.context.router.history.push(`/@${this.props.to.get('acct')}`); - } - - e.stopPropagation(); - } - render () { const { from, to } = this.props; - const displayNameHtml = { __html: from.get('display_name_html') }; return ( - <div className='account__moved-note'> - <div className='account__moved-note__message'> - <div className='account__moved-note__icon-wrapper'><Icon id='suitcase' className='account__moved-note__icon' fixedWidth /></div> - <FormattedMessage id='account.moved_to' defaultMessage='{name} has moved to:' values={{ name: <bdi><strong dangerouslySetInnerHTML={displayNameHtml} /></bdi> }} /> + <div className='moved-account-banner'> + <div className='moved-account-banner__message'> + <FormattedMessage id='account.moved_to' defaultMessage='{name} has indicated that their new account is now:' values={{ name: <bdi><strong dangerouslySetInnerHTML={{ __html: from.get('display_name_html') }} /></bdi> }} /> </div> - <a href={to.get('url')} onClick={this.handleAccountClick} className='detailed-status__display-name'> - <div className='detailed-status__display-avatar'><AvatarOverlay account={to} friend={from} /></div> - <DisplayName account={to} /> - </a> + <div className='moved-account-banner__action'> + <Permalink href={to.get('url')} to={`/@${to.get('acct')}`} className='detailed-status__display-name'> + <div className='detailed-status__display-avatar'><AvatarOverlay account={to} friend={from} /></div> + <DisplayName account={to} /> + </Permalink> + + <Permalink href={to.get('url')} to={`/@${to.get('acct')}`} className='button'><FormattedMessage id='account.go_to_profile' defaultMessage='Go to profile' /></Permalink> + </div> </div> ); } |