Enforce spacing of function parameters in eslint

stable/1.0.x
Alex Gleason 2020-04-14 16:47:35 -05:00
rodzic 2beb4d725f
commit 8a19b89c16
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
198 zmienionych plików z 518 dodań i 516 usunięć

Wyświetl plik

@ -59,6 +59,8 @@ module.exports = {
},
],
'comma-style': ['warn', 'last'],
'space-before-function-paren': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'consistent-return': 'error',
'dot-notation': 'error',
eqeqeq: 'error',

Wyświetl plik

@ -151,7 +151,7 @@ export function handleComposeSubmit(dispatch, getState, response, status) {
}
export function submitCompose(routerHistory, group) {
return function (dispatch, getState) {
return function(dispatch, getState) {
if (!getState().get('me')) return;
const status = getState().getIn(['compose', 'text'], '');
@ -177,12 +177,12 @@ export function submitCompose(routerHistory, group) {
headers: {
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']),
},
}).then(function (response) {
}).then(function(response) {
if (response.data.visibility === 'direct' && getState().getIn(['conversations', 'mounted']) <= 0 && routerHistory) {
routerHistory.push('/messages');
}
handleComposeSubmit(dispatch, getState, response, status);
}).catch(function (error) {
}).catch(function(error) {
dispatch(submitComposeFail(error));
});
};
@ -209,7 +209,7 @@ export function submitComposeFail(error) {
};
export function uploadCompose(files) {
return function (dispatch, getState) {
return function(dispatch, getState) {
if (!getState().get('me')) return;
const uploadLimit = 4;

Wyświetl plik

@ -1,7 +1,7 @@
export const HEIGHT_CACHE_SET = 'HEIGHT_CACHE_SET';
export const HEIGHT_CACHE_CLEAR = 'HEIGHT_CACHE_CLEAR';
export function setHeight (key, id, height) {
export function setHeight(key, id, height) {
return {
type: HEIGHT_CACHE_SET,
key,
@ -10,7 +10,7 @@ export function setHeight (key, id, height) {
};
};
export function clearHeight () {
export function clearHeight() {
return {
type: HEIGHT_CACHE_CLEAR,
};

Wyświetl plik

@ -34,17 +34,17 @@ export const UNPIN_SUCCESS = 'UNPIN_SUCCESS';
export const UNPIN_FAIL = 'UNPIN_FAIL';
export function reblog(status) {
return function (dispatch, getState) {
return function(dispatch, getState) {
if (!getState().get('me')) return;
dispatch(reblogRequest(status));
api(getState).post(`/api/v1/statuses/${status.get('id')}/reblog`).then(function (response) {
api(getState).post(`/api/v1/statuses/${status.get('id')}/reblog`).then(function(response) {
// The reblog API method returns a new status wrapped around the original. In this case we are only
// interested in how the original is modified, hence passing it skipping the wrapper
dispatch(importFetchedStatus(response.data.reblog));
dispatch(reblogSuccess(status));
}).catch(function (error) {
}).catch(function(error) {
dispatch(reblogFail(status, error));
});
};
@ -116,15 +116,15 @@ export function unreblogFail(status, error) {
};
export function favourite(status) {
return function (dispatch, getState) {
return function(dispatch, getState) {
if (!getState().get('me')) return;
dispatch(favouriteRequest(status));
api(getState).post(`/api/v1/statuses/${status.get('id')}/favourite`).then(function (response) {
api(getState).post(`/api/v1/statuses/${status.get('id')}/favourite`).then(function(response) {
dispatch(importFetchedStatus(response.data));
dispatch(favouriteSuccess(status));
}).catch(function (error) {
}).catch(function(error) {
dispatch(favouriteFail(status, error));
});
};
@ -309,7 +309,7 @@ export function pinFail(status, error) {
};
};
export function unpin (status) {
export function unpin(status) {
return (dispatch, getState) => {
if (!getState().get('me')) return;

Wyświetl plik

@ -240,7 +240,7 @@ export function scrollTopNotifications(top) {
};
}
export function setFilter (filterType) {
export function setFilter(filterType) {
return dispatch => {
dispatch({
type: NOTIFICATIONS_FILTER_SET,

Wyświetl plik

@ -46,7 +46,7 @@ const sendSubscriptionToBackend = (subscription, me) => {
// Last one checks for payload support: https://web-push-book.gauntface.com/chapter-06/01-non-standards-browsers/#no-payload
const supportsPushNotifications = ('serviceWorker' in navigator && 'PushManager' in window && 'getKey' in PushSubscription.prototype);
export function register () {
export function register() {
return (dispatch, getState) => {
const me = getState().get('me');
dispatch(setBrowserSupport(supportsPushNotifications));

Wyświetl plik

@ -3,27 +3,27 @@ export const SET_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_SET_SUBSCRIPTION';
export const CLEAR_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_CLEAR_SUBSCRIPTION';
export const SET_ALERTS = 'PUSH_NOTIFICATIONS_SET_ALERTS';
export function setBrowserSupport (value) {
export function setBrowserSupport(value) {
return {
type: SET_BROWSER_SUPPORT,
value,
};
}
export function setSubscription (subscription) {
export function setSubscription(subscription) {
return {
type: SET_SUBSCRIPTION,
subscription,
};
}
export function clearSubscription () {
export function clearSubscription() {
return {
type: CLEAR_SUBSCRIPTION,
};
}
export function setAlerts (path, value) {
export function setAlerts(path, value) {
return dispatch => {
dispatch({
type: SET_ALERTS,

Wyświetl plik

@ -13,7 +13,7 @@ import { getLocale } from '../locales';
const { messages } = getLocale();
export function connectTimelineStream (timelineId, path, pollingRefresh = null, accept = null) {
export function connectTimelineStream(timelineId, path, pollingRefresh = null, accept = null) {
return connectStream (path, pollingRefresh, (dispatch, getState) => {
const locale = getState().getIn(['meta', 'locale']);
@ -27,7 +27,7 @@ export function connectTimelineStream (timelineId, path, pollingRefresh = null,
dispatch(disconnectTimeline(timelineId));
},
onReceive (data) {
onReceive(data) {
switch(data.event) {
case 'update':
dispatch(updateTimelineQueue(timelineId, JSON.parse(data.payload), accept));

Wyświetl plik

@ -34,7 +34,7 @@ export default getState => {
'Authorization': `Bearer ${access_token}`,
} : {}),
transformResponse: [function (data) {
transformResponse: [function(data) {
try {
return JSON.parse(data);
} catch(Exception) {

Wyświetl plik

@ -67,7 +67,7 @@ class Account extends ImmutablePureComponent {
this.props.onActionClick(this.props.account);
}
render () {
render() {
const { account, intl, hidden, onActionClick, actionIcon, actionTitle, me } = this.props;
if (!account) {

Wyświetl plik

@ -13,7 +13,7 @@ export default class AttachmentList extends ImmutablePureComponent {
compact: PropTypes.bool,
};
render () {
render() {
const { media, compact } = this.props;
if (compact) {

Wyświetl plik

@ -10,7 +10,7 @@ export default class AutosuggestEmoji extends React.PureComponent {
emoji: PropTypes.object.isRequired,
};
render () {
render() {
const { emoji } = this.props;
let url;

Wyświetl plik

@ -153,7 +153,7 @@ export default class AutosuggestInput extends ImmutablePureComponent {
this.input.focus();
}
componentWillReceiveProps (nextProps) {
componentWillReceiveProps(nextProps) {
if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) {
this.setState({ suggestionsHidden: false });
}
@ -185,7 +185,7 @@ export default class AutosuggestInput extends ImmutablePureComponent {
);
}
render () {
render() {
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength } = this.props;
const { suggestionsHidden } = this.state;
const style = { direction: 'ltr' };

Wyświetl plik

@ -159,7 +159,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
this.textarea.focus();
}
componentWillReceiveProps (nextProps) {
componentWillReceiveProps(nextProps) {
if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) {
this.setState({ suggestionsHidden: false });
}
@ -198,7 +198,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
);
}
render () {
render() {
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, children } = this.props;
const { suggestionsHidden } = this.state;
const style = { direction: 'ltr' };

Wyświetl plik

@ -32,7 +32,7 @@ export default class Avatar extends React.PureComponent {
this.setState({ hovering: false });
}
render () {
render() {
const { account, size, animate, inline } = this.props;
if (!account) return null;
const { hovering } = this.state;

Wyświetl plik

@ -15,7 +15,7 @@ export default class AvatarComposite extends React.PureComponent {
animate: autoPlayGif,
};
renderItem (account, size, index) {
renderItem(account, size, index) {
const { animate } = this.props;
let width = 50;

Wyświetl plik

@ -34,7 +34,7 @@ export default class Button extends React.PureComponent {
this.node.focus();
}
render () {
render() {
const style = {
padding: `0 ${this.props.size / 2.25}px`,
height: `${this.props.size}px`,

Wyświetl plik

@ -8,7 +8,7 @@ export default class Column extends React.PureComponent {
label: PropTypes.string,
};
render () {
render() {
const { label, children } = this.props;
return (

Wyświetl plik

@ -17,7 +17,7 @@ export default class ColumnBackButton extends React.PureComponent {
}
}
render () {
render() {
return (
<button onClick={this.handleClick} className='column-back-button'>
<Icon id='chevron-left' className='column-back-button__icon' fixedWidth />

Wyświetl plik

@ -5,7 +5,7 @@ import Icon from 'gabsocial/components/icon';
export default class ColumnBackButtonSlim extends ColumnBackButton {
render () {
render() {
return (
<div className='column-back-button--slim'>
<div role='button' tabIndex='0' onClick={this.handleClick} className='column-back-button column-back-button--slim-button'>

Wyświetl plik

@ -53,7 +53,7 @@ class ColumnHeader extends React.PureComponent {
this.setState({ animating: false });
}
render () {
render() {
const { title, icon, active, children, extraButton, intl: { formatMessage } } = this.props;
const { collapsed, animating } = this.state;

Wyświetl plik

@ -10,7 +10,7 @@ export default class DisplayName extends React.PureComponent {
others: ImmutablePropTypes.list,
};
render () {
render() {
const { others } = this.props;
let displayName, suffix, account;

Wyświetl plik

@ -21,7 +21,7 @@ class Account extends ImmutablePureComponent {
this.props.onUnblockDomain(this.props.domain);
}
render () {
render() {
const { domain, intl } = this.props;
return (

Wyświetl plik

@ -41,7 +41,7 @@ class DropdownMenu extends React.PureComponent {
}
}
componentDidMount () {
componentDidMount() {
document.addEventListener('click', this.handleDocumentClick, false);
document.addEventListener('keydown', this.handleKeyDown, false);
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);
@ -49,7 +49,7 @@ class DropdownMenu extends React.PureComponent {
this.setState({ mounted: true });
}
componentWillUnmount () {
componentWillUnmount() {
document.removeEventListener('click', this.handleDocumentClick, false);
document.removeEventListener('keydown', this.handleKeyDown, false);
document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);
@ -117,7 +117,7 @@ class DropdownMenu extends React.PureComponent {
}
}
renderItem (option, i) {
renderItem(option, i) {
if (option === null) {
return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
}
@ -143,7 +143,7 @@ class DropdownMenu extends React.PureComponent {
);
}
render () {
render() {
const { items, style, placement, arrowOffsetLeft, arrowOffsetTop } = this.props;
const { mounted } = this.state;
return (
@ -252,7 +252,7 @@ export default class Dropdown extends React.PureComponent {
}
}
render () {
render() {
const { icon, items, size, title, disabled, dropdownPlacement, openDropdownId, openedViaKeyboard } = this.props;
const open = this.state.id === openDropdownId;

Wyświetl plik

@ -21,11 +21,11 @@ export default class ExtendedVideoPlayer extends React.PureComponent {
}
}
componentDidMount () {
componentDidMount() {
this.video.addEventListener('loadeddata', this.handleLoadedData);
}
componentWillUnmount () {
componentWillUnmount() {
this.video.removeEventListener('loadeddata', this.handleLoadedData);
}
@ -39,7 +39,7 @@ export default class ExtendedVideoPlayer extends React.PureComponent {
if (handler) handler();
}
render () {
render() {
const { src, muted, controls, alt } = this.props;
let conditionalAttributes = {};
if (isIOS()) {

Wyświetl plik

@ -76,7 +76,7 @@ class ColumnHeader extends React.PureComponent {
});
}
render () {
render() {
const { active, children, intl: { formatMessage }, activeItem, activeSubItem, lists, siteTitle } = this.props;
const { collapsed, animating, expandedFor } = this.state;

Wyświetl plik

@ -10,7 +10,7 @@ export default class Icon extends React.PureComponent {
fixedWidth: PropTypes.bool,
};
render () {
render() {
const { id, className, fixedWidth, ...other } = this.props;
// Use the font awesome retweet icon, but change its alt
// tag. There is a common adblocker rule which hides elements with

Wyświetl plik

@ -42,7 +42,7 @@ export default class IconButton extends React.PureComponent {
}
}
render () {
render() {
const style = {
fontSize: `${this.props.size}px`,
width: `${this.props.size * 1.28571429}px`,

Wyświetl plik

@ -26,7 +26,7 @@ export default class IntersectionObserverArticle extends React.Component {
isHidden: false, // set to true in requestIdleCallback to trigger un-render
}
shouldComponentUpdate (nextProps, nextState) {
shouldComponentUpdate(nextProps, nextState) {
const isUnrendered = !this.state.isIntersecting && (this.state.isHidden || this.props.cachedHeight);
const willBeUnrendered = !nextState.isIntersecting && (nextState.isHidden || nextProps.cachedHeight);
if (!!isUnrendered !== !!willBeUnrendered) {
@ -38,7 +38,7 @@ export default class IntersectionObserverArticle extends React.Component {
return !propsToDiff.every(prop => is(nextProps[prop], this.props[prop]));
}
componentDidMount () {
componentDidMount() {
const { intersectionObserverWrapper, id } = this.props;
intersectionObserverWrapper.observe(
@ -50,7 +50,7 @@ export default class IntersectionObserverArticle extends React.Component {
this.componentMounted = true;
}
componentWillUnmount () {
componentWillUnmount() {
const { intersectionObserverWrapper, id } = this.props;
intersectionObserverWrapper.unobserve(id, this.node);
@ -100,7 +100,7 @@ export default class IntersectionObserverArticle extends React.Component {
this.node = node;
}
render () {
render() {
const { children, id, index, listLength, cachedHeight } = this.props;
const { isIntersecting, isHidden } = this.state;

Wyświetl plik

@ -21,7 +21,7 @@ class LoadGap extends React.PureComponent {
this.props.onClick(this.props.maxId);
}
render () {
render() {
const { disabled, intl } = this.props;
return (

Wyświetl plik

@ -50,7 +50,7 @@ class Item extends React.PureComponent {
}
}
hoverToPlay () {
hoverToPlay() {
const { attachment } = this.props;
return !autoPlayGif && attachment.get('type') === 'gifv';
}
@ -75,19 +75,19 @@ class Item extends React.PureComponent {
e.stopPropagation();
}
componentDidMount () {
componentDidMount() {
if (this.props.attachment.get('blurhash')) {
this._decode();
}
}
componentDidUpdate (prevProps) {
componentDidUpdate(prevProps) {
if (prevProps.attachment.get('blurhash') !== this.props.attachment.get('blurhash') && this.props.attachment.get('blurhash')) {
this._decode();
}
}
_decode () {
_decode() {
const hash = this.props.attachment.get('blurhash');
const pixels = decode(hash, 32, 32);
@ -107,7 +107,7 @@ class Item extends React.PureComponent {
this.setState({ loaded: true });
}
render () {
render() {
const { attachment, standalone, displayWidth, visible, dimensions } = this.props;
let width = 100;
@ -241,7 +241,7 @@ class MediaGallery extends React.PureComponent {
width: this.props.defaultWidth,
};
componentWillReceiveProps (nextProps) {
componentWillReceiveProps(nextProps) {
if (!is(nextProps.media, this.props.media) && nextProps.visible === undefined) {
this.setState({ visible: displayMedia !== 'hide_all' && !nextProps.sensitive || displayMedia === 'show_all' });
} else if (!is(nextProps.visible, this.props.visible) && nextProps.visible !== undefined) {
@ -272,7 +272,7 @@ class MediaGallery extends React.PureComponent {
}
}
render () {
render() {
const { media, intl, sensitive, height, defaultWidth } = this.props;
const { visible } = this.state;

Wyświetl plik

@ -62,11 +62,11 @@ class ModalRoot extends React.PureComponent {
}
};
componentDidMount () {
componentDidMount() {
window.addEventListener('keyup', this.handleKeyUp, false);
}
componentWillReceiveProps (nextProps) {
componentWillReceiveProps(nextProps) {
if (!!nextProps.children && !this.props.children) {
this.activeElement = document.activeElement;
@ -80,7 +80,7 @@ class ModalRoot extends React.PureComponent {
}
}
componentDidUpdate (prevProps) {
componentDidUpdate(prevProps) {
if (!this.props.children && !!prevProps.children) {
this.getSiblings().forEach(sibling => sibling.removeAttribute('inert'));
}
@ -91,7 +91,7 @@ class ModalRoot extends React.PureComponent {
}
}
componentWillUnmount () {
componentWillUnmount() {
window.removeEventListener('keyup', this.handleKeyUp);
}
@ -103,7 +103,7 @@ class ModalRoot extends React.PureComponent {
this.node = ref;
}
render () {
render() {
const { children } = this.props;
const { revealed } = this.state;
const visible = !!children;

Wyświetl plik

@ -27,7 +27,7 @@ export default class Permalink extends React.PureComponent {
}
}
render () {
render() {
const { href, children, className, onInterceptClick, ...other } = this.props;
return (

Wyświetl plik

@ -68,7 +68,7 @@ class Poll extends ImmutablePureComponent {
this.props.dispatch(fetchPoll(this.props.poll.get('id')));
};
renderOption (option, optionIndex) {
renderOption(option, optionIndex) {
const { poll, disabled } = this.props;
const percent = poll.get('votes_count') === 0 ? 0 : (option.get('votes_count') / poll.get('votes_count')) * 100;
const leading = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') > other.get('votes_count'));
@ -110,7 +110,7 @@ class Poll extends ImmutablePureComponent {
);
}
render () {
render() {
const { poll, intl } = this.props;
if (!poll) {

Wyświetl plik

@ -129,7 +129,7 @@ class RelativeTimestamp extends React.Component {
year: (new Date()).getFullYear(),
};
shouldComponentUpdate (nextProps, nextState) {
shouldComponentUpdate(nextProps, nextState) {
// As of right now the locale doesn't change without a new page load,
// but we might as well check in case that ever changes.
return this.props.timestamp !== nextProps.timestamp ||
@ -137,25 +137,25 @@ class RelativeTimestamp extends React.Component {
this.state.now !== nextState.now;
}
componentWillReceiveProps (nextProps) {
componentWillReceiveProps(nextProps) {
if (this.props.timestamp !== nextProps.timestamp) {
this.setState({ now: this.props.intl.now() });
}
}
componentDidMount () {
componentDidMount() {
this._scheduleNextUpdate(this.props, this.state);
}
componentWillUpdate (nextProps, nextState) {
componentWillUpdate(nextProps, nextState) {
this._scheduleNextUpdate(nextProps, nextState);
}
componentWillUnmount () {
componentWillUnmount() {
clearTimeout(this._timer);
}
_scheduleNextUpdate (props, state) {
_scheduleNextUpdate(props, state) {
clearTimeout(this._timer);
const { timestamp } = props;
@ -170,7 +170,7 @@ class RelativeTimestamp extends React.Component {
}, delay);
}
render () {
render() {
const { timestamp, intl, year, futureDate } = this.props;
const date = new Date(timestamp);

Wyświetl plik

@ -79,7 +79,7 @@ export default class ScrollableList extends PureComponent {
this.scrollToTopOnMouseIdle = false;
}
componentDidMount () {
componentDidMount() {
this.window = window;
this.documentElement = document.scrollingElement || document.documentElement;
@ -103,7 +103,7 @@ export default class ScrollableList extends PureComponent {
this.setScrollTop(newScrollTop);
}
componentDidUpdate (prevProps, prevState, snapshot) {
componentDidUpdate(prevProps, prevState, snapshot) {
// Reset the scroll position when a new child comes in in order not to
// jerk the scrollbar around if you're already scrolled down the page.
if (snapshot !== null) {
@ -111,12 +111,12 @@ export default class ScrollableList extends PureComponent {
}
}
attachScrollListener () {
attachScrollListener() {
this.window.addEventListener('scroll', this.handleScroll);
this.window.addEventListener('wheel', this.handleWheel);
}
detachScrollListener () {
detachScrollListener() {
this.window.removeEventListener('scroll', this.handleScroll);
this.window.removeEventListener('wheel', this.handleWheel);
}
@ -154,7 +154,7 @@ export default class ScrollableList extends PureComponent {
trailing: true,
});
getSnapshotBeforeUpdate (prevProps) {
getSnapshotBeforeUpdate(prevProps) {
const someItemInserted = React.Children.count(prevProps.children) > 0 &&
React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&
this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);
@ -172,21 +172,21 @@ export default class ScrollableList extends PureComponent {
}
}
componentWillUnmount () {
componentWillUnmount() {
this.clearMouseIdleTimer();
this.detachScrollListener();
this.detachIntersectionObserver();
}
attachIntersectionObserver () {
attachIntersectionObserver() {
this.intersectionObserverWrapper.connect();
}
detachIntersectionObserver () {
detachIntersectionObserver() {
this.intersectionObserverWrapper.disconnect();
}
getFirstChildKey (props) {
getFirstChildKey(props) {
const { children } = props;
let firstChild = children;
@ -204,7 +204,7 @@ export default class ScrollableList extends PureComponent {
this.props.onLoadMore();
}
render () {
render() {
const { children, scrollKey, showLoading, isLoading, hasMore, prepend, alwaysPrepend, emptyMessage, onLoadMore } = this.props;
const childrenCount = React.Children.count(children);

Wyświetl plik

@ -15,7 +15,7 @@ export default class SettingText extends React.PureComponent {
this.props.onChange(this.props.settingKey, e.target.value);
}
render () {
render() {
const { settings, settingKey, label } = this.props;
return (

Wyświetl plik

@ -44,7 +44,7 @@ const mapStateToProps = state => {
};
const mapDispatchToProps = (dispatch) => ({
onClose () {
onClose() {
dispatch(closeSidebar());
},
onClickLogOut(e) {
@ -64,7 +64,7 @@ class SidebarMenu extends ImmutablePureComponent {
onClose: PropTypes.func.isRequired,
};
render () {
render() {
const { sidebarOpen, onClose, intl, account, onClickLogOut } = this.props;
if (!account) return null;
const acct = account.get('acct');

Wyświetl plik

@ -106,11 +106,11 @@ class Status extends ImmutablePureComponent {
};
// Track height changes we know about to compensate scrolling
componentDidMount () {
componentDidMount() {
this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');
}
getSnapshotBeforeUpdate () {
getSnapshotBeforeUpdate() {
if (this.props.getScrollPosition) {
return this.props.getScrollPosition();
} else {
@ -130,7 +130,7 @@ class Status extends ImmutablePureComponent {
}
// Compensate height changes
componentDidUpdate (prevProps, prevState, snapshot) {
componentDidUpdate(prevProps, prevState, snapshot) {
const doShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');
if (doShowCard && !this.didShowCard) {
@ -186,11 +186,11 @@ class Status extends ImmutablePureComponent {
this.props.onToggleHidden(this._properStatus());
};
renderLoadingMediaGallery () {
renderLoadingMediaGallery() {
return <div className='media_gallery' style={{ height: '110px' }} />;
}
renderLoadingVideoPlayer () {
renderLoadingVideoPlayer() {
return <div className='media-spoiler-video' style={{ height: '110px' }} />;
}
@ -240,7 +240,7 @@ class Status extends ImmutablePureComponent {
this.handleToggleMediaVisibility();
}
_properStatus () {
_properStatus() {
const { status } = this.props;
if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {
@ -254,7 +254,7 @@ class Status extends ImmutablePureComponent {
this.node = c;
}
render () {
render() {
let media = null;
let statusAvatar, prepend, rebloggedByText, reblogContent;

Wyświetl plik

@ -244,7 +244,7 @@ class StatusActionBar extends ImmutablePureComponent {
return menu;
}
render () {
render() {
const { status, intl } = this.props;
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));

Wyświetl plik

@ -29,7 +29,7 @@ export default class StatusContent extends React.PureComponent {
collapsed: null, // `collapsed: null` indicates that an element doesn't need collapsing, while `true` or `false` indicates that it does (and is/isn't).
};
_updateStatusLinks () {
_updateStatusLinks() {
const node = this.node;
if (!node) {
@ -68,11 +68,11 @@ export default class StatusContent extends React.PureComponent {
}
}
componentDidMount () {
componentDidMount() {
this._updateStatusLinks();
}
componentDidUpdate () {
componentDidUpdate() {
this._updateStatusLinks();
}
@ -143,7 +143,7 @@ export default class StatusContent extends React.PureComponent {
return properContent;
}
render () {
render() {
const { status } = this.props;
if (status.get('content').length === 0) {

Wyświetl plik

@ -61,7 +61,7 @@ export default class StatusList extends ImmutablePureComponent {
this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined);
}, 300, { leading: true })
_selectChild (index, align_top) {
_selectChild(index, align_top) {
const container = this.node.node;
const element = container.querySelector(`article:nth-of-type(${index + 1}) .focusable`);
@ -85,7 +85,7 @@ export default class StatusList extends ImmutablePureComponent {
this.node = c;
}
render () {
render() {
const { statusIds, featuredStatusIds, onLoadMore, timelineId, totalQueuedItemsCount, isLoading, isPartial, withGroupAdmin, group, ...other } = this.props;
if (isPartial) {

Wyświetl plik

@ -17,7 +17,7 @@ export default class TimelineQueueButtonHeader extends React.PureComponent {
itemType: 'item',
};
render () {
render() {
const { count, itemType, onClick } = this.props;
const classes = classNames('timeline-queue-header', {

Wyświetl plik

@ -31,7 +31,7 @@ const makeMapStateToProps = () => {
const mapDispatchToProps = (dispatch, { intl }) => ({
onFollow (account) {
onFollow(account) {
if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {
if (unfollowModal) {
dispatch(openModal('CONFIRM', {
@ -47,7 +47,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onBlock (account) {
onBlock(account) {
if (account.getIn(['relationship', 'blocking'])) {
dispatch(unblockAccount(account.get('id')));
} else {
@ -55,7 +55,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onMute (account) {
onMute(account) {
if (account.getIn(['relationship', 'muting'])) {
dispatch(unmuteAccount(account.get('id')));
} else {
@ -64,7 +64,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
},
onMuteNotifications (account, notifications) {
onMuteNotifications(account, notifications) {
dispatch(muteAccount(account.get('id'), notifications));
},
});

Wyświetl plik

@ -26,7 +26,7 @@ export default class TimelineContainer extends React.PureComponent {
locale: PropTypes.string.isRequired,
};
render () {
render() {
const { locale } = this.props;
return (

Wyświetl plik

@ -16,7 +16,7 @@ const makeMapStateToProps = () => {
};
const mapDispatchToProps = (dispatch, { intl }) => ({
onBlockDomain (domain) {
onBlockDomain(domain) {
dispatch(openModal('CONFIRM', {
message: <FormattedMessage id='confirmations.domain_block.message' defaultMessage='Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable.' values={{ domain: <strong>{domain}</strong> }} />,
confirm: intl.formatMessage(messages.blockDomainConfirm),
@ -24,7 +24,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}));
},
onUnblockDomain (domain) {
onUnblockDomain(domain) {
dispatch(unblockDomain(domain));
},
});

Wyświetl plik

@ -51,7 +51,7 @@ class GabSocialMount extends React.PureComponent {
me: PropTypes.string,
};
render () {
render() {
const { me } = this.props;
if (me === null) return null;
@ -82,7 +82,7 @@ export default class GabSocial extends React.PureComponent {
locale: PropTypes.string.isRequired,
};
render () {
render() {
const { locale } = this.props;
return (

Wyświetl plik

@ -8,7 +8,7 @@ const makeMapStateToProps = (state, props) => ({
const mapDispatchToProps = (dispatch) => ({
onHeightChange (key, id, height) {
onHeightChange(key, id, height) {
dispatch(setHeight(key, id, height));
},

Wyświetl plik

@ -46,7 +46,7 @@ export default class MediaContainer extends PureComponent {
this.setState({ media: null, index: null, time: null });
}
render () {
render() {
const { locale, components } = this.props;
return (

Wyświetl plik

@ -57,7 +57,7 @@ const makeMapStateToProps = () => {
const mapDispatchToProps = (dispatch, { intl }) => ({
onReply (status, router) {
onReply(status, router) {
dispatch((_, getState) => {
let state = getState();
if (state.getIn(['compose', 'text']).trim().length !== 0) {
@ -72,7 +72,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
});
},
onModalReblog (status) {
onModalReblog(status) {
if (status.get('reblogged')) {
dispatch(unreblog(status));
} else {
@ -80,7 +80,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onReblog (status, e) {
onReblog(status, e) {
if (e.shiftKey || !boostModal) {
this.onModalReblog(status);
} else {
@ -88,7 +88,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onFavourite (status) {
onFavourite(status) {
if (status.get('favourited')) {
dispatch(unfavourite(status));
} else {
@ -96,7 +96,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onPin (status) {
onPin(status) {
if (status.get('pinned')) {
dispatch(unpin(status));
} else {
@ -104,14 +104,14 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onEmbed (status) {
onEmbed(status) {
dispatch(openModal('EMBED', {
url: status.get('url'),
onError: error => dispatch(showAlertForError(error)),
}));
},
onDelete (status, history, withRedraft = false) {
onDelete(status, history, withRedraft = false) {
if (!deleteModal) {
dispatch(deleteStatus(status.get('id'), history, withRedraft));
} else {
@ -123,23 +123,23 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onDirect (account, router) {
onDirect(account, router) {
dispatch(directCompose(account, router));
},
onMention (account, router) {
onMention(account, router) {
dispatch(mentionCompose(account, router));
},
onOpenMedia (media, index) {
onOpenMedia(media, index) {
dispatch(openModal('MEDIA', { media, index }));
},
onOpenVideo (media, time) {
onOpenVideo(media, time) {
dispatch(openModal('VIDEO', { media, time }));
},
onBlock (status) {
onBlock(status) {
const account = status.get('account');
dispatch(openModal('CONFIRM', {
message: <FormattedMessage id='confirmations.block.message' defaultMessage='Are you sure you want to block {name}?' values={{ name: <strong>@{account.get('acct')}</strong> }} />,
@ -153,15 +153,15 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}));
},
onReport (status) {
onReport(status) {
dispatch(initReport(status.get('account'), status));
},
onMute (account) {
onMute(account) {
dispatch(initMuteModal(account));
},
onMuteConversation (status) {
onMuteConversation(status) {
if (status.get('muted')) {
dispatch(unmuteStatus(status.get('id')));
} else {
@ -169,7 +169,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onToggleHidden (status) {
onToggleHidden(status) {
if (status.get('hidden')) {
dispatch(revealStatus(status.get('id')));
} else {

Wyświetl plik

@ -32,7 +32,7 @@ export default class TimelineContainer extends React.PureComponent {
local: !initialState.settings.known_fediverse,
};
render () {
render() {
const { locale, hashtag, local } = this.props;
let timeline;

Wyświetl plik

@ -83,11 +83,11 @@ class Header extends ImmutablePureComponent {
return !location.pathname.match(/\/(followers|following|favorites|pins)\/?$/);
}
componentWillMount () {
componentWillMount() {
window.addEventListener('resize', this.handleResize, { passive: true });
}
componentWillUnmount () {
componentWillUnmount() {
window.removeEventListener('resize', this.handleResize);
}
@ -213,7 +213,7 @@ class Header extends ImmutablePureComponent {
return actionBtn;
};
render () {
render() {
const { account, intl, username, me } = this.props;
const { isSmallScreen } = this.state;

Wyświetl plik

@ -21,19 +21,19 @@ export default class MediaItem extends ImmutablePureComponent {
loaded: false,
};
componentDidMount () {
componentDidMount() {
if (this.props.attachment.get('blurhash')) {
this._decode();
}
}
componentDidUpdate (prevProps) {
componentDidUpdate(prevProps) {
if (prevProps.attachment.get('blurhash') !== this.props.attachment.get('blurhash') && this.props.attachment.get('blurhash')) {
this._decode();
}
}
_decode () {
_decode() {
const hash = this.props.attachment.get('blurhash');
const pixels = decode(hash, 32, 32);
@ -66,7 +66,7 @@ export default class MediaItem extends ImmutablePureComponent {
}
}
hoverToPlay () {
hoverToPlay() {
return !autoPlayGif && ['gifv', 'video'].indexOf(this.props.attachment.get('type')) !== -1;
}
@ -82,7 +82,7 @@ export default class MediaItem extends ImmutablePureComponent {
}
}
render () {
render() {
const { attachment, displayWidth } = this.props;
const { visible, loaded } = this.state;

Wyświetl plik

@ -60,7 +60,7 @@ class LoadMoreMedia extends ImmutablePureComponent {
this.props.onLoadMore(this.props.maxId);
}
render () {
render() {
return (
<LoadMore
disabled={this.props.disabled}
@ -88,7 +88,7 @@ class AccountGallery extends ImmutablePureComponent {
width: 323,
};
componentDidMount () {
componentDidMount() {
const { params: { username }, accountId } = this.props;
if (accountId && accountId !== -1) {
@ -99,7 +99,7 @@ class AccountGallery extends ImmutablePureComponent {
}
}
componentWillReceiveProps (nextProps) {
componentWillReceiveProps(nextProps) {
if (nextProps.accountId && nextProps.accountId !== -1 && (nextProps.accountId !== this.props.accountId && nextProps.accountId)) {
this.props.dispatch(fetchAccount(nextProps.params.accountId));
this.props.dispatch(expandAccountMediaTimeline(nextProps.accountId));
@ -149,7 +149,7 @@ class AccountGallery extends ImmutablePureComponent {
}
}
render () {
render() {
const { attachments, isLoading, hasMore, isAccount, accountId, unavailable, accountUsername } = this.props;
const { width } = this.state;

Wyświetl plik

@ -81,7 +81,7 @@ export default class Header extends ImmutablePureComponent {
this.props.onAddToList(this.props.account);
}
render () {
render() {
const { account, identity_proofs } = this.props;
const moved = (account) ? account.get('moved') : false;

Wyświetl plik

@ -19,7 +19,7 @@ export default class MovedNote extends ImmutablePureComponent {
to: ImmutablePropTypes.map.isRequired,
};
render () {
render() {
const { from, to } = this.props;
const displayNameHtml = { __html: from.get('display_name_html') };

Wyświetl plik

@ -44,7 +44,7 @@ const makeMapStateToProps = () => {
const mapDispatchToProps = (dispatch, { intl }) => ({
onFollow (account) {
onFollow(account) {
if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {
if (unfollowModal) {
dispatch(openModal('CONFIRM', {
@ -60,7 +60,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onBlock (account) {
onBlock(account) {
if (account.getIn(['relationship', 'blocking'])) {
dispatch(unblockAccount(account.get('id')));
} else {
@ -77,15 +77,15 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onMention (account, router) {
onMention(account, router) {
dispatch(mentionCompose(account, router));
},
onDirect (account, router) {
onDirect(account, router) {
dispatch(directCompose(account, router));
},
onReblogToggle (account) {
onReblogToggle(account) {
if (account.getIn(['relationship', 'showing_reblogs'])) {
dispatch(followAccount(account.get('id'), false));
} else {
@ -93,7 +93,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onEndorseToggle (account) {
onEndorseToggle(account) {
if (account.getIn(['relationship', 'endorsed'])) {
dispatch(unpinAccount(account.get('id')));
} else {
@ -101,11 +101,11 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onReport (account) {
onReport(account) {
dispatch(initReport(account));
},
onMute (account) {
onMute(account) {
if (account.getIn(['relationship', 'muting'])) {
dispatch(unmuteAccount(account.get('id')));
} else {
@ -113,7 +113,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
onBlockDomain (domain) {
onBlockDomain(domain) {
dispatch(openModal('CONFIRM', {
message: <FormattedMessage id='confirmations.domain_block.message' defaultMessage='Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable. You will not see content from that domain in any public timelines or your notifications. Your followers from that domain will be removed.' values={{ domain: <strong>{domain}</strong> }} />,
confirm: intl.formatMessage(messages.blockDomainConfirm),
@ -121,7 +121,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}));
},
onUnblockDomain (domain) {
onUnblockDomain(domain) {
dispatch(unblockDomain(domain));
},

Wyświetl plik

@ -66,7 +66,7 @@ class AccountTimeline extends ImmutablePureComponent {
unavailable: PropTypes.bool,
};
componentWillMount () {
componentWillMount() {
const { params: { username }, accountId, withReplies, me } = this.props;
if (accountId && accountId !== -1) {
@ -83,7 +83,7 @@ class AccountTimeline extends ImmutablePureComponent {
}
}
componentWillReceiveProps (nextProps) {
componentWillReceiveProps(nextProps) {
const { me } = nextProps;
if (nextProps.accountId && nextProps.accountId !== -1 && (nextProps.accountId !== this.props.accountId && nextProps.accountId) || nextProps.withReplies !== this.props.withReplies) {
this.props.dispatch(fetchAccount(nextProps.accountId));
@ -103,7 +103,7 @@ class AccountTimeline extends ImmutablePureComponent {
}
}
render () {
render() {
const { statusIds, featuredStatusIds, isLoading, hasMore, isAccount, accountId, unavailable, accountUsername } = this.props;
if (!isAccount && accountId !== -1) {

Wyświetl plik

@ -32,7 +32,7 @@ class Blocks extends ImmutablePureComponent {
intl: PropTypes.object.isRequired,
};
componentWillMount () {
componentWillMount() {
this.props.dispatch(fetchBlocks());
}
@ -40,7 +40,7 @@ class Blocks extends ImmutablePureComponent {
this.props.dispatch(expandBlocks());
}, 300, { leading: true });
render () {
render() {
const { intl, accountIds, hasMore } = this.props;
if (!accountIds) {

Wyświetl plik

@ -13,7 +13,7 @@ class ColumnSettings extends React.PureComponent {
intl: PropTypes.object.isRequired,
};
render () {
render() {
const { settings, onChange } = this.props;
return (

Wyświetl plik

@ -8,7 +8,7 @@ const mapStateToProps = state => ({
const mapDispatchToProps = (dispatch) => {
return {
onChange (key, checked) {
onChange(key, checked) {
dispatch(changeSetting(['community', ...key], checked));
},
};

Wyświetl plik

@ -41,13 +41,13 @@ class CommunityTimeline extends React.PureComponent {
timelineId: PropTypes.string,
};
componentDidMount () {
componentDidMount() {
const { dispatch, onlyMedia } = this.props;
dispatch(expandCommunityTimeline({ onlyMedia }));
this.disconnect = dispatch(connectCommunityStream({ onlyMedia }));
}
componentDidUpdate (prevProps) {
componentDidUpdate(prevProps) {
if (prevProps.onlyMedia !== this.props.onlyMedia) {
const { dispatch, onlyMedia } = this.props;
@ -57,7 +57,7 @@ class CommunityTimeline extends React.PureComponent {
}
}
componentWillUnmount () {
componentWillUnmount() {
if (this.disconnect) {
this.disconnect();
this.disconnect = null;
@ -69,7 +69,7 @@ class CommunityTimeline extends React.PureComponent {
dispatch(expandCommunityTimeline({ maxId, onlyMedia }));
}
render () {
render() {
const { intl, hasUnread, onlyMedia, timelineId } = this.props;
return (

Wyświetl plik

@ -43,7 +43,7 @@ class ActionBar extends React.PureComponent {
this.props.onOpenHotkeys();
}
render () {
render() {
const { intl, onClickLogOut } = this.props;
const size = this.props.size || 16;

Wyświetl plik

@ -10,7 +10,7 @@ export default class AutosuggestAccount extends ImmutablePureComponent {
account: ImmutablePropTypes.map.isRequired,
};
render () {
render() {
const { account } = this.props;
return (

Wyświetl plik

@ -9,7 +9,7 @@ export default class CharacterCounter extends React.PureComponent {
max: PropTypes.number.isRequired,
};
checkRemainingText (diff) {
checkRemainingText(diff) {
if (diff < 0) {
return <span className='character-counter character-counter--over'>{diff}</span>;
}
@ -17,7 +17,7 @@ export default class CharacterCounter extends React.PureComponent {
return <span className='character-counter'>{diff}</span>;
}
render () {
render() {
const diff = this.props.max - length(this.props.text);
return this.checkRemainingText(diff);
}

Wyświetl plik

@ -158,7 +158,7 @@ class ComposeForm extends ImmutablePureComponent {
document.removeEventListener('click', this.handleClick, false);
}
componentDidUpdate (prevProps) {
componentDidUpdate(prevProps) {
if (!this.autosuggestTextarea) return;
// This statement does several things:
@ -205,7 +205,7 @@ class ComposeForm extends ImmutablePureComponent {
this.props.onPickEmoji(position, data, needsSpace);
}
render () {
render() {
const { intl, onPaste, showSearch, anyMedia, shouldCondense, autoFocus, isModalOpen, maxTootChars } = this.props;
const condensed = shouldCondense && !this.props.text && !this.state.composeFocused;
const disabled = this.props.isSubmitting;

Wyświetl plik

@ -56,7 +56,7 @@ class ModifierPickerMenu extends React.PureComponent {
this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1);
}
componentWillReceiveProps (nextProps) {
componentWillReceiveProps(nextProps) {
if (nextProps.active) {
this.attachListeners();
} else {
@ -64,7 +64,7 @@ class ModifierPickerMenu extends React.PureComponent {
}
}
componentWillUnmount () {
componentWillUnmount() {
this.removeListeners();
}
@ -74,12 +74,12 @@ class ModifierPickerMenu extends React.PureComponent {
}
}
attachListeners () {
attachListeners() {
document.addEventListener('click', this.handleDocumentClick, false);
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);
}
removeListeners () {
removeListeners() {
document.removeEventListener('click', this.handleDocumentClick, false);
document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);
}
@ -88,7 +88,7 @@ class ModifierPickerMenu extends React.PureComponent {
this.node = c;
}
render () {
render() {
const { active } = this.props;
return (
@ -128,7 +128,7 @@ class ModifierPicker extends React.PureComponent {
this.props.onClose();
}
render () {
render() {
const { active, modifier } = this.props;
return (
@ -176,12 +176,12 @@ class EmojiPickerMenu extends React.PureComponent {
}
}
componentDidMount () {
componentDidMount() {
document.addEventListener('click', this.handleDocumentClick, false);
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);
}
componentWillUnmount () {
componentWillUnmount() {
document.removeEventListener('click', this.handleDocumentClick, false);
document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);
}
@ -233,7 +233,7 @@ class EmojiPickerMenu extends React.PureComponent {
this.props.onSkinTone(modifier);
}
render () {
render() {
const { loading, style, intl, custom_emojis, skinTone, frequentlyUsedEmojis } = this.props;
if (loading) {
@ -347,7 +347,7 @@ class EmojiPickerDropdown extends React.PureComponent {
return this.target;
}
render () {
render() {
const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis } = this.props;
const title = intl.formatMessage(messages.emoji);
const { active, loading, placement } = this.state;

Wyświetl plik

@ -15,7 +15,7 @@ export default class NavigationBar extends ImmutablePureComponent {
onClose: PropTypes.func,
};
render () {
render() {
return (
<div className='navigation-bar'>
<Permalink href={this.props.account.get('url')} to={`/@${this.props.account.get('acct')}`}>

Wyświetl plik

@ -29,7 +29,7 @@ class PollButton extends React.PureComponent {
this.props.onClick();
}
render () {
render() {
const { intl, active, unavailable, disabled } = this.props;
if (unavailable) {

Wyświetl plik

@ -64,7 +64,7 @@ class Option extends React.PureComponent {
this.props.onSuggestionSelected(tokenStart, token, value, ['poll', 'options', this.props.index]);
}
render () {
render() {
const { isPollMultiple, title, index, intl } = this.props;
return (
@ -130,7 +130,7 @@ class PollForm extends ImmutablePureComponent {
this.props.onChangeSettings(this.props.expiresIn, !this.props.isMultiple);
};
render () {
render() {
const { options, expiresIn, isMultiple, onChangeOption, onRemoveOption, intl, ...other } = this.props;
if (!options) {

Wyświetl plik

@ -99,14 +99,14 @@ class PrivacyDropdownMenu extends React.PureComponent {
this.props.onChange(value);
}
componentDidMount () {
componentDidMount() {
document.addEventListener('click', this.handleDocumentClick, false);
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);
if (this.focusedItem) this.focusedItem.focus();
this.setState({ mounted: true });
}
componentWillUnmount () {
componentWillUnmount() {
document.removeEventListener('click', this.handleDocumentClick, false);
document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);
}
@ -119,7 +119,7 @@ class PrivacyDropdownMenu extends React.PureComponent {
this.focusedItem = c;
}
render () {
render() {
const { mounted } = this.state;
const { style, items, placement, value } = this.props;
@ -210,7 +210,7 @@ class PrivacyDropdown extends React.PureComponent {
this.props.onChange(value);
}
componentWillMount () {
componentWillMount() {
const { intl: { formatMessage } } = this.props;
this.options = [
@ -221,7 +221,7 @@ class PrivacyDropdown extends React.PureComponent {
];
}
render () {
render() {
const { value, intl } = this.props;
const { open, placement } = this.state;

Wyświetl plik

@ -30,7 +30,7 @@ class ReplyIndicator extends ImmutablePureComponent {
this.props.onCancel();
}
render () {
render() {
const { status, intl } = this.props;
if (!status) {

Wyświetl plik

@ -17,7 +17,7 @@ class SearchPopout extends React.PureComponent {
style: PropTypes.object,
};
render () {
render() {
const { style } = this.props;
const extraInformation = searchEnabled ? <FormattedMessage id='search_popout.tips.full_text' defaultMessage='Simple text returns posts you have written, favorited, reposted, or have been mentioned in, as well as matching usernames, display names, and hashtags.' /> : <FormattedMessage id='search_popout.tips.text' defaultMessage='Simple text returns matching display names, usernames and hashtags' />;
return (
@ -99,7 +99,7 @@ class Search extends React.PureComponent {
this.setState({ expanded: false });
}
render () {
render() {
const { intl, value, submitted } = this.props;
const { expanded } = this.state;
const hasValue = value.length > 0 || submitted;

Wyświetl plik

@ -22,7 +22,7 @@ class SearchResults extends ImmutablePureComponent {
isSmallScreen: (window.innerWidth <= 895),
}
render () {
render() {
const { results } = this.props;
const { isSmallScreen } = this.state;

Wyświetl plik

@ -16,7 +16,7 @@ export default class TextIconButton extends React.PureComponent {
this.props.onClick();
}
render () {
render() {
const { label, title, active, ariaControls } = this.props;
return (

Wyświetl plik

@ -86,7 +86,7 @@ class Upload extends ImmutablePureComponent {
}
}
render () {
render() {
const { intl, media } = this.props;
const active = this.state.hovered || this.state.focused;
const description = this.state.dirtyDescription || (this.state.dirtyDescription !== '' && media.get('description')) || '';

Wyświetl plik

@ -51,7 +51,7 @@ class UploadButton extends ImmutablePureComponent {
this.fileElement = c;
}
render () {
render() {
const { intl, resetFileKey, unavailable, disabled, acceptContentTypes } = this.props;
if (unavailable) {

Wyświetl plik

@ -12,7 +12,7 @@ export default class UploadForm extends ImmutablePureComponent {
mediaIds: ImmutablePropTypes.list.isRequired,
};
render () {
render() {
const { mediaIds } = this.props;
const classes = classNames('compose-form__uploads-wrapper', {
'contains-media': mediaIds.size !== 0,

Wyświetl plik

@ -12,7 +12,7 @@ export default class UploadProgress extends React.PureComponent {
progress: PropTypes.number,
};
render () {
render() {
const { active, progress } = this.props;
if (!active) {

Wyświetl plik

@ -9,7 +9,7 @@ export default class Warning extends React.PureComponent {
message: PropTypes.node.isRequired,
};
render () {
render() {
const { message } = this.props;
return (

Wyświetl plik

@ -30,35 +30,35 @@ const mapStateToProps = state => ({
const mapDispatchToProps = (dispatch) => ({
onChange (text) {
onChange(text) {
dispatch(changeCompose(text));
},
onSubmit (router, group) {
onSubmit(router, group) {
dispatch(submitCompose(router, group));
},
onClearSuggestions () {
onClearSuggestions() {
dispatch(clearComposeSuggestions());
},
onFetchSuggestions (token) {
onFetchSuggestions(token) {
dispatch(fetchComposeSuggestions(token));
},
onSuggestionSelected (position, token, suggestion, path) {
onSuggestionSelected(position, token, suggestion, path) {
dispatch(selectComposeSuggestion(position, token, suggestion, path));
},
onChangeSpoilerText (checked) {
onChangeSpoilerText(checked) {
dispatch(changeComposeSpoilerText(checked));
},
onPaste (files) {
onPaste(files) {
dispatch(uploadCompose(files));
},
onPickEmoji (position, data, needsSpace) {
onPickEmoji(position, data, needsSpace) {
dispatch(insertEmojiCompose(position, data, needsSpace));
},

Wyświetl plik

@ -53,7 +53,7 @@ const getCustomEmojis = createSelector([
if (aShort < bShort) {
return -1;
} else if (aShort > bShort ) {
} else if (aShort > bShort) {
return 1;
} else {
return 0;

Wyświetl plik

@ -9,7 +9,7 @@ const mapStateToProps = state => ({
const mapDispatchToProps = dispatch => ({
onClick () {
onClick() {
dispatch((_, getState) => {
if (getState().getIn(['compose', 'poll'])) {
dispatch(removePoll());

Wyświetl plik

@ -31,15 +31,15 @@ const mapDispatchToProps = dispatch => ({
dispatch(changePollSettings(expiresIn, isMultiple));
},
onClearSuggestions () {
onClearSuggestions() {
dispatch(clearComposeSuggestions());
},
onFetchSuggestions (token) {
onFetchSuggestions(token) {
dispatch(fetchComposeSuggestions(token));
},
onSuggestionSelected (position, token, accountId, path) {
onSuggestionSelected(position, token, accountId, path) {
dispatch(selectComposeSuggestion(position, token, accountId, path));
},

Wyświetl plik

@ -11,7 +11,7 @@ const mapStateToProps = state => ({
const mapDispatchToProps = dispatch => ({
onChange (value) {
onChange(value) {
dispatch(changeComposeVisibility(value));
},

Wyświetl plik

@ -15,7 +15,7 @@ const makeMapStateToProps = () => {
const mapDispatchToProps = dispatch => ({
onCancel () {
onCancel() {
dispatch(cancelReplyCompose());
},

Wyświetl plik

@ -14,19 +14,19 @@ const mapStateToProps = state => ({
const mapDispatchToProps = dispatch => ({
onChange (value) {
onChange(value) {
dispatch(changeSearch(value));
},
onClear () {
onClear() {
dispatch(clearSearch());
},
onSubmit () {
onSubmit() {
dispatch(submitSearch());
},
onShow () {
onShow() {
dispatch(showSearch());
},

Wyświetl plik

@ -17,7 +17,7 @@ const mapStateToProps = state => ({
const mapDispatchToProps = dispatch => ({
onClick () {
onClick() {
dispatch(changeComposeSensitivity());
},
@ -32,7 +32,7 @@ class SensitiveButton extends React.PureComponent {
intl: PropTypes.object.isRequired,
};
render () {
render() {
const { active, disabled, onClick, intl } = this.props;
return (

Wyświetl plik

@ -17,7 +17,7 @@ const mapStateToProps = (state, { intl }) => ({
const mapDispatchToProps = dispatch => ({
onClick () {
onClick() {
dispatch(changeComposeSpoilerness());
},

Wyświetl plik

@ -10,7 +10,7 @@ const mapStateToProps = state => ({
const mapDispatchToProps = dispatch => ({
onSelectFile (files) {
onSelectFile(files) {
dispatch(uploadCompose(files));
},

Wyświetl plik

@ -22,7 +22,7 @@ const mapDispatchToProps = dispatch => ({
dispatch(openModal('FOCAL_POINT', { id }));
},
onSubmit (router) {
onSubmit(router) {
dispatch(submitCompose(router));
},

Wyświetl plik

@ -43,7 +43,7 @@ class Compose extends React.PureComponent {
intl: PropTypes.object.isRequired,
};
componentDidMount () {
componentDidMount() {
const { isSearchPage } = this.props;
if (!isSearchPage) {
@ -51,7 +51,7 @@ class Compose extends React.PureComponent {
}
}
componentWillUnmount () {
componentWillUnmount() {
const { isSearchPage } = this.props;
if (!isSearchPage) {
@ -67,7 +67,7 @@ class Compose extends React.PureComponent {
this.props.dispatch(changeComposing(false));
}
render () {
render() {
const { multiColumn, showSearch, isSearchPage, intl } = this.props;
let header = '';

Wyświetl plik

@ -43,7 +43,7 @@ export default class Conversation extends ImmutablePureComponent {
this.props.onMoveDown(this.props.conversationId);
}
render () {
render() {
const { accounts, lastStatusId, unread } = this.props;
if (lastStatusId === null) {

Wyświetl plik

@ -27,7 +27,7 @@ export default class ConversationsList extends ImmutablePureComponent {
this._selectChild(elementIndex, false);
}
_selectChild (index, align_top) {
_selectChild(index, align_top) {
const container = this.node.node;
const element = container.querySelector(`article:nth-of-type(${index + 1}) .focusable`);
@ -53,7 +53,7 @@ export default class ConversationsList extends ImmutablePureComponent {
}
}, 300, { leading: true })
render () {
render() {
const { conversations, onLoadMore, ...other } = this.props;
return (

Wyświetl plik

@ -22,7 +22,7 @@ class DirectTimeline extends React.PureComponent {
hasUnread: PropTypes.bool,
};
componentDidMount () {
componentDidMount() {
const { dispatch } = this.props;
dispatch(mountConversations());
@ -30,7 +30,7 @@ class DirectTimeline extends React.PureComponent {
this.disconnect = dispatch(connectDirectStream());
}
componentWillUnmount () {
componentWillUnmount() {
this.props.dispatch(unmountConversations());
if (this.disconnect) {
@ -43,7 +43,7 @@ class DirectTimeline extends React.PureComponent {
this.props.dispatch(expandConversations({ maxId }));
}
render () {
render() {
const { intl, hasUnread } = this.props;
return (

Wyświetl plik

@ -33,7 +33,7 @@ class Blocks extends ImmutablePureComponent {
intl: PropTypes.object.isRequired,
};
componentWillMount () {
componentWillMount() {
this.props.dispatch(fetchDomainBlocks());
}
@ -41,7 +41,7 @@ class Blocks extends ImmutablePureComponent {
this.props.dispatch(expandDomainBlocks());
}, 300, { leading: true });
render () {
render() {
const { intl, domains, hasMore } = this.props;
if (!domains) {

Wyświetl plik

@ -32,7 +32,7 @@ const buildSearch = (data) => {
const _String = String;
const stringFromCodePoint = _String.fromCodePoint || function () {
const stringFromCodePoint = _String.fromCodePoint || function() {
let MAX_SIZE = 0x4000;
let codeUnits = [];
let highSurrogate;

Wyświetl plik

@ -33,7 +33,7 @@ class Favourites extends ImmutablePureComponent {
isMyAccount: PropTypes.bool.isRequired,
};
componentWillMount () {
componentWillMount() {
this.props.dispatch(fetchFavouritedStatuses());
}
@ -41,7 +41,7 @@ class Favourites extends ImmutablePureComponent {
this.props.dispatch(expandFavouritedStatuses());
}, 300, { leading: true })
render () {
render() {
const { statusIds, hasMore, isLoading, isMyAccount } = this.props;
if (!isMyAccount) {

Wyświetl plik

@ -23,17 +23,17 @@ class Favourites extends ImmutablePureComponent {
accountIds: ImmutablePropTypes.list,
};
componentWillMount () {
componentWillMount() {
this.props.dispatch(fetchFavourites(this.props.params.statusId));
}
componentWillReceiveProps (nextProps) {
componentWillReceiveProps(nextProps) {
if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {
this.props.dispatch(fetchFavourites(nextProps.params.statusId));
}
}
render () {
render() {
const { accountIds } = this.props;
if (!accountIds) {

Wyświetl plik

@ -23,7 +23,7 @@ class AccountAuthorize extends ImmutablePureComponent {
intl: PropTypes.object.isRequired,
};
render () {
render() {
const { intl, account, onAuthorize, onReject } = this.props;
const content = { __html: account.get('note_emojified') };

Some files were not shown because too many files have changed in this diff Show More