Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v17] Remove unused React imports from packages/teleport #50330

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion web/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { ComponentType, PropsWithChildren } from 'react';
import { ComponentType, PropsWithChildren } from 'react';
import { bblpTheme, darkTheme, lightTheme } from '../packages/design/src/theme';
import { ConfiguredThemeProvider } from '../packages/design/src/ThemeProvider';
import Box from '../packages/design/src/Box';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';

import { LockedAccessRequests } from 'teleport/AccessRequests/LockedAccessRequests/LockedAccessRequests';
import { ContextProvider } from 'teleport';
import { createTeleportContext } from 'teleport/mocks/contexts';
Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleport/src/Account/Account.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { useEffect } from 'react';
import { useEffect } from 'react';

import { PasswordState } from 'teleport/services/user';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';

import * as Icon from 'design/Icon';

import { ActionButtonSecondary, Header } from 'teleport/Account/Header';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import { render, screen } from 'design/utils/testing';
import { within } from '@testing-library/react';
import React from 'react';

import { MfaDevice } from 'teleport/services/mfa';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

import { render, screen } from 'design/utils/testing';
import React from 'react';

import { within } from '@testing-library/react';
import { userEvent, UserEvent } from '@testing-library/user-event';
Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleport/src/Account/PasswordBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import { Box, Flex } from 'design';
import { SingleRowBox } from 'design/MultiRowBox';
import React, { useState } from 'react';
import { useState } from 'react';

import * as Icon from 'design/Icon';

Expand Down
1 change: 0 additions & 1 deletion web/packages/teleport/src/Account/StatePill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import styled, { css } from 'styled-components';

/** State of an authentication method (password, MFA method, or passkey). */
Expand Down
2 changes: 0 additions & 2 deletions web/packages/teleport/src/AppLauncher/AppLauncher.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';

import { AppLauncherAccessDenied, AppLauncherProcessing } from './AppLauncher';

export default {
Expand Down
1 change: 0 additions & 1 deletion web/packages/teleport/src/AppLauncher/AppLauncher.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { render, waitFor, screen } from 'design/utils/testing';
import { createMemoryHistory } from 'history';
import { Router } from 'react-router';
Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleport/src/AppLauncher/AppLauncher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { useCallback, useEffect } from 'react';
import { useCallback, useEffect } from 'react';

import { useLocation, useParams } from 'react-router';

Expand Down
2 changes: 0 additions & 2 deletions web/packages/teleport/src/Apps/AddApp/AddApp.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';

import { AddApp } from './AddApp';

export default {
Expand Down
1 change: 0 additions & 1 deletion web/packages/teleport/src/Apps/AddApp/AddApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { Flex } from 'design';
import Dialog, { DialogTitle } from 'design/Dialog';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { fireEvent, render, screen } from 'design/utils/testing';

import { act } from '@testing-library/react';
Expand Down
10 changes: 5 additions & 5 deletions web/packages/teleport/src/Apps/AddApp/Automatically.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { KeyboardEvent } from 'react';
import { useState, useEffect, KeyboardEvent } from 'react';
import {
Link,
Text,
Expand All @@ -38,11 +38,11 @@ import { State } from './useAddApp';
export function Automatically(props: Props) {
const { onClose, attempt, token } = props;

const [name, setName] = React.useState('');
const [uri, setUri] = React.useState('');
const [cmd, setCmd] = React.useState('');
const [name, setName] = useState('');
const [uri, setUri] = useState('');
const [cmd, setCmd] = useState('');

React.useEffect(() => {
useEffect(() => {
if (name && uri) {
const cmd = createAppBashCommand(token.id, name, uri);
setCmd(cmd);
Expand Down
1 change: 0 additions & 1 deletion web/packages/teleport/src/Apps/AddApp/Manually.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { render, screen } from 'design/utils/testing';

import { Manually } from './Manually';
Expand Down
1 change: 0 additions & 1 deletion web/packages/teleport/src/Apps/AddApp/Manually.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import {
Text,
Box,
Expand Down
1 change: 0 additions & 1 deletion web/packages/teleport/src/Audit/Audit.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { Router } from 'react-router';
import { createMemoryHistory } from 'history';

Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleport/src/Audit/Audit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { useState } from 'react';
import { useState } from 'react';

import { Danger } from 'design/Alert';
import { Indicator, Box } from 'design';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import PropTypes from 'prop-types';
import TextEditor from 'shared/components/TextEditor';
import Dialog, {
Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleport/src/Audit/EventList/EventList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { useState } from 'react';
import { useState } from 'react';
import { ButtonBorder, Flex } from 'design';
import Table, { Cell } from 'design/DataTable';
import { dateTimeMatcher } from 'design/utils/match';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { Cell } from 'design/DataTable';
import { ButtonBorder } from 'design';
import { displayDateTime } from 'design/datetime';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import styled from 'styled-components';
import { Cell } from 'design/DataTable';
import * as Icons from 'design/Icon';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { useMemo } from 'react';
import { useMemo } from 'react';

import { ButtonBorder } from 'design';
import { NavLink } from 'react-router-dom';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';

import { ContextProvider } from 'teleport';
import { createTeleportContext } from 'teleport/mocks/contexts';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { Alert, Box, Flex, H3, Indicator, Link } from 'design';

import { P } from 'design/Text/Text';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { Box, ButtonPrimary, Flex, ResourceIcon, Text } from 'design';
import { MenuIcon, MenuItem } from 'shared/components/MenuAction';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';

import DeleteDialog from './DeleteConnectorDialog';

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import useAttempt from 'shared/hooks/useAttemptNext';
import { ButtonWarning, ButtonSecondary, Text, Alert, P1 } from 'design';
import Dialog, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { Card, Flex, H1, ResourceIcon, Text } from 'design';
import { AuthProviderType } from 'shared/services';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import styled from 'styled-components';
import { AuthProviderType } from 'shared/services';
import { Box, Flex, ResourceIcon } from 'design';
Expand Down
2 changes: 0 additions & 2 deletions web/packages/teleport/src/Bots/Add/AddBots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';

import { Switch, Route } from 'teleport/components/Router';
import cfg from 'teleport/config';

Expand Down
1 change: 0 additions & 1 deletion web/packages/teleport/src/Bots/Add/AddBotsPicker.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { MemoryRouter } from 'react-router';

import { ContextProvider } from 'teleport';
Expand Down
1 change: 0 additions & 1 deletion web/packages/teleport/src/Bots/Add/AddBotsPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { Link } from 'react-router-dom';
import styled from 'styled-components';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { MemoryRouter } from 'react-router';

import { ContextProvider } from 'teleport';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { render, screen } from 'design/utils/testing';
import { MemoryRouter } from 'react-router-dom';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';

import Box from 'design/Box';
import { Text } from 'design';
import TextEditor from 'shared/components/TextEditor';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { MemoryRouter } from 'react-router';

import { ContextProvider } from 'teleport';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { render, screen, userEvent } from 'design/utils/testing';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { useState } from 'react';
import { useState } from 'react';
import styled from 'styled-components';

import Box from 'design/Box';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { MemoryRouter } from 'react-router';

import { ContextProvider } from 'teleport';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';

import { MemoryRouter } from 'react-router';

import { render, screen } from 'design/utils/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { useState } from 'react';
import { useState } from 'react';
import styled from 'styled-components';

import Box from 'design/Box';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { render, screen } from 'design/utils/testing';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { Link } from 'react-router-dom';

import Flex from 'design/Flex';
Expand Down
Loading
Loading