From 9abc8075917f838e54fd019236d88a0e969eae83 Mon Sep 17 00:00:00 2001 From: nachtjasmin Date: Tue, 26 Dec 2023 23:18:16 +0100 Subject: [PATCH] Smaller formatting fixes --- .../components/federation_dropdown.jsx | 80 +++++++++---------- .../features/ui/components/column_link.jsx | 2 +- .../features/ui/components/link_footer.jsx | 6 +- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/app/javascript/mastodon/features/compose/components/federation_dropdown.jsx b/app/javascript/mastodon/features/compose/components/federation_dropdown.jsx index 69f6c6a3f..94e13e3a2 100644 --- a/app/javascript/mastodon/features/compose/components/federation_dropdown.jsx +++ b/app/javascript/mastodon/features/compose/components/federation_dropdown.jsx @@ -8,7 +8,7 @@ import classNames from 'classnames'; import { supportsPassiveEvents } from 'detect-passive-events'; import Overlay from 'react-overlays/Overlay'; -import { Icon } from 'mastodon/components/icon'; +import { Icon } from 'mastodon/components/icon'; import { IconButton } from '../../../components/icon_button'; @@ -47,32 +47,32 @@ class FederationDropdownMenu extends PureComponent { }); let element = null; - switch(e.key) { - case 'Escape': - this.props.onClose(); - break; - case 'Enter': - this.handleClick(e); - break; - case 'ArrowDown': - element = this.node.childNodes[index + 1] || this.node.firstChild; - break; - case 'ArrowUp': - element = this.node.childNodes[index - 1] || this.node.lastChild; - break; - case 'Tab': - if (e.shiftKey) { - element = this.node.childNodes[index - 1] || this.node.lastChild; - } else { + switch (e.key) { + case 'Escape': + this.props.onClose(); + break; + case 'Enter': + this.handleClick(e); + break; + case 'ArrowDown': element = this.node.childNodes[index + 1] || this.node.firstChild; - } - break; - case 'Home': - element = this.node.firstChild; - break; - case 'End': - element = this.node.lastChild; - break; + break; + case 'ArrowUp': + element = this.node.childNodes[index - 1] || this.node.lastChild; + break; + case 'Tab': + if (e.shiftKey) { + element = this.node.childNodes[index - 1] || this.node.lastChild; + } else { + element = this.node.childNodes[index + 1] || this.node.firstChild; + } + break; + case 'Home': + element = this.node.firstChild; + break; + case 'End': + element = this.node.lastChild; + break; } if (element) { @@ -92,13 +92,13 @@ class FederationDropdownMenu extends PureComponent { this.props.onChange(value); }; - componentDidMount () { + componentDidMount() { document.addEventListener('click', this.handleDocumentClick, { capture: true }); document.addEventListener('touchend', this.handleDocumentClick, listenerOptions); if (this.focusedItem) this.focusedItem.focus({ preventScroll: true }); } - componentWillUnmount () { + componentWillUnmount() { document.removeEventListener('click', this.handleDocumentClick, { capture: true }); document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions); } @@ -111,7 +111,7 @@ class FederationDropdownMenu extends PureComponent { this.focusedItem = c; }; - render () { + render() { const { style, items, value } = this.props; return ( @@ -181,10 +181,10 @@ class FederationDropdown extends PureComponent { }; handleKeyDown = e => { - switch(e.key) { - case 'Escape': - this.handleClose(); - break; + switch (e.key) { + case 'Escape': + this.handleClose(); + break; } }; @@ -195,11 +195,11 @@ class FederationDropdown extends PureComponent { }; handleButtonKeyDown = (e) => { - switch(e.key) { - case ' ': - case 'Enter': - this.handleMouseDown(); - break; + switch (e.key) { + case ' ': + case 'Enter': + this.handleMouseDown(); + break; } }; @@ -217,7 +217,7 @@ class FederationDropdown extends PureComponent { this.props.onChange(value); }; - UNSAFE_componentWillMount () { + UNSAFE_componentWillMount() { const { intl: { formatMessage } } = this.props; this.options = [ @@ -238,7 +238,7 @@ class FederationDropdown extends PureComponent { this.setState({ placement: state.placement }); }; - render () { + render() { const { value, container, disabled, intl } = this.props; const { open, placement } = this.state; diff --git a/app/javascript/mastodon/features/ui/components/column_link.jsx b/app/javascript/mastodon/features/ui/components/column_link.jsx index fb86799a2..ab823b130 100644 --- a/app/javascript/mastodon/features/ui/components/column_link.jsx +++ b/app/javascript/mastodon/features/ui/components/column_link.jsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import { NavLink } from 'react-router-dom'; -import { Icon } from 'mastodon/components/icon'; +import { Icon } from 'mastodon/components/icon'; const ColumnLink = ({ icon, text, to, href, method, badge, transparent, button, onClick, ...other }) => { const className = classNames('column-link', { 'column-link--transparent': transparent, 'column-link--button': button }); diff --git a/app/javascript/mastodon/features/ui/components/link_footer.jsx b/app/javascript/mastodon/features/ui/components/link_footer.jsx index c35e636e6..279778c32 100644 --- a/app/javascript/mastodon/features/ui/components/link_footer.jsx +++ b/app/javascript/mastodon/features/ui/components/link_footer.jsx @@ -18,7 +18,7 @@ const messages = defineMessages({ }); const mapDispatchToProps = (dispatch, { intl }) => ({ - onLogout () { + onLogout() { dispatch(openModal({ modalType: 'CONFIRM', modalProps: { @@ -52,7 +52,7 @@ class LinkFooter extends PureComponent { return false; }; - render () { + render() { const { signedIn, permissions } = this.context.identity; const { multiColumn } = this.props; @@ -110,7 +110,7 @@ class LinkFooter extends PureComponent { {DividingCircle} {DividingCircle} - v{version} + v{version}

);