Link move target account

This commit is contained in:
Thibaut Girka 2019-11-24 16:47:52 +01:00 committed by ThibG
parent b78c9e0980
commit 510f98c7c2

View file

@ -15,6 +15,7 @@ import { clearHeight } from 'flavours/glitch/actions/height_cache';
import { submitMarkers } from 'flavours/glitch/actions/markers'; import { submitMarkers } from 'flavours/glitch/actions/markers';
import { WrappedSwitch, WrappedRoute } from 'flavours/glitch/util/react_router_helpers'; import { WrappedSwitch, WrappedRoute } from 'flavours/glitch/util/react_router_helpers';
import UploadArea from './components/upload_area'; import UploadArea from './components/upload_area';
import PermaLink from 'flavours/glitch/components/permalink';
import ColumnsAreaContainer from './containers/columns_area_container'; import ColumnsAreaContainer from './containers/columns_area_container';
import classNames from 'classnames'; import classNames from 'classnames';
import Favico from 'favico.js'; import Favico from 'favico.js';
@ -72,7 +73,7 @@ const mapStateToProps = state => ({
unreadNotifications: state.getIn(['notifications', 'unread']), unreadNotifications: state.getIn(['notifications', 'unread']),
showFaviconBadge: state.getIn(['local_settings', 'notifications', 'favicon_badge']), showFaviconBadge: state.getIn(['local_settings', 'notifications', 'favicon_badge']),
hicolorPrivacyIcons: state.getIn(['local_settings', 'hicolor_privacy_icons']), hicolorPrivacyIcons: state.getIn(['local_settings', 'hicolor_privacy_icons']),
moved: state.getIn(['accounts', me, 'moved']) && state.getIn(['accounts', state.getIn(['accounts', me, 'moved']), 'acct']), moved: state.getIn(['accounts', me, 'moved']) && state.getIn(['accounts', state.getIn(['accounts', me, 'moved'])]),
}); });
const keyMap = { const keyMap = {
@ -255,7 +256,7 @@ class UI extends React.Component {
dropdownMenuIsOpen: PropTypes.bool, dropdownMenuIsOpen: PropTypes.bool,
unreadNotifications: PropTypes.number, unreadNotifications: PropTypes.number,
showFaviconBadge: PropTypes.bool, showFaviconBadge: PropTypes.bool,
moved: PropTypes.string, moved: PropTypes.map,
}; };
state = { state = {
@ -586,7 +587,15 @@ class UI extends React.Component {
<HotKeys keyMap={keyMap} handlers={handlers} ref={this.setHotkeysRef} attach={window} focused> <HotKeys keyMap={keyMap} handlers={handlers} ref={this.setHotkeysRef} attach={window} focused>
<div className={className} ref={this.setRef} style={{ pointerEvents: dropdownMenuIsOpen ? 'none' : null }}> <div className={className} ref={this.setRef} style={{ pointerEvents: dropdownMenuIsOpen ? 'none' : null }}>
{moved && (<div className='flash-message alert'> {moved && (<div className='flash-message alert'>
<FormattedMessage id='moved_to_warning' defaultMessage='This account is marked as moved to {moved_to}, and may thus not accept new follows.' values={{ moved_to: moved }} /> <FormattedMessage
id='moved_to_warning'
defaultMessage='This account is marked as moved to {moved_to_link}, and may thus not accept new follows.'
values={{ moved_to_link: (
<PermaLink href={moved.get('url')} to={`/accounts/${moved.get('id')}`}>
@{moved.get('acct')}
</PermaLink>
)}}
/>
</div>)} </div>)}
<SwitchingColumnsArea location={location} layout={layout} navbarUnder={navbarUnder} onLayoutChange={this.handleLayoutChange}> <SwitchingColumnsArea location={location} layout={layout} navbarUnder={navbarUnder} onLayoutChange={this.handleLayoutChange}>
{children} {children}