Fix more whitespace and comment discrepancies

This commit is contained in:
Claire 2023-11-15 13:19:17 +01:00
parent 7e5d00720b
commit 1023c2f90b
24 changed files with 23 additions and 36 deletions

View file

@ -21,10 +21,7 @@ import { submitMarkers } from './markers';
import { register as registerPushNotifications } from './push_notifications';
import { saveSettings } from './settings';
export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';
// tracking the notif cleaning request

View file

@ -25,11 +25,11 @@ class SilentErrorBoundary extends Component {
error: false,
};
componentDidCatch () {
componentDidCatch() {
this.setState({ error: true });
}
render () {
render() {
if (this.state.error) {
return null;
}

View file

@ -16,6 +16,8 @@ import { autoUnfoldCW } from 'flavours/glitch/utils/content_warning';
import { withOptionalRouter, WithOptionalRouterPropTypes } from 'flavours/glitch/utils/react_router';
import Card from '../features/status/components/card';
// We use the component (and not the container) since we do not want
// to use the progress bar to show download progress
import Bundle from '../features/ui/components/bundle';
import { MediaGallery, Video, Audio } from '../features/ui/util/async-components';
import { displayMedia } from '../initial_state';

View file

@ -6,11 +6,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { Blurhash } from 'flavours/glitch/components/blurhash';
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from 'flavours/glitch/components/icon';
import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/initial_state';
export default class MediaItem extends ImmutablePureComponent {
static propTypes = {

View file

@ -28,7 +28,6 @@ class ReplyIndicator extends ImmutablePureComponent {
}
};
// Rendering.
render () {
const { status, intl } = this.props;
@ -40,7 +39,6 @@ class ReplyIndicator extends ImmutablePureComponent {
const content = status.get('content');
const attachments = status.get('media_attachments');
// The result.
return (
<article className='reply-indicator'>
<header className='reply-indicator__header'>

View file

@ -82,13 +82,9 @@ class Search extends PureComponent {
};
handleClear = e => {
const {
onClear,
submitted,
value,
} = this.props;
const { value, submitted, onClear } = this.props;
e.preventDefault(); // Prevents focus change ??
e.preventDefault();
if (value.length > 0 || submitted) {
onClear();
@ -160,6 +156,7 @@ class Search extends PureComponent {
search.forget(e);
}
}
break;
}
};
@ -342,6 +339,7 @@ class Search extends PureComponent {
<Icon id='search' className={hasValue ? '' : 'active'} />
<Icon id='times-circle' className={hasValue ? 'active' : ''} />
</div>
<div className='search__popout'>
{options.length === 0 && (
<>
@ -361,6 +359,7 @@ class Search extends PureComponent {
</div>
</>
)}
{options.length > 0 && (
<>
<h4><FormattedMessage id='search_popout.quick_actions' defaultMessage='Quick actions' /></h4>

View file

@ -27,8 +27,7 @@ export default class TextIconButton extends PureComponent {
className={`text-icon-button ${active ? 'active' : ''}`}
aria-expanded={active}
onClick={this.props.onClick}
aria-controls={ariaControls}
style={iconStyle}
aria-controls={ariaControls} style={iconStyle}
>
{label}
</button>

View file

@ -5,7 +5,7 @@ import { FormattedMessage } from 'react-intl';
import spring from 'react-motion/lib/spring';
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from 'flavours/glitch/components/icon';
import Motion from '../../ui/util/optional_motion';

View file

@ -93,7 +93,7 @@ Object.keys(emojiIndex.emojis).forEach(key => {
let { short_names, search, unified } = emojiMartData.emojis[key];
if (short_names[0] !== key) {
throw new Error('The compresser expects the first short_code to be the ' +
throw new Error('The compressor expects the first short_code to be the ' +
'key. It may need to be rewritten if the emoji change such that this ' +
'is no longer the case.');
}

View file

@ -11,7 +11,6 @@ import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp
import { ShortNumber } from 'flavours/glitch/components/short_number';
import { Skeleton } from 'flavours/glitch/components/skeleton';
export default class Story extends PureComponent {
static propTypes = {

View file

@ -14,8 +14,6 @@ import { ImmutableHashtag as Hashtag } from 'flavours/glitch/components/hashtag'
import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator';
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
const mapStateToProps = state => ({
hashtags: state.getIn(['trends', 'tags', 'items']),
isLoadingHashtags: state.getIn(['trends', 'tags', 'isLoading']),

View file

@ -18,7 +18,6 @@ import ScrollableList from 'flavours/glitch/components/scrollable_list';
import AccountContainer from 'flavours/glitch/containers/account_container';
import Column from 'flavours/glitch/features/ui/components/column';
const messages = defineMessages({
heading: { id: 'column.favourited_by', defaultMessage: 'Favourited by' },
refresh: { id: 'refresh', defaultMessage: 'Refresh' },

View file

@ -69,7 +69,6 @@ class FollowRequests extends ImmutablePureComponent {
return (
<Column bindToDocument={!multiColumn} name='follow-requests' icon='user-plus' heading={intl.formatMessage(messages.heading)}>
<ColumnBackButtonSlim />
<ScrollableList
scrollKey='follow_requests'
onLoadMore={this.handleLoadMore}

View file

@ -14,7 +14,7 @@ import spring from 'react-motion/lib/spring';
import ReactSwipeableViews from 'react-swipeable-views';
import { AnimatedNumber } from 'flavours/glitch/components/animated_number';
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from 'flavours/glitch/components/icon';
import { IconButton } from 'flavours/glitch/components/icon_button';
import EmojiPickerDropdown from 'flavours/glitch/features/compose/containers/emoji_picker_dropdown_container';
import { unicodeMapping } from 'flavours/glitch/features/emoji/emoji_unicode_mapping_light';

View file

@ -6,7 +6,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { connect } from 'react-redux';
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from 'flavours/glitch/components/icon';
import { removeFromListAdder, addToListAdder } from '../../../actions/lists';
import { IconButton } from '../../../components/icon_button';

View file

@ -5,7 +5,7 @@ import { defineMessages } from 'react-intl';
import classNames from 'classnames';
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from 'flavours/glitch/components/icon';
const messages = defineMessages({
search: { id: 'lists.search', defaultMessage: 'Search among people you follow' },

View file

@ -18,7 +18,7 @@ import { connectListStream } from 'flavours/glitch/actions/streaming';
import { expandListTimeline } from 'flavours/glitch/actions/timelines';
import Column from 'flavours/glitch/components/column';
import ColumnHeader from 'flavours/glitch/components/column_header';
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from 'flavours/glitch/components/icon';
import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator';
import { RadioButton } from 'flavours/glitch/components/radio_button';
import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error';

View file

@ -3,7 +3,7 @@ import { Component } from 'react';
import { FormattedMessage } from 'react-intl';
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from 'flavours/glitch/components/icon';
export default class ClearColumnButton extends Component {

View file

@ -3,7 +3,7 @@ import { PureComponent } from 'react';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from 'flavours/glitch/components/icon';
const tooltips = defineMessages({
mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' },

View file

@ -11,7 +11,6 @@ import { Button } from 'flavours/glitch/components/button';
import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator';
import StatusCheckBox from 'flavours/glitch/features/report/containers/status_check_box_container';
const mapStateToProps = (state, { accountId }) => ({
availableStatusIds: OrderedSet(state.getIn(['timelines', `account:${accountId}:with_replies`, 'items'])),
isLoading: state.getIn(['timelines', `account:${accountId}:with_replies`, 'isLoading']),

View file

@ -11,7 +11,6 @@ import SearchContainer from 'flavours/glitch/features/compose/containers/search_
import LinkFooter from './link_footer';
class ComposePanel extends PureComponent {
static contextTypes = {

View file

@ -11,7 +11,7 @@ import ReactSwipeableViews from 'react-swipeable-views';
import { getAverageFromBlurhash } from 'flavours/glitch/blurhash';
import { GIFV } from 'flavours/glitch/components/gifv';
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from 'flavours/glitch/components/icon';
import { IconButton } from 'flavours/glitch/components/icon_button';
import Footer from 'flavours/glitch/features/picture_in_picture/components/footer';
import Video from 'flavours/glitch/features/video';

View file

@ -2,6 +2,7 @@ import { useCallback } from 'react';
import { FormattedMessage } from 'react-intl';
import { openModal } from 'flavours/glitch/actions/modal';
import { registrationsOpen, sso_redirect } from 'flavours/glitch/initial_state';
import { useAppDispatch, useAppSelector } from 'flavours/glitch/store';

View file

@ -30,7 +30,7 @@ WrappedSwitch.propTypes = {
children: PropTypes.node,
};
// Small Wraper to extract the params from the route and pass
// Small Wrapper to extract the params from the route and pass
// them to the rendered component, together with the content to
// be rendered inside (the children)
export class WrappedRoute extends Component {