From 9bbb0f13e04529c63478698f228b4867f6137820 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 15 Nov 2023 12:52:30 +0100 Subject: [PATCH] Fix inconsistent React imports in JSX files (#2466) --- .../flavours/glitch/components/animated_number.tsx | 1 - app/javascript/flavours/glitch/components/avatar.tsx | 2 -- app/javascript/flavours/glitch/components/blurhash.tsx | 5 ++--- app/javascript/flavours/glitch/components/domain.tsx | 1 - app/javascript/flavours/glitch/components/gifv.tsx | 1 - app/javascript/flavours/glitch/components/icon.tsx | 2 -- app/javascript/flavours/glitch/components/icon_button.tsx | 4 ++-- .../flavours/glitch/components/icon_with_badge.tsx | 2 -- .../flavours/glitch/components/not_signed_in_indicator.tsx | 2 -- app/javascript/flavours/glitch/components/radio_button.tsx | 2 -- .../flavours/glitch/components/server_hero_image.tsx | 1 - app/javascript/flavours/glitch/components/skeleton.tsx | 2 -- app/javascript/flavours/glitch/components/timeline_hint.tsx | 2 -- 13 files changed, 4 insertions(+), 23 deletions(-) diff --git a/app/javascript/flavours/glitch/components/animated_number.tsx b/app/javascript/flavours/glitch/components/animated_number.tsx index 2beb6efbe4..05a7e01898 100644 --- a/app/javascript/flavours/glitch/components/animated_number.tsx +++ b/app/javascript/flavours/glitch/components/animated_number.tsx @@ -1,5 +1,4 @@ import { useCallback, useState } from 'react'; -import * as React from 'react'; import { TransitionMotion, spring } from 'react-motion'; diff --git a/app/javascript/flavours/glitch/components/avatar.tsx b/app/javascript/flavours/glitch/components/avatar.tsx index 16360d27cd..e69e9950d1 100644 --- a/app/javascript/flavours/glitch/components/avatar.tsx +++ b/app/javascript/flavours/glitch/components/avatar.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import classNames from 'classnames'; import { useHovering } from '../hooks/useHovering'; diff --git a/app/javascript/flavours/glitch/components/blurhash.tsx b/app/javascript/flavours/glitch/components/blurhash.tsx index d98e7d35db..8e2a8af23e 100644 --- a/app/javascript/flavours/glitch/components/blurhash.tsx +++ b/app/javascript/flavours/glitch/components/blurhash.tsx @@ -1,5 +1,4 @@ -import { useRef, useEffect } from 'react'; -import * as React from 'react'; +import { memo, useRef, useEffect } from 'react'; import { decode } from 'blurhash'; @@ -44,6 +43,6 @@ const Blurhash: React.FC = ({ ); }; -const MemoizedBlurhash = React.memo(Blurhash); +const MemoizedBlurhash = memo(Blurhash); export { MemoizedBlurhash as Blurhash }; diff --git a/app/javascript/flavours/glitch/components/domain.tsx b/app/javascript/flavours/glitch/components/domain.tsx index 50c5c256ec..f4a3b9d4b6 100644 --- a/app/javascript/flavours/glitch/components/domain.tsx +++ b/app/javascript/flavours/glitch/components/domain.tsx @@ -1,5 +1,4 @@ import { useCallback } from 'react'; -import * as React from 'react'; import { defineMessages, useIntl } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/components/gifv.tsx b/app/javascript/flavours/glitch/components/gifv.tsx index 96071ced42..c2be591128 100644 --- a/app/javascript/flavours/glitch/components/gifv.tsx +++ b/app/javascript/flavours/glitch/components/gifv.tsx @@ -1,5 +1,4 @@ import { useCallback, useState } from 'react'; -import * as React from 'react'; interface Props { src: string; diff --git a/app/javascript/flavours/glitch/components/icon.tsx b/app/javascript/flavours/glitch/components/icon.tsx index 765aa89aec..3d091c7059 100644 --- a/app/javascript/flavours/glitch/components/icon.tsx +++ b/app/javascript/flavours/glitch/components/icon.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import classNames from 'classnames'; interface Props extends React.HTMLAttributes { diff --git a/app/javascript/flavours/glitch/components/icon_button.tsx b/app/javascript/flavours/glitch/components/icon_button.tsx index ecc418773c..8bca60fa97 100644 --- a/app/javascript/flavours/glitch/components/icon_button.tsx +++ b/app/javascript/flavours/glitch/components/icon_button.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import { PureComponent } from 'react'; import classNames from 'classnames'; @@ -33,7 +33,7 @@ interface States { activate: boolean; deactivate: boolean; } -export class IconButton extends React.PureComponent { +export class IconButton extends PureComponent { static defaultProps = { size: 18, active: false, diff --git a/app/javascript/flavours/glitch/components/icon_with_badge.tsx b/app/javascript/flavours/glitch/components/icon_with_badge.tsx index 319c0b2389..8898f41329 100644 --- a/app/javascript/flavours/glitch/components/icon_with_badge.tsx +++ b/app/javascript/flavours/glitch/components/icon_with_badge.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import { Icon } from './icon'; const formatNumber = (num: number): number | string => (num > 40 ? '40+' : num); diff --git a/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx b/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx index d0eedc6412..015f74dcae 100644 --- a/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx +++ b/app/javascript/flavours/glitch/components/not_signed_in_indicator.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import { FormattedMessage } from 'react-intl'; export const NotSignedInIndicator: React.FC = () => ( diff --git a/app/javascript/flavours/glitch/components/radio_button.tsx b/app/javascript/flavours/glitch/components/radio_button.tsx index fbd7859d80..d0a565b9e6 100644 --- a/app/javascript/flavours/glitch/components/radio_button.tsx +++ b/app/javascript/flavours/glitch/components/radio_button.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import classNames from 'classnames'; interface Props { diff --git a/app/javascript/flavours/glitch/components/server_hero_image.tsx b/app/javascript/flavours/glitch/components/server_hero_image.tsx index be05059e49..68b7f03df3 100644 --- a/app/javascript/flavours/glitch/components/server_hero_image.tsx +++ b/app/javascript/flavours/glitch/components/server_hero_image.tsx @@ -1,5 +1,4 @@ import { useCallback, useState } from 'react'; -import * as React from 'react'; import classNames from 'classnames'; diff --git a/app/javascript/flavours/glitch/components/skeleton.tsx b/app/javascript/flavours/glitch/components/skeleton.tsx index 30ff0d8525..d6f1aed723 100644 --- a/app/javascript/flavours/glitch/components/skeleton.tsx +++ b/app/javascript/flavours/glitch/components/skeleton.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - interface Props { width?: number | string; height?: number | string; diff --git a/app/javascript/flavours/glitch/components/timeline_hint.tsx b/app/javascript/flavours/glitch/components/timeline_hint.tsx index df7787bf67..bf2a2d8bba 100644 --- a/app/javascript/flavours/glitch/components/timeline_hint.tsx +++ b/app/javascript/flavours/glitch/components/timeline_hint.tsx @@ -1,5 +1,3 @@ -import * as React from 'react'; - import { FormattedMessage } from 'react-intl'; interface Props {