[Glitch] Run eslint --fix
I don't like it changing files this way, but it's basically what
c49213f0ea
and a few others did.
This commit is contained in:
@ -52,7 +52,7 @@ export default class ActionsModal extends ImmutablePureComponent {
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const status = this.props.status && (
|
||||
|
@ -55,20 +55,20 @@ class BlockModal extends React.PureComponent {
|
||||
handleClick = () => {
|
||||
this.props.onClose();
|
||||
this.props.onConfirm(this.props.account);
|
||||
}
|
||||
};
|
||||
|
||||
handleSecondary = () => {
|
||||
this.props.onClose();
|
||||
this.props.onBlockAndReport(this.props.account);
|
||||
}
|
||||
};
|
||||
|
||||
handleCancel = () => {
|
||||
this.props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
setRef = (c) => {
|
||||
this.button = c;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { account } = this.props;
|
||||
|
@ -58,17 +58,17 @@ class BoostModal extends ImmutablePureComponent {
|
||||
handleReblog = () => {
|
||||
this.props.onReblog(this.props.status, this.props.privacy);
|
||||
this.props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
handleAccountClick = (e) => {
|
||||
if (e.button === 0) {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
let state = {...this.context.router.history.location.state};
|
||||
let state = { ...this.context.router.history.location.state };
|
||||
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
||||
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_findContainer = () => {
|
||||
return document.getElementsByClassName('modal-root__container')[0];
|
||||
@ -76,7 +76,7 @@ class BoostModal extends ImmutablePureComponent {
|
||||
|
||||
setRef = (c) => {
|
||||
this.button = c;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { status, missingMediaDescription, privacy, intl } = this.props;
|
||||
@ -116,9 +116,9 @@ class BoostModal extends ImmutablePureComponent {
|
||||
<div className='boost-modal__action-bar'>
|
||||
<div>
|
||||
{ missingMediaDescription ?
|
||||
<FormattedMessage id='boost_modal.missing_description' defaultMessage='This toot contains some media without description' />
|
||||
<FormattedMessage id='boost_modal.missing_description' defaultMessage='This toot contains some media without description' />
|
||||
:
|
||||
<FormattedMessage id='boost_modal.combo' defaultMessage='You can press {combo} to skip this next time' values={{ combo: <span>Shift + <Icon id='retweet' /></span> }} />
|
||||
<FormattedMessage id='boost_modal.combo' defaultMessage='You can press {combo} to skip this next time' values={{ combo: <span>Shift + <Icon id='retweet' /></span> }} />
|
||||
}
|
||||
</div>
|
||||
|
||||
|
@ -15,7 +15,7 @@ class Bundle extends React.Component {
|
||||
onFetch: PropTypes.func,
|
||||
onFetchSuccess: PropTypes.func,
|
||||
onFetchFail: PropTypes.func,
|
||||
}
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
loading: emptyComponent,
|
||||
@ -24,14 +24,14 @@ class Bundle extends React.Component {
|
||||
onFetch: noop,
|
||||
onFetchSuccess: noop,
|
||||
onFetchFail: noop,
|
||||
}
|
||||
};
|
||||
|
||||
static cache = {}
|
||||
static cache = {};
|
||||
|
||||
state = {
|
||||
mod: undefined,
|
||||
forceRender: false,
|
||||
}
|
||||
};
|
||||
|
||||
componentWillMount() {
|
||||
this.load(this.props);
|
||||
@ -84,7 +84,7 @@ class Bundle extends React.Component {
|
||||
this.setState({ mod: null });
|
||||
onFetchFail(error);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading: Loading, error: Error, children, renderDelay } = this.props;
|
||||
|
@ -31,7 +31,7 @@ class GIF extends React.PureComponent {
|
||||
if (!animate) {
|
||||
this.setState({ hovering: true });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleMouseLeave = () => {
|
||||
const { animate } = this.props;
|
||||
@ -39,7 +39,7 @@ class GIF extends React.PureComponent {
|
||||
if (!animate) {
|
||||
this.setState({ hovering: false });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { src, staticSrc, className, animate } = this.props;
|
||||
@ -75,7 +75,7 @@ class CopyButton extends React.PureComponent {
|
||||
navigator.clipboard.writeText(value);
|
||||
this.setState({ copied: true });
|
||||
this.timeout = setTimeout(() => this.setState({ copied: false }), 700);
|
||||
}
|
||||
};
|
||||
|
||||
componentWillUnmount () {
|
||||
if (this.timeout) clearTimeout(this.timeout);
|
||||
@ -113,7 +113,7 @@ class BundleColumnError extends React.PureComponent {
|
||||
if (onRetry) {
|
||||
onRetry();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { errorType, multiColumn, stacktrace } = this.props;
|
||||
|
@ -16,11 +16,11 @@ class BundleModalError extends React.Component {
|
||||
onRetry: PropTypes.func.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
}
|
||||
};
|
||||
|
||||
handleRetry = () => {
|
||||
this.props.onRetry();
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { onClose, intl: { formatMessage } } = this.props;
|
||||
|
@ -25,7 +25,7 @@ export default class Column extends React.PureComponent {
|
||||
}
|
||||
|
||||
this._interruptScrollAnimation = scrollTop(scrollable);
|
||||
}
|
||||
};
|
||||
|
||||
scrollTop () {
|
||||
const scrollable = this.props.bindToDocument ? document.scrollingElement : this.node.querySelector('.scrollable');
|
||||
@ -42,11 +42,11 @@ export default class Column extends React.PureComponent {
|
||||
if (typeof this._interruptScrollAnimation !== 'undefined') {
|
||||
this._interruptScrollAnimation();
|
||||
}
|
||||
}, 200)
|
||||
}, 200);
|
||||
|
||||
setRef = (c) => {
|
||||
this.node = c;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { heading, icon, children, active, hideHeadingOnMobile, name } = this.props;
|
||||
|
@ -15,7 +15,7 @@ export default class ColumnHeader extends React.PureComponent {
|
||||
|
||||
handleClick = () => {
|
||||
this.props.onClick();
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { icon, type, active, columnHeaderId } = this.props;
|
||||
|
@ -30,7 +30,7 @@ const ColumnLink = ({ icon, text, to, onClick, href, method, badge, transparent,
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return onClick(e);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<a href='#' onClick={onClick && handleOnClick} className={className} title={text} {...other} tabIndex='0'>
|
||||
{iconElement}
|
||||
|
@ -59,7 +59,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
|
||||
|
||||
state = {
|
||||
renderComposePanel: !(this.mediaQuery && this.mediaQuery.matches),
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
if (!this.props.singleColumn) {
|
||||
@ -113,7 +113,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
|
||||
|
||||
handleLayoutChange = (e) => {
|
||||
this.setState({ renderComposePanel: !e.matches });
|
||||
}
|
||||
};
|
||||
|
||||
handleWheel = () => {
|
||||
if (typeof this._interruptScrollAnimation !== 'function') {
|
||||
@ -121,19 +121,19 @@ export default class ColumnsArea extends ImmutablePureComponent {
|
||||
}
|
||||
|
||||
this._interruptScrollAnimation();
|
||||
}
|
||||
};
|
||||
|
||||
setRef = (node) => {
|
||||
this.node = node;
|
||||
}
|
||||
};
|
||||
|
||||
renderLoading = columnId => () => {
|
||||
return columnId === 'COMPOSE' ? <DrawerLoading /> : <ColumnLoading multiColumn />;
|
||||
}
|
||||
};
|
||||
|
||||
renderError = (props) => {
|
||||
return <BundleColumnError multiColumn errorType='network' {...props} />;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { columns, children, singleColumn, navbarUnder, openSettings } = this.props;
|
||||
|
@ -55,4 +55,4 @@ class ComposePanel extends React.PureComponent {
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -34,24 +34,24 @@ class ConfirmationModal extends React.PureComponent {
|
||||
if (this.props.onDoNotAsk && this.doNotAskCheckbox.checked) {
|
||||
this.props.onDoNotAsk();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleSecondary = () => {
|
||||
this.props.onClose();
|
||||
this.props.onSecondary();
|
||||
}
|
||||
};
|
||||
|
||||
handleCancel = () => {
|
||||
this.props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
setRef = (c) => {
|
||||
this.button = c;
|
||||
}
|
||||
};
|
||||
|
||||
setDoNotAskRef = (c) => {
|
||||
this.doNotAskCheckbox = c;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { message, confirm, secondary, onDoNotAsk } = this.props;
|
||||
|
@ -30,11 +30,11 @@ class DeprecatedSettingsModal extends React.PureComponent {
|
||||
handleClick = () => {
|
||||
this.props.onConfirm();
|
||||
this.props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
setRef = (c) => {
|
||||
this.button = c;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { settings, intl } = this.props;
|
||||
|
@ -46,7 +46,7 @@ class DisabledAccountBanner extends React.PureComponent {
|
||||
this.props.onLogout();
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { disabledAcct, movedToAcct } = this.props;
|
||||
@ -89,4 +89,4 @@ class DisabledAccountBanner extends React.PureComponent {
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ class DoodleModal extends ImmutablePureComponent {
|
||||
this.swapped = false;
|
||||
window.addEventListener('keyup', this.handleKeyUp, false);
|
||||
window.addEventListener('keydown', this.handleKeyDown, false);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Tear component down
|
||||
@ -575,7 +575,7 @@ class DoodleModal extends ImmutablePureComponent {
|
||||
<div>
|
||||
<select aria-label='Canvas size' onInput={this.changeSize} defaultValue={this.size}>
|
||||
{ Object.values(mapValues(DOODLE_SIZES, (val, k) =>
|
||||
<option key={k} value={k}>{val[2]}</option>
|
||||
<option key={k} value={k}>{val[2]}</option>,
|
||||
)) }
|
||||
</select>
|
||||
</div>
|
||||
@ -602,7 +602,7 @@ class DoodleModal extends ImmutablePureComponent {
|
||||
'foreground': this.fg === c[0],
|
||||
'background': this.bg === c[0],
|
||||
})}
|
||||
/>
|
||||
/>,
|
||||
)
|
||||
}
|
||||
</div>
|
||||
|
@ -17,7 +17,7 @@ class EmbedModal extends ImmutablePureComponent {
|
||||
onClose: PropTypes.func.isRequired,
|
||||
onError: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
}
|
||||
};
|
||||
|
||||
state = {
|
||||
loading: false,
|
||||
@ -48,11 +48,11 @@ class EmbedModal extends ImmutablePureComponent {
|
||||
|
||||
setIframeRef = c => {
|
||||
this.iframe = c;
|
||||
}
|
||||
};
|
||||
|
||||
handleTextareaClick = (e) => {
|
||||
e.target.select();
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { intl, onClose } = this.props;
|
||||
|
@ -38,21 +38,21 @@ class FavouriteModal extends ImmutablePureComponent {
|
||||
handleFavourite = () => {
|
||||
this.props.onFavourite(this.props.status);
|
||||
this.props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
handleAccountClick = (e) => {
|
||||
if (e.button === 0) {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
let state = {...this.context.router.history.location.state};
|
||||
let state = { ...this.context.router.history.location.state };
|
||||
state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
|
||||
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
setRef = (c) => {
|
||||
this.button = c;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { status, intl } = this.props;
|
||||
|
@ -135,7 +135,7 @@ class FocalPointModal extends ImmutablePureComponent {
|
||||
|
||||
this.updatePosition(e);
|
||||
this.setState({ dragging: true });
|
||||
}
|
||||
};
|
||||
|
||||
handleTouchStart = e => {
|
||||
document.addEventListener('touchmove', this.handleMouseMove);
|
||||
@ -143,25 +143,25 @@ class FocalPointModal extends ImmutablePureComponent {
|
||||
|
||||
this.updatePosition(e);
|
||||
this.setState({ dragging: true });
|
||||
}
|
||||
};
|
||||
|
||||
handleMouseMove = e => {
|
||||
this.updatePosition(e);
|
||||
}
|
||||
};
|
||||
|
||||
handleMouseUp = () => {
|
||||
document.removeEventListener('mousemove', this.handleMouseMove);
|
||||
document.removeEventListener('mouseup', this.handleMouseUp);
|
||||
|
||||
this.setState({ dragging: false });
|
||||
}
|
||||
};
|
||||
|
||||
handleTouchEnd = () => {
|
||||
document.removeEventListener('touchmove', this.handleMouseMove);
|
||||
document.removeEventListener('touchend', this.handleTouchEnd);
|
||||
|
||||
this.setState({ dragging: false });
|
||||
}
|
||||
};
|
||||
|
||||
updatePosition = e => {
|
||||
const { x, y } = getPointerPosition(this.node, e);
|
||||
@ -169,11 +169,11 @@ class FocalPointModal extends ImmutablePureComponent {
|
||||
const focusY = (y - .5) * -2;
|
||||
|
||||
this.props.onChangeFocus(focusX, focusY);
|
||||
}
|
||||
};
|
||||
|
||||
handleChange = e => {
|
||||
this.props.onChangeDescription(e.target.value);
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyDown = (e) => {
|
||||
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
|
||||
@ -182,11 +182,11 @@ class FocalPointModal extends ImmutablePureComponent {
|
||||
this.props.onChangeDescription(e.target.value);
|
||||
this.handleSubmit();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleSubmit = () => {
|
||||
this.props.onSave(this.props.description, this.props.focusX, this.props.focusY);
|
||||
}
|
||||
};
|
||||
|
||||
getCloseConfirmationMessage = () => {
|
||||
const { intl, dirty } = this.props;
|
||||
@ -199,15 +199,15 @@ class FocalPointModal extends ImmutablePureComponent {
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
setRef = c => {
|
||||
this.node = c;
|
||||
}
|
||||
};
|
||||
|
||||
handleTextDetection = () => {
|
||||
this._detectText();
|
||||
}
|
||||
};
|
||||
|
||||
_detectText = (refreshCache = false) => {
|
||||
const { media } = this.props;
|
||||
@ -258,21 +258,21 @@ class FocalPointModal extends ImmutablePureComponent {
|
||||
console.error(e);
|
||||
this.setState({ detecting: false });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
handleThumbnailChange = e => {
|
||||
if (e.target.files.length > 0) {
|
||||
this.props.onSelectThumbnail(e.target.files);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
setFileInputRef = c => {
|
||||
this.fileInput = c;
|
||||
}
|
||||
};
|
||||
|
||||
handleFileInputClick = () => {
|
||||
this.fileInput.click();
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { media, intl, account, onClose, isUploadingThumbnail, description, lang, focusX, focusY, dirty, is_changing_upload } = this.props;
|
||||
|
@ -14,7 +14,7 @@ export default class ImageLoader extends PureComponent {
|
||||
height: PropTypes.number,
|
||||
onClick: PropTypes.func,
|
||||
zoomButtonHidden: PropTypes.bool,
|
||||
}
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
alt: '',
|
||||
@ -26,7 +26,7 @@ export default class ImageLoader extends PureComponent {
|
||||
loading: true,
|
||||
error: false,
|
||||
width: null,
|
||||
}
|
||||
};
|
||||
|
||||
removers = [];
|
||||
canvas = null;
|
||||
@ -86,7 +86,7 @@ export default class ImageLoader extends PureComponent {
|
||||
image.addEventListener('load', handleLoad);
|
||||
image.src = previewSrc;
|
||||
this.removers.push(removeEventListeners);
|
||||
})
|
||||
});
|
||||
|
||||
clearPreviewCanvas () {
|
||||
const { width, height } = this.canvas;
|
||||
@ -126,7 +126,7 @@ export default class ImageLoader extends PureComponent {
|
||||
setCanvasRef = c => {
|
||||
this.canvas = c;
|
||||
if (c) this.setState({ width: c.offsetWidth });
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { alt, src, width, height, onClick } = this.props;
|
||||
|
@ -44,7 +44,7 @@ class LinkFooter extends React.PureComponent {
|
||||
this.props.onLogout();
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { signedIn, permissions } = this.context.identity;
|
||||
@ -93,4 +93,4 @@ class LinkFooter extends React.PureComponent {
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -47,27 +47,27 @@ class MediaModal extends ImmutablePureComponent {
|
||||
|
||||
handleSwipe = (index) => {
|
||||
this.setState({ index: index % this.props.media.size });
|
||||
}
|
||||
};
|
||||
|
||||
handleTransitionEnd = () => {
|
||||
this.setState({
|
||||
zoomButtonHidden: false,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
handleNextClick = () => {
|
||||
this.setState({
|
||||
index: (this.getIndex() + 1) % this.props.media.size,
|
||||
zoomButtonHidden: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
handlePrevClick = () => {
|
||||
this.setState({
|
||||
index: (this.props.media.size + this.getIndex() - 1) % this.props.media.size,
|
||||
zoomButtonHidden: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
handleChangeIndex = (e) => {
|
||||
const index = Number(e.currentTarget.getAttribute('data-index'));
|
||||
@ -76,7 +76,7 @@ class MediaModal extends ImmutablePureComponent {
|
||||
index: index % this.props.media.size,
|
||||
zoomButtonHidden: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyDown = (e) => {
|
||||
switch(e.key) {
|
||||
@ -91,7 +91,7 @@ class MediaModal extends ImmutablePureComponent {
|
||||
e.stopPropagation();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount () {
|
||||
window.addEventListener('keydown', this.handleKeyDown, false);
|
||||
|
@ -76,7 +76,7 @@ export default class ModalRoot extends React.PureComponent {
|
||||
};
|
||||
|
||||
componentDidUpdate () {
|
||||
if (!!this.props.type) {
|
||||
if (this.props.type) {
|
||||
document.body.classList.add('with-modals--active');
|
||||
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
|
||||
} else {
|
||||
@ -87,17 +87,17 @@ export default class ModalRoot extends React.PureComponent {
|
||||
|
||||
setBackgroundColor = color => {
|
||||
this.setState({ backgroundColor: color });
|
||||
}
|
||||
};
|
||||
|
||||
renderLoading = modalId => () => {
|
||||
return ['MEDIA', 'VIDEO', 'BOOST', 'FAVOURITE', 'DOODLE', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? <ModalLoading /> : null;
|
||||
}
|
||||
};
|
||||
|
||||
renderError = (props) => {
|
||||
const { onClose } = this.props;
|
||||
|
||||
return <BundleModalError {...props} onClose={onClose} />;
|
||||
}
|
||||
};
|
||||
|
||||
handleClose = (ignoreFocus = false) => {
|
||||
const { onClose } = this.props;
|
||||
@ -110,14 +110,14 @@ export default class ModalRoot extends React.PureComponent {
|
||||
// This would be much smoother with react-intl 3+ and `forwardRef`.
|
||||
}
|
||||
onClose(message, ignoreFocus);
|
||||
}
|
||||
};
|
||||
|
||||
setModalRef = (c) => {
|
||||
this._modal = c;
|
||||
}
|
||||
};
|
||||
|
||||
// prevent closing of modal when clicking the overlay
|
||||
noop = () => {}
|
||||
noop = () => {};
|
||||
|
||||
render () {
|
||||
const { type, props, ignoreFocus } = this.props;
|
||||
|
@ -65,23 +65,23 @@ class MuteModal extends React.PureComponent {
|
||||
handleClick = () => {
|
||||
this.props.onClose();
|
||||
this.props.onConfirm(this.props.account, this.props.notifications, this.props.muteDuration);
|
||||
}
|
||||
};
|
||||
|
||||
handleCancel = () => {
|
||||
this.props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
setRef = (c) => {
|
||||
this.button = c;
|
||||
}
|
||||
};
|
||||
|
||||
toggleNotifications = () => {
|
||||
this.props.onToggleNotifications();
|
||||
}
|
||||
};
|
||||
|
||||
changeMuteDuration = (e) => {
|
||||
this.props.onChangeMuteDuration(e);
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { account, notifications, muteDuration, intl } = this.props;
|
||||
|
@ -49,7 +49,7 @@ const PageTwo = ({ intl, myAccount }) => (
|
||||
privacy='public'
|
||||
text='Awoo! #introductions'
|
||||
spoilerText=''
|
||||
suggestions={ [] }
|
||||
suggestions={[]}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -195,7 +195,7 @@ class OnboardingModal extends React.PureComponent {
|
||||
<PageFour domain={domain} intl={intl} />,
|
||||
<PageSix admin={admin} domain={domain} />,
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener('keyup', this.handleKeyUp);
|
||||
@ -208,30 +208,30 @@ class OnboardingModal extends React.PureComponent {
|
||||
handleSkip = (e) => {
|
||||
e.preventDefault();
|
||||
this.props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
handleDot = (e) => {
|
||||
const i = Number(e.currentTarget.getAttribute('data-index'));
|
||||
e.preventDefault();
|
||||
this.setState({ currentIndex: i });
|
||||
}
|
||||
};
|
||||
|
||||
handlePrev = () => {
|
||||
this.setState(({ currentIndex }) => ({
|
||||
currentIndex: Math.max(0, currentIndex - 1),
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
handleNext = () => {
|
||||
const { pages } = this;
|
||||
this.setState(({ currentIndex }) => ({
|
||||
currentIndex: Math.min(currentIndex + 1, pages.length - 1),
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
handleSwipe = (index) => {
|
||||
this.setState({ currentIndex: index });
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyUp = ({ key }) => {
|
||||
switch (key) {
|
||||
@ -242,11 +242,11 @@ class OnboardingModal extends React.PureComponent {
|
||||
this.handleNext();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleClose = () => {
|
||||
this.props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { pages } = this;
|
||||
|
@ -96,7 +96,7 @@ class ReportModal extends ImmutablePureComponent {
|
||||
} else {
|
||||
this.setState({ selectedRuleIds: selectedRuleIds.remove(ruleId) });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleChangeCategory = category => {
|
||||
this.setState({ category });
|
||||
|
@ -22,7 +22,7 @@ export default class UploadArea extends React.PureComponent {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount () {
|
||||
window.addEventListener('keyup', this.handleKeyUp, false);
|
||||
|
@ -102,7 +102,7 @@ class ZoomableImage extends React.PureComponent {
|
||||
onClick: PropTypes.func,
|
||||
zoomButtonHidden: PropTypes.bool,
|
||||
intl: PropTypes.object.isRequired,
|
||||
}
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
alt: '',
|
||||
@ -132,7 +132,7 @@ class ZoomableImage extends React.PureComponent {
|
||||
dragged: false,
|
||||
lockScroll: { x: 0, y: 0 },
|
||||
lockTranslate: { x: 0, y: 0 },
|
||||
}
|
||||
};
|
||||
|
||||
removers = [];
|
||||
container = null;
|
||||
@ -212,7 +212,7 @@ class ZoomableImage extends React.PureComponent {
|
||||
|
||||
// lock horizontal scroll
|
||||
this.container.scrollLeft = Math.max(this.container.scrollLeft + event.pixelX, this.state.lockScroll.x);
|
||||
}
|
||||
};
|
||||
|
||||
mouseDownHandler = e => {
|
||||
this.container.style.cursor = 'grabbing';
|
||||
@ -228,7 +228,7 @@ class ZoomableImage extends React.PureComponent {
|
||||
|
||||
this.image.addEventListener('mousemove', this.mouseMoveHandler);
|
||||
this.image.addEventListener('mouseup', this.mouseUpHandler);
|
||||
}
|
||||
};
|
||||
|
||||
mouseMoveHandler = e => {
|
||||
const dx = e.clientX - this.state.dragPosition.x;
|
||||
@ -238,7 +238,7 @@ class ZoomableImage extends React.PureComponent {
|
||||
this.container.scrollTop = Math.max(this.state.dragPosition.top - dy, this.state.lockScroll.y);
|
||||
|
||||
this.setState({ dragged: true });
|
||||
}
|
||||
};
|
||||
|
||||
mouseUpHandler = () => {
|
||||
this.container.style.cursor = 'grab';
|
||||
@ -246,13 +246,13 @@ class ZoomableImage extends React.PureComponent {
|
||||
|
||||
this.image.removeEventListener('mousemove', this.mouseMoveHandler);
|
||||
this.image.removeEventListener('mouseup', this.mouseUpHandler);
|
||||
}
|
||||
};
|
||||
|
||||
handleTouchStart = e => {
|
||||
if (e.touches.length !== 2) return;
|
||||
|
||||
this.lastDistance = getDistance(...e.touches);
|
||||
}
|
||||
};
|
||||
|
||||
handleTouchMove = e => {
|
||||
const { scrollTop, scrollHeight, clientHeight } = this.container;
|
||||
@ -275,7 +275,7 @@ class ZoomableImage extends React.PureComponent {
|
||||
|
||||
this.lastMidpoint = midpoint;
|
||||
this.lastDistance = distance;
|
||||
}
|
||||
};
|
||||
|
||||
zoom(nextScale, midpoint) {
|
||||
const { scale, zoomMatrix } = this.state;
|
||||
@ -314,11 +314,11 @@ class ZoomableImage extends React.PureComponent {
|
||||
const handler = this.props.onClick;
|
||||
if (handler) handler();
|
||||
this.setState({ navigationHidden: !this.state.navigationHidden });
|
||||
}
|
||||
};
|
||||
|
||||
handleMouseDown = e => {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
initZoomMatrix = () => {
|
||||
const { width, height } = this.props;
|
||||
@ -350,7 +350,7 @@ class ZoomableImage extends React.PureComponent {
|
||||
translateY: translateY,
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
handleZoomClick = e => {
|
||||
e.preventDefault();
|
||||
@ -392,15 +392,15 @@ class ZoomableImage extends React.PureComponent {
|
||||
|
||||
this.container.style.cursor = 'grab';
|
||||
this.container.style.removeProperty('user-select');
|
||||
}
|
||||
};
|
||||
|
||||
setContainerRef = c => {
|
||||
this.container = c;
|
||||
}
|
||||
};
|
||||
|
||||
setImageRef = c => {
|
||||
this.image = c;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { alt, src, width, height, intl } = this.props;
|
||||
|
@ -162,7 +162,7 @@ class SwitchingColumnsArea extends React.PureComponent {
|
||||
if (c) {
|
||||
this.node = c;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { children, mobile, navbarUnder } = this.props;
|
||||
@ -240,7 +240,7 @@ class SwitchingColumnsArea extends React.PureComponent {
|
||||
</WrappedSwitch>
|
||||
</ColumnsAreaContainer>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ class UI extends React.Component {
|
||||
// but we set user-friendly message for other browsers, e.g. Edge.
|
||||
e.returnValue = intl.formatMessage(messages.beforeUnload);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleDragEnter = (e) => {
|
||||
e.preventDefault();
|
||||
@ -308,7 +308,7 @@ class UI extends React.Component {
|
||||
if (e.dataTransfer && e.dataTransfer.types.includes('Files') && this.props.canUploadMore && this.context.identity.signedIn) {
|
||||
this.setState({ draggingOver: true });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleDragOver = (e) => {
|
||||
if (this.dataTransferIsText(e.dataTransfer)) return false;
|
||||
@ -322,7 +322,7 @@ class UI extends React.Component {
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
handleDrop = (e) => {
|
||||
if (this.dataTransferIsText(e.dataTransfer)) return;
|
||||
@ -335,7 +335,7 @@ class UI extends React.Component {
|
||||
if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore && this.context.identity.signedIn) {
|
||||
this.props.dispatch(uploadCompose(e.dataTransfer.files));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleDragLeave = (e) => {
|
||||
e.preventDefault();
|
||||
@ -348,15 +348,15 @@ class UI extends React.Component {
|
||||
}
|
||||
|
||||
this.setState({ draggingOver: false });
|
||||
}
|
||||
};
|
||||
|
||||
dataTransferIsText = (dataTransfer) => {
|
||||
return (dataTransfer && Array.from(dataTransfer.types).filter((type) => type === 'text/plain').length === 1);
|
||||
}
|
||||
};
|
||||
|
||||
closeUploadModal = () => {
|
||||
this.setState({ draggingOver: false });
|
||||
}
|
||||
};
|
||||
|
||||
handleServiceWorkerPostMessage = ({ data }) => {
|
||||
if (data.type === 'navigate') {
|
||||
@ -364,7 +364,7 @@ class UI extends React.Component {
|
||||
} else {
|
||||
console.warn('Unknown message type:', data.type);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleVisibilityChange = () => {
|
||||
const visibility = !document[this.visibilityHiddenProp];
|
||||
@ -372,7 +372,7 @@ class UI extends React.Component {
|
||||
if (visibility) {
|
||||
this.props.dispatch(submitMarkers({ immediate: true }));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleLayoutChange = debounce(() => {
|
||||
this.props.dispatch(clearHeight()); // The cached heights are no longer accurate, invalidate
|
||||
@ -389,7 +389,7 @@ class UI extends React.Component {
|
||||
} else {
|
||||
this.handleLayoutChange();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount () {
|
||||
const { signedIn } = this.context.identity;
|
||||
@ -407,7 +407,7 @@ class UI extends React.Component {
|
||||
navigator.serviceWorker.addEventListener('message', this.handleServiceWorkerPostMessage);
|
||||
}
|
||||
|
||||
this.favicon = new Favico({ animation:"none" });
|
||||
this.favicon = new Favico({ animation:'none' });
|
||||
|
||||
// On first launch, redirect to the follow recommendations page
|
||||
if (signedIn && this.props.firstLaunch) {
|
||||
@ -487,7 +487,7 @@ class UI extends React.Component {
|
||||
|
||||
setRef = c => {
|
||||
this.node = c;
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyNew = e => {
|
||||
e.preventDefault();
|
||||
@ -497,7 +497,7 @@ class UI extends React.Component {
|
||||
if (element) {
|
||||
element.focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeySearch = e => {
|
||||
e.preventDefault();
|
||||
@ -507,17 +507,17 @@ class UI extends React.Component {
|
||||
if (element) {
|
||||
element.focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyForceNew = e => {
|
||||
this.handleHotkeyNew(e);
|
||||
this.props.dispatch(resetCompose());
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyToggleComposeSpoilers = e => {
|
||||
e.preventDefault();
|
||||
this.props.dispatch(changeComposeSpoilerness());
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyFocusColumn = e => {
|
||||
const index = (e.key * 1) + 1; // First child is drawer, skip that
|
||||
@ -535,7 +535,7 @@ class UI extends React.Component {
|
||||
status.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyBack = () => {
|
||||
// if history is exhausted, or we would leave mastodon, just go to root.
|
||||
@ -544,11 +544,11 @@ class UI extends React.Component {
|
||||
} else {
|
||||
this.props.history.push('/');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
setHotkeysRef = c => {
|
||||
this.hotkeys = c;
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyToggleHelp = () => {
|
||||
if (this.props.location.pathname === '/keyboard-shortcuts') {
|
||||
@ -556,55 +556,55 @@ class UI extends React.Component {
|
||||
} else {
|
||||
this.props.history.push('/keyboard-shortcuts');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToHome = () => {
|
||||
this.props.history.push('/home');
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToNotifications = () => {
|
||||
this.props.history.push('/notifications');
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToLocal = () => {
|
||||
this.props.history.push('/public/local');
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToFederated = () => {
|
||||
this.props.history.push('/public');
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToDirect = () => {
|
||||
this.props.history.push('/conversations');
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToStart = () => {
|
||||
this.props.history.push('/getting-started');
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToFavourites = () => {
|
||||
this.props.history.push('/favourites');
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToPinned = () => {
|
||||
this.props.history.push('/pinned');
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToProfile = () => {
|
||||
this.props.history.push(`/@${this.props.username}`);
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToBlocked = () => {
|
||||
this.props.history.push('/blocks');
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToMuted = () => {
|
||||
this.props.history.push('/mutes');
|
||||
}
|
||||
};
|
||||
|
||||
handleHotkeyGoToRequests = () => {
|
||||
this.props.history.push('/follow_requests');
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { draggingOver } = this.state;
|
||||
@ -661,7 +661,7 @@ class UI extends React.Component {
|
||||
<PermaLink href={moved.get('url')} to={`/@${moved.get('acct')}`}>
|
||||
@{moved.get('acct')}
|
||||
</PermaLink>
|
||||
)}}
|
||||
) }}
|
||||
/>
|
||||
</div>)}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export class WrappedRoute extends React.Component {
|
||||
content: PropTypes.node,
|
||||
multiColumn: PropTypes.bool,
|
||||
componentParams: PropTypes.object,
|
||||
}
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
componentParams: {},
|
||||
@ -46,7 +46,7 @@ export class WrappedRoute extends React.Component {
|
||||
return {
|
||||
hasError: true,
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
state = {
|
||||
hasError: false,
|
||||
@ -80,17 +80,17 @@ export class WrappedRoute extends React.Component {
|
||||
{Component => <Component params={match.params} multiColumn={multiColumn} {...componentParams}>{content}</Component>}
|
||||
</BundleContainer>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
renderLoading = () => {
|
||||
const { multiColumn } = this.props;
|
||||
|
||||
return <ColumnLoading multiColumn={multiColumn} />;
|
||||
}
|
||||
};
|
||||
|
||||
renderError = (props) => {
|
||||
return <BundleColumnError {...props} errorType='network' />;
|
||||
}
|
||||
};
|
||||
|
||||
render () {
|
||||
const { component: Component, content, ...rest } = this.props;
|
||||
|
@ -17,7 +17,7 @@ class ReducedMotion extends React.Component {
|
||||
defaultStyle: PropTypes.object,
|
||||
style: PropTypes.object,
|
||||
children: PropTypes.func,
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
|
Reference in New Issue
Block a user