chore: update react imports

Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
Paul Schultz
2025-01-28 10:21:17 -06:00
parent 02981a2377
commit 2e26579e06
1282 changed files with 2776 additions and 3434 deletions
-2
View File
@@ -28,8 +28,6 @@ import {
import SettingsIcon from '@material-ui/icons/Settings';
import { settingsRouteRef } from './plugin';
import React from 'react';
export * from './translation';
const userSettingsPage = PageBlueprint.makeWithOverrides({
@@ -15,7 +15,6 @@
*/
import Star from '@material-ui/icons/Star';
import React from 'react';
import { ProviderSettingsItem } from './ProviderSettingsItem';
import {
githubAuthApiRef,
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import Button from '@material-ui/core/Button';
import Typography from '@material-ui/core/Typography';
import { CodeSnippet, EmptyState } from '@backstage/core-components';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import Avatar from '@material-ui/core/Avatar';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { sidebarConfig } from '@backstage/core-components';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import Button from '@material-ui/core/Button';
import Grid from '@material-ui/core/Grid';
import ListItem from '@material-ui/core/ListItem';
@@ -16,7 +16,6 @@
import { TestApiRegistry, renderInTestApp } from '@backstage/test-utils';
import { fireEvent, screen } from '@testing-library/react';
import React from 'react';
import { UserSettingsAuthProviders } from './UserSettingsAuthProviders';
import { ApiProvider, ConfigReader } from '@backstage/core-app-api';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import List from '@material-ui/core/List';
import { EmptyProviders } from './EmptyProviders';
import { DefaultProviderSettings } from './DefaultProviderSettings';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { DefaultSettingsPage } from './DefaultSettingsPage';
import { UserSettingsTab } from '../UserSettingsTab';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { ReactElement } from 'react';
import { UserSettingsAuthProviders } from '../AuthProviders';
import { UserSettingsFeatureFlags } from '../FeatureFlags';
import { UserSettingsGeneral } from '../General';
@@ -24,7 +24,7 @@ import { SettingsLayout, SettingsLayoutRouteProps } from '../SettingsLayout';
* @public
*/
export const DefaultSettingsPage = (props: {
tabs?: React.ReactElement<SettingsLayoutRouteProps>[];
tabs?: ReactElement<SettingsLayoutRouteProps>[];
providerSettings?: JSX.Element;
}) => {
const { providerSettings, tabs } = props;
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import Button from '@material-ui/core/Button';
import Typography from '@material-ui/core/Typography';
import { CodeSnippet, EmptyState } from '@backstage/core-components';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import ListItem from '@material-ui/core/ListItem';
import ListItemText from '@material-ui/core/ListItemText';
import ListItemIcon from '@material-ui/core/ListItemIcon';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { useCallback, useState } from 'react';
import { useRef, useCallback, useState } from 'react';
import List from '@material-ui/core/List';
import TextField from '@material-ui/core/TextField';
import IconButton from '@material-ui/core/IconButton';
@@ -44,7 +44,7 @@ export const sortFlags = (
/** @public */
export const UserSettingsFeatureFlags = () => {
const featureFlagsApi = useApi(featureFlagsApiRef);
const inputRef = React.useRef<HTMLElement>();
const inputRef = useRef<HTMLElement>();
const initialFeatureFlags = featureFlagsApi.getRegisteredFlags();
const initialFeatureFlagsSorted = sortFlags(
@@ -16,7 +16,6 @@
import { InfoCard, useSidebarPinState } from '@backstage/core-components';
import List from '@material-ui/core/List';
import React from 'react';
import { UserSettingsPinToggle } from './UserSettingsPinToggle';
import { UserSettingsThemeToggle } from './UserSettingsThemeToggle';
import { UserSettingsLanguageToggle } from './UserSettingsLanguageToggle';
@@ -15,7 +15,6 @@
*/
import Grid from '@material-ui/core/Grid';
import React from 'react';
import { UserSettingsProfileCard } from './UserSettingsProfileCard';
import { UserSettingsAppearanceCard } from './UserSettingsAppearanceCard';
import { UserSettingsIdentityCard } from './UserSettingsIdentityCard';
@@ -20,7 +20,6 @@ import {
mockApis,
} from '@backstage/test-utils';
import { screen } from '@testing-library/react';
import React from 'react';
import { UserSettingsIdentityCard } from './UserSettingsIdentityCard';
import { ApiProvider } from '@backstage/core-app-api';
import { identityApiRef } from '@backstage/core-plugin-api';
@@ -18,7 +18,6 @@ import { InfoCard } from '@backstage/core-components';
import { EntityRefLinks } from '@backstage/plugin-catalog-react';
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';
import React from 'react';
import { useUserProfile } from '../useUserProfileInfo';
const Contents = () => {
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { screen, fireEvent } from '@testing-library/react';
import { UserSettingsLanguageToggle } from './UserSettingsLanguageToggle';
import { TestApiProvider, renderInTestApp } from '@backstage/test-utils';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { useState } from 'react';
import { useState } from 'react';
import {
useTranslationRef,
appLanguageApiRef,
@@ -22,7 +22,6 @@ import {
} from '@backstage/test-utils';
import { errorApiRef, identityApiRef } from '@backstage/core-plugin-api';
import { fireEvent, waitFor, screen } from '@testing-library/react';
import React from 'react';
import { UserSettingsMenu } from './UserSettingsMenu';
describe('<UserSettingsMenu />', () => {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { MouseEvent, useState } from 'react';
import IconButton from '@material-ui/core/IconButton';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import Menu from '@material-ui/core/Menu';
@@ -31,12 +31,10 @@ import {
export const UserSettingsMenu = () => {
const errorApi = useApi(errorApiRef);
const identityApi = useApi(identityApiRef);
const [open, setOpen] = React.useState(false);
const [anchorEl, setAnchorEl] = React.useState<undefined | HTMLElement>(
undefined,
);
const [open, setOpen] = useState(false);
const [anchorEl, setAnchorEl] = useState<undefined | HTMLElement>(undefined);
const handleOpen = (event: React.MouseEvent<HTMLButtonElement>) => {
const handleOpen = (event: MouseEvent<HTMLButtonElement>) => {
setAnchorEl(event.currentTarget);
setOpen(true);
};
@@ -16,7 +16,6 @@
import { renderInTestApp } from '@backstage/test-utils';
import { fireEvent, screen } from '@testing-library/react';
import React from 'react';
import { UserSettingsPinToggle } from './UserSettingsPinToggle';
import { SidebarPinStateProvider } from '@backstage/core-components';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import ListItem from '@material-ui/core/ListItem';
import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
import ListItemText from '@material-ui/core/ListItemText';
@@ -20,7 +20,6 @@ import {
mockApis,
} from '@backstage/test-utils';
import { screen } from '@testing-library/react';
import React from 'react';
import { identityApiRef } from '@backstage/core-plugin-api';
import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react';
import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils';
@@ -16,7 +16,6 @@
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';
import React from 'react';
import { UserSettingsSignInAvatar } from './UserSettingsSignInAvatar';
import { UserSettingsMenu } from './UserSettingsMenu';
import { useUserProfile } from '../useUserProfileInfo';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import Avatar from '@material-ui/core/Avatar';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { useUserProfile } from '../useUserProfileInfo';
@@ -20,7 +20,6 @@ import { lightTheme } from '@backstage/theme';
import { ThemeProvider } from '@material-ui/core/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import { fireEvent, screen } from '@testing-library/react';
import React from 'react';
import { UserSettingsThemeToggle } from './UserSettingsThemeToggle';
import { ApiProvider, AppThemeSelector } from '@backstage/core-app-api';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { cloneElement } from 'react';
import { MouseEvent, cloneElement } from 'react';
import useObservable from 'react-use/esm/useObservable';
import AutoIcon from '@material-ui/icons/BrightnessAuto';
import ToggleButton from '@material-ui/lab/ToggleButton';
@@ -111,7 +111,7 @@ export const UserSettingsThemeToggle = () => {
const { t } = useTranslationRef(userSettingsTranslationRef);
const handleSetTheme = (
_event: React.MouseEvent<HTMLElement>,
_event: MouseEvent<HTMLElement>,
newThemeId: string | undefined,
) => {
if (themeIds.some(it => it.id === newThemeId)) {
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import SettingsIcon from '@material-ui/icons/Settings';
import { settingsRouteRef } from '../plugin';
import { SidebarItem } from '@backstage/core-components';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { ElementType, ReactNode } from 'react';
import { TabProps } from '@material-ui/core/Tab';
import {
Header,
@@ -32,7 +32,7 @@ export type SettingsLayoutRouteProps = {
path: string;
title: string;
children: JSX.Element;
tabProps?: TabProps<React.ElementType, { component?: React.ElementType }>;
tabProps?: TabProps<ElementType, { component?: ElementType }>;
};
export const LAYOUT_DATA_KEY = 'plugin.user-settings.settingsLayout';
@@ -48,7 +48,7 @@ attachComponentData(Route, 'core.gatherMountPoints', true);
export type SettingsLayoutProps = {
title?: string;
subtitle?: string;
children?: React.ReactNode;
children?: ReactNode;
};
/**
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { SettingsPage } from './SettingsPage';
import { UserSettingsTab } from '../UserSettingsTab';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import { useOutlet } from 'react-router-dom';
import React from 'react';
import { DefaultSettingsPage } from '../DefaultSettingsPage';
import { useElementFilter } from '@backstage/core-plugin-api';
import {
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { PropsWithChildren } from 'react';
import { PropsWithChildren } from 'react';
import { attachComponentData } from '@backstage/core-plugin-api';
import {
LAYOUT_ROUTE_DATA_KEY,