chore: update react imports
Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
|
||||
@@ -19,7 +19,7 @@ import { searchApiRef } from '@backstage/plugin-search-react';
|
||||
import { wrapInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import React, { ComponentType, PropsWithChildren } from 'react';
|
||||
import { ComponentType, PropsWithChildren } from 'react';
|
||||
|
||||
export default {
|
||||
title: 'Plugins/Home/Components/SearchBar',
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { useCallback, useRef, useState } from 'react';
|
||||
import { useCallback, useRef, useState } from 'react';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import {
|
||||
SearchBarBase,
|
||||
|
||||
@@ -33,7 +33,7 @@ import IconButton from '@material-ui/core/IconButton';
|
||||
import List from '@material-ui/core/List';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import CloseIcon from '@material-ui/icons/Close';
|
||||
import React, { ComponentType, PropsWithChildren } from 'react';
|
||||
import { ComponentType, PropsWithChildren } from 'react';
|
||||
import { rootRouteRef } from '../../plugin';
|
||||
import { SearchType } from '../SearchType';
|
||||
import { SearchModal } from './SearchModal';
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
@@ -34,7 +34,7 @@ import IconButton from '@material-ui/core/IconButton';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import ArrowForwardIcon from '@material-ui/icons/ArrowForward';
|
||||
import CloseIcon from '@material-ui/icons/Close';
|
||||
import React, { ReactNode, useCallback, useEffect, useRef } from 'react';
|
||||
import { ReactNode, useCallback, useEffect, useRef } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
import { rootRouteRef } from '../../plugin';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { act, renderHook } from '@testing-library/react';
|
||||
import { useSearchModal } from './useSearchModal';
|
||||
import { BrowserRouter, Router } from 'react-router-dom';
|
||||
@@ -85,7 +85,7 @@ describe('useSearchModal', () => {
|
||||
const history = createMemoryHistory({ initialEntries: ['/'] });
|
||||
|
||||
const rendered = renderHook(() => useSearchModal(true), {
|
||||
wrapper: ({ children }: React.PropsWithChildren<{}>) => (
|
||||
wrapper: ({ children }: PropsWithChildren<{}>) => (
|
||||
<Router location={history.location} navigator={history}>
|
||||
{children}
|
||||
</Router>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { ReactNode, useCallback, useContext, useState } from 'react';
|
||||
import { ReactNode, useCallback, useContext, useState } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import {
|
||||
createVersionedContext,
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import React from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useSearch } from '@backstage/plugin-search-react';
|
||||
import { SearchPage } from './SearchPage';
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { useEffect } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import usePrevious from 'react-use/esm/usePrevious';
|
||||
import qs from 'qs';
|
||||
import { useLocation, useOutlet } from 'react-router-dom';
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { mockApis, TestApiProvider } from '@backstage/test-utils';
|
||||
import { act, render, waitFor } from '@testing-library/react';
|
||||
import user from '@testing-library/user-event';
|
||||
@@ -67,7 +67,7 @@ describe('SearchType.Accordion', () => {
|
||||
});
|
||||
});
|
||||
|
||||
const Wrapper = ({ children }: { children: React.ReactNode }) => {
|
||||
const Wrapper = ({ children }: { children: ReactNode }) => {
|
||||
return (
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { cloneElement, Fragment, useEffect, useState } from 'react';
|
||||
import { cloneElement, Fragment, useEffect, useState } from 'react';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import { searchApiRef, useSearch } from '@backstage/plugin-search-react';
|
||||
import Accordion from '@material-ui/core/Accordion';
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { mockApis, TestApiProvider } from '@backstage/test-utils';
|
||||
import { act, render } from '@testing-library/react';
|
||||
import user from '@testing-library/user-event';
|
||||
@@ -55,7 +55,7 @@ describe('SearchType.Tabs', () => {
|
||||
name: 'Expected Type',
|
||||
};
|
||||
|
||||
const Wrapper = ({ children }: { children: React.ReactNode }) => {
|
||||
const Wrapper = ({ children }: { children: ReactNode }) => {
|
||||
return (
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { useEffect } from 'react';
|
||||
import { ChangeEvent, useEffect } from 'react';
|
||||
import { useSearch } from '@backstage/plugin-search-react';
|
||||
import Tab from '@material-ui/core/Tab';
|
||||
import Tabs from '@material-ui/core/Tabs';
|
||||
@@ -50,7 +50,7 @@ export const SearchTypeTabs = (props: SearchTypeTabsProps) => {
|
||||
const { setPageCursor, setTypes, types } = useSearch();
|
||||
const { defaultValue, types: givenTypes } = props;
|
||||
|
||||
const changeTab = (_: React.ChangeEvent<{}>, newType: string) => {
|
||||
const changeTab = (_: ChangeEvent<{}>, newType: string) => {
|
||||
setTypes(newType !== '' ? [newType] : []);
|
||||
setPageCursor(undefined);
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ import Paper from '@material-ui/core/Paper';
|
||||
import CatalogIcon from '@material-ui/icons/MenuBook';
|
||||
import DocsIcon from '@material-ui/icons/Description';
|
||||
import UsersGroupsIcon from '@material-ui/icons/Person';
|
||||
import React, { ComponentType, PropsWithChildren } from 'react';
|
||||
import { ComponentType, PropsWithChildren } from 'react';
|
||||
import { SearchType } from './SearchType';
|
||||
import { TestApiProvider } from '@backstage/test-utils';
|
||||
import {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import { configApiRef } from '@backstage/core-plugin-api';
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
import {
|
||||
SearchContextProvider,
|
||||
searchApiRef,
|
||||
|
||||
@@ -21,7 +21,7 @@ import ListItemText from '@material-ui/core/ListItemText';
|
||||
import MenuItem from '@material-ui/core/MenuItem';
|
||||
import Select from '@material-ui/core/Select';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import React, { ChangeEvent } from 'react';
|
||||
import { ChangeEvent } from 'react';
|
||||
import useEffectOnce from 'react-use/esm/useEffectOnce';
|
||||
import {
|
||||
SearchTypeAccordion,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import qs from 'qs';
|
||||
import React, { useCallback } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { rootRouteRef } from '../../plugin';
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import SearchIcon from '@material-ui/icons/Search';
|
||||
import { SidebarItem } from '@backstage/core-components';
|
||||
import { IconComponent } from '@backstage/core-plugin-api';
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { useNavigateToQuery } from './util';
|
||||
import { rootRouteRef } from '../plugin';
|
||||
|
||||
Reference in New Issue
Block a user