Skip to content

Commit

Permalink
revert code format diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
toufali committed Feb 27, 2024
1 parent 50bc576 commit e759917
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 150 deletions.
4 changes: 2 additions & 2 deletions app/javascript/mastodon/components/column_back_button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createPortal } from 'react-dom';

import { FormattedMessage } from 'react-intl';

import { Icon } from 'mastodon/components/icon';
import { Icon } from 'mastodon/components/icon';

export default class ColumnBackButton extends PureComponent {

Expand All @@ -30,7 +30,7 @@ export default class ColumnBackButton extends PureComponent {
}
};

render() {
render () {
const { multiColumn } = this.props;

const component = (
Expand Down
57 changes: 28 additions & 29 deletions app/javascript/mastodon/containers/status_container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const makeMapStateToProps = () => {

const mapDispatchToProps = (dispatch, { intl, contextType }) => ({

onReply(status, router) {
onReply (status, router) {
dispatch((_, getState) => {
let state = getState();

Expand All @@ -87,56 +87,55 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
modalProps: {
message: intl.formatMessage(messages.replyMessage),
confirm: intl.formatMessage(messages.replyConfirm),
onConfirm: () => dispatch(replyCompose(status, router))
},
onConfirm: () => dispatch(replyCompose(status, router)) },
}));
} else {
dispatch(replyCompose(status, router));
}
});
},

onModalReblog(status, privacy) {
onModalReblog (status, privacy) {
if (status.get('reblogged')) {
dispatch(unreblog(status));
} else {
dispatch(reblog(status, privacy));
}
},

onReblog(status, e) {
onReblog (status, e) {
if ((e && e.shiftKey) || !boostModal) {
this.onModalReblog(status);
} else {
dispatch(initBoostModal({ status, onReblog: this.onModalReblog }));
}
},

onFavourite(status) {
onFavourite (status) {
if (status.get('favourited')) {
dispatch(unfavourite(status));
} else {
dispatch(favourite(status));
}
},

onBookmark(status) {
onBookmark (status) {
if (status.get('bookmarked')) {
dispatch(unbookmark(status));
} else {
dispatch(bookmark(status));
}
},

onPin(status) {
onPin (status) {
if (status.get('pinned')) {
dispatch(unpin(status));
} else {
dispatch(pin(status));
}
},

onEmbed(status) {
onEmbed (status) {
dispatch(openModal({
modalType: 'EMBED',
modalProps: {
Expand All @@ -146,7 +145,7 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
}));
},

onDelete(status, history, withRedraft = false) {
onDelete (status, history, withRedraft = false) {
if (!deleteModal) {
dispatch(deleteStatus(status.get('id'), history, withRedraft));
} else {
Expand All @@ -161,7 +160,7 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
}
},

onEdit(status, history) {
onEdit (status, history) {
dispatch((_, getState) => {
let state = getState();
if (state.getIn(['compose', 'text']).trim().length !== 0) {
Expand All @@ -179,82 +178,82 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
});
},

onTranslate(status) {
onTranslate (status) {
if (status.get('translation')) {
dispatch(undoStatusTranslation(status.get('id'), status.get('poll')));
} else {
dispatch(translateStatus(status.get('id')));
}
},

onDirect(account, router) {
onDirect (account, router) {
dispatch(directCompose(account, router));
},

onMention(account, router) {
onMention (account, router) {
dispatch(mentionCompose(account, router));
},

onOpenMedia(statusId, media, index, lang) {
onOpenMedia (statusId, media, index, lang) {
dispatch(openModal({
modalType: 'MEDIA',
modalProps: { statusId, media, index, lang },
}));
},

onOpenVideo(statusId, media, lang, options) {
onOpenVideo (statusId, media, lang, options) {
dispatch(openModal({
modalType: 'VIDEO',
modalProps: { statusId, media, lang, options },
}));
},

onBlock(status) {
onBlock (status) {
const account = status.get('account');
dispatch(initBlockModal(account));
},

onUnblock(account) {
onUnblock (account) {
dispatch(unblockAccount(account.get('id')));
},

onReport(status) {
onReport (status) {
dispatch(initReport(status.get('account'), status));
},

onAddFilter(status) {
onAddFilter (status) {
dispatch(initAddFilter(status, { contextType }));
},

onMute(account) {
onMute (account) {
dispatch(initMuteModal(account));
},

onUnmute(account) {
onUnmute (account) {
dispatch(unmuteAccount(account.get('id')));
},

onMuteConversation(status) {
onMuteConversation (status) {
if (status.get('muted')) {
dispatch(unmuteStatus(status.get('id')));
} else {
dispatch(muteStatus(status.get('id')));
}
},

onToggleHidden(status) {
onToggleHidden (status) {
if (status.get('hidden')) {
dispatch(revealStatus(status.get('id')));
} else {
dispatch(hideStatus(status.get('id')));
}
},

onToggleCollapsed(status, isCollapsed) {
onToggleCollapsed (status, isCollapsed) {
dispatch(toggleStatusCollapse(status.get('id'), isCollapsed));
},

onBlockDomain(domain) {
onBlockDomain (domain) {
dispatch(openModal({
modalType: 'CONFIRM',
modalProps: {
Expand All @@ -265,15 +264,15 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
}));
},

onUnblockDomain(domain) {
onUnblockDomain (domain) {
dispatch(unblockDomain(domain));
},

deployPictureInPicture(status, type, mediaProps) {
deployPictureInPicture (status, type, mediaProps) {
dispatch(deployPictureInPicture(status.get('id'), status.getIn(['account', 'id']), type, mediaProps));
},

onInteractionModal(type, status) {
onInteractionModal (type, status) {
dispatch(openModal({
modalType: 'INTERACTION',
modalProps: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LanguageDropdownMenu extends PureComponent {
}
};

componentDidMount() {
componentDidMount () {
document.addEventListener('click', this.handleDocumentClick, { capture: true });
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);

Expand All @@ -62,7 +62,7 @@ class LanguageDropdownMenu extends PureComponent {
});
}

componentWillUnmount() {
componentWillUnmount () {
document.removeEventListener('click', this.handleDocumentClick, { capture: true });
document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);
}
Expand All @@ -79,7 +79,7 @@ class LanguageDropdownMenu extends PureComponent {
this.setState({ searchValue: target.value });
};

search() {
search () {
const { languages, value, frequentlyUsedLanguages } = this.props;
const { searchValue } = this.state;

Expand Down Expand Up @@ -109,7 +109,7 @@ class LanguageDropdownMenu extends PureComponent {
}).map(result => result.obj);
}

frequentlyUsed() {
frequentlyUsed () {
const { languages, value } = this.props;
const current = languages.find(lang => lang[0] === value);
const results = [];
Expand All @@ -136,32 +136,32 @@ class LanguageDropdownMenu extends PureComponent {

let element = null;

switch (e.key) {
case 'Escape':
onClose();
break;
case 'Enter':
this.handleClick(e);
break;
case 'ArrowDown':
element = this.listNode.childNodes[index + 1] || this.listNode.firstChild;
break;
case 'ArrowUp':
switch(e.key) {
case 'Escape':
onClose();
break;
case 'Enter':
this.handleClick(e);
break;
case 'ArrowDown':
element = this.listNode.childNodes[index + 1] || this.listNode.firstChild;
break;
case 'ArrowUp':
element = this.listNode.childNodes[index - 1] || this.listNode.lastChild;
break;
case 'Tab':
if (e.shiftKey) {
element = this.listNode.childNodes[index - 1] || this.listNode.lastChild;
break;
case 'Tab':
if (e.shiftKey) {
element = this.listNode.childNodes[index - 1] || this.listNode.lastChild;
} else {
element = this.listNode.childNodes[index + 1] || this.listNode.firstChild;
}
break;
case 'Home':
element = this.listNode.firstChild;
break;
case 'End':
element = this.listNode.lastChild;
break;
} else {
element = this.listNode.childNodes[index + 1] || this.listNode.firstChild;
}
break;
case 'Home':
element = this.listNode.firstChild;
break;
case 'End':
element = this.listNode.lastChild;
break;
}

if (element) {
Expand All @@ -177,33 +177,33 @@ class LanguageDropdownMenu extends PureComponent {

let element = null;

switch (e.key) {
case 'Tab':
case 'ArrowDown':
element = this.listNode.firstChild;
switch(e.key) {
case 'Tab':
case 'ArrowDown':
element = this.listNode.firstChild;

if (element) {
element.focus();
e.preventDefault();
e.stopPropagation();
}
if (element) {
element.focus();
e.preventDefault();
e.stopPropagation();
}

break;
case 'Enter':
element = this.listNode.firstChild;
break;
case 'Enter':
element = this.listNode.firstChild;

if (element) {
onChange(element.getAttribute('data-index'));
onClose();
}
break;
case 'Escape':
if (searchValue !== '') {
e.preventDefault();
this.handleClear();
}
if (element) {
onChange(element.getAttribute('data-index'));
onClose();
}
break;
case 'Escape':
if (searchValue !== '') {
e.preventDefault();
this.handleClear();
}

break;
break;
}
};

Expand All @@ -221,7 +221,7 @@ class LanguageDropdownMenu extends PureComponent {
);
};

render() {
render () {
const { intl } = this.props;
const { searchValue } = this.state;
const isSearching = searchValue !== '';
Expand Down Expand Up @@ -294,7 +294,7 @@ class LanguageDropdown extends PureComponent {
this.setState({ placement: state.placement });
};

render() {
render () {
const { value, intl, frequentlyUsedLanguages } = this.props;
const { open, placement } = this.state;

Expand Down
Loading

0 comments on commit e759917

Please sign in to comment.