Skip to content

Commit

Permalink
Run codemod to update React imports
Browse files Browse the repository at this point in the history
npx react-codemod update-react-imports
  • Loading branch information
barrymcgee committed Dec 7, 2020
1 parent a323a3b commit 68dec08
Show file tree
Hide file tree
Showing 68 changed files with 20 additions and 75 deletions.
1 change: 0 additions & 1 deletion src/app/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import cloneDeep from "clone-deep";

import defaultCharmIcon from "static/images/icons/default-charm-icon.svg";
Expand Down
1 change: 0 additions & 1 deletion src/components/App/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { useSelector } from "react-redux";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import { QueryParamProvider } from "use-query-params";
Expand Down
1 change: 0 additions & 1 deletion src/components/App/App.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { Provider } from "react-redux";
import configureStore from "redux-mock-store";
import { mount } from "enzyme";
Expand Down
2 changes: 0 additions & 2 deletions src/components/Banner/Banner.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import "./_banner.scss";

export default function Banner({ isActive, children, type }) {
Expand Down
1 change: 0 additions & 1 deletion src/components/Banner/Banner.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { shallow } from "enzyme";

import Banner from "./Banner";
Expand Down
2 changes: 0 additions & 2 deletions src/components/Button/Button.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import "./_button.scss";

const Button = ({ onClick, children }) => {
Expand Down
1 change: 0 additions & 1 deletion src/components/Button/Button.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { shallow } from "enzyme";

import Button from "./Button";
Expand Down
1 change: 0 additions & 1 deletion src/components/ButtonGroup/ButtonGroup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import classNames from "classnames";

import "./_button-group.scss";
Expand Down
1 change: 0 additions & 1 deletion src/components/ButtonGroup/ButtonGroup.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { mount } from "enzyme";

import ButtonGroup from "./ButtonGroup";
Expand Down
1 change: 0 additions & 1 deletion src/components/Counts/Counts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { pluralize } from "app/utils";

import "./_counts.scss";
Expand Down
1 change: 0 additions & 1 deletion src/components/Counts/Counts.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { mount } from "enzyme";

import Counts from "./Counts";
Expand Down
2 changes: 1 addition & 1 deletion src/components/DonutChart/DonutChart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, useEffect } from "react";
import { useRef, useEffect } from "react";
import * as d3 from "d3";

const DonutChart = ({ chartData }) => {
Expand Down
1 change: 0 additions & 1 deletion src/components/DonutChart/DonutChart.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { mount } from "enzyme";

import DonutChart from "./DonutChart";
Expand Down
2 changes: 1 addition & 1 deletion src/components/ErrorBoundary/ErrorBoundary.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from "react";
import { Component } from "react";
import * as Sentry from "@sentry/browser";

export default class ErrorBoundary extends Component {
Expand Down
1 change: 0 additions & 1 deletion src/components/ErrorBoundary/ErrorBoundary.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { mount } from "enzyme";

import ErrorBoundary from "./ErrorBoundary";
Expand Down
1 change: 0 additions & 1 deletion src/components/Filter/Filter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import Button from "components/Button/Button";
import classNames from "classnames";

Expand Down
1 change: 0 additions & 1 deletion src/components/Filter/Filter.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { mount } from "enzyme";

import Filter from "./Filter";
Expand Down
2 changes: 1 addition & 1 deletion src/components/FilterTags/FilterTags.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useRef, useEffect } from "react";
import { useState, useRef, useEffect } from "react";
import classNames from "classnames";
import { useSelector } from "react-redux";
import { useHistory, useLocation } from "react-router-dom";
Expand Down
1 change: 0 additions & 1 deletion src/components/FilterTags/FilterTags.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { MemoryRouter, Router } from "react-router";
import { mount } from "enzyme";
import { Provider } from "react-redux";
Expand Down
2 changes: 0 additions & 2 deletions src/components/Header/Header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import "./_header.scss";

export default function Header({ children }) {
Expand Down
1 change: 0 additions & 1 deletion src/components/Header/Header.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { mount } from "enzyme";

import Header from "./Header";
Expand Down
2 changes: 1 addition & 1 deletion src/components/InfoPanel/InfoPanel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import { useParams } from "react-router-dom";

import Topology from "components/Topology/Topology";
Expand Down
1 change: 0 additions & 1 deletion src/components/InfoPanel/InfoPanel.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import configureStore from "redux-mock-store";
import { Provider } from "react-redux";
import { mount } from "enzyme";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/Layout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState, useRef } from "react";
import { useEffect, useState, useRef } from "react";
import { useSelector, useStore, useDispatch } from "react-redux";
import { isLoggedIn, getWSControllerURL } from "app/selectors";
import Notification from "@canonical/react-components/dist/components/Notification/Notification";
Expand Down
1 change: 0 additions & 1 deletion src/components/Layout/Layout.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { BrowserRouter as Router } from "react-router-dom";
import { mount } from "enzyme";
import configureStore from "redux-mock-store";
Expand Down
2 changes: 1 addition & 1 deletion src/components/LogIn/LogIn.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useRef } from "react";
import { useEffect, useRef } from "react";
import { useDispatch, useSelector, useStore } from "react-redux";
import {
isLoggedIn,
Expand Down
1 change: 0 additions & 1 deletion src/components/LogIn/LogIn.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import configureStore from "redux-mock-store";
import { Provider } from "react-redux";
import { mount } from "enzyme";
Expand Down
1 change: 0 additions & 1 deletion src/components/ModelTableList/CloudGroup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { useSelector } from "react-redux";
import MainTable from "@canonical/react-components/dist/components/MainTable";
import {
Expand Down
1 change: 0 additions & 1 deletion src/components/ModelTableList/CloudGroup.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { MemoryRouter } from "react-router";
import { mount } from "enzyme";
import { Provider } from "react-redux";
Expand Down
1 change: 0 additions & 1 deletion src/components/ModelTableList/ModelTableList.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { useSelector, useStore } from "react-redux";

import { getActiveUserTag, getWSControllerURL } from "app/selectors";
Expand Down
1 change: 0 additions & 1 deletion src/components/ModelTableList/ModelTableList.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import cloneDeep from "clone-deep";
import { MemoryRouter } from "react-router";
import { mount } from "enzyme";
Expand Down
1 change: 0 additions & 1 deletion src/components/ModelTableList/OwnerGroup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { useSelector } from "react-redux";
import MainTable from "@canonical/react-components/dist/components/MainTable";
import { generateStatusElement, getModelStatusGroupData } from "app/utils";
Expand Down
1 change: 0 additions & 1 deletion src/components/ModelTableList/OwnerGroup.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { MemoryRouter } from "react-router";
import { mount } from "enzyme";
import { Provider } from "react-redux";
Expand Down
1 change: 0 additions & 1 deletion src/components/ModelTableList/StatusGroup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { useSelector } from "react-redux";
import MainTable from "@canonical/react-components/dist/components/MainTable";

Expand Down
1 change: 0 additions & 1 deletion src/components/ModelTableList/StatusGroup.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { MemoryRouter } from "react-router";
import { mount } from "enzyme";
import { Provider } from "react-redux";
Expand Down
1 change: 0 additions & 1 deletion src/components/ModelTableList/shared.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { Link } from "react-router-dom";
import { extractCloudName, extractCredentialName } from "app/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/PrimaryNav/PrimaryNav.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import { useSelector, useDispatch } from "react-redux";
import { NavLink, useLocation } from "react-router-dom";
import classNames from "classnames";
Expand Down
1 change: 0 additions & 1 deletion src/components/PrimaryNav/PrimaryNav.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { BrowserRouter as Router, MemoryRouter } from "react-router-dom";
import { mount } from "enzyme";
import configureStore from "redux-mock-store";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Routes/Routes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from "react";
import { useEffect } from "react";
import { Route, Redirect, useLocation } from "react-router-dom";

import Controllers from "pages/Controllers/Controllers";
Expand Down
1 change: 0 additions & 1 deletion src/components/Routes/TestRoute.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { Route } from "react-router-dom";

import { paths } from "./Routes";
Expand Down
2 changes: 1 addition & 1 deletion src/components/SlidePanel/SlidePanel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from "react";
import { useEffect } from "react";
import classnames from "classnames";
import Spinner from "@canonical/react-components/dist/components/Spinner";

Expand Down
1 change: 0 additions & 1 deletion src/components/SlidePanel/SlidePanel.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { shallow, mount } from "enzyme";

import SlidePanel from "./SlidePanel";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Terminal/Terminal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useRef, useState } from "react";
import { useEffect, useRef, useState } from "react";
import { useHistory } from "react-router-dom";
// import { useSelector } from "react-redux";
// import { getMacaroons } from "app/selectors";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Topology/Topology.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, useEffect } from "react";
import { useRef, useEffect } from "react";
import * as d3 from "d3";

import { generateIconPath } from "app/utils";
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserMenu/UserMenu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from "react";
import { useEffect } from "react";
import { useSelector, useDispatch, useStore } from "react-redux";
import { Link, NavLink } from "react-router-dom";
import classNames from "classnames";
Expand Down
1 change: 0 additions & 1 deletion src/components/UserMenu/UserMenu.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { BrowserRouter as Router } from "react-router-dom";
import configureStore from "redux-mock-store";
import { Provider } from "react-redux";
Expand Down
2 changes: 1 addition & 1 deletion src/components/panels/AppsPanel/AppsPanel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo } from "react";
import { useMemo } from "react";
import { useSelector } from "react-redux";
import { getConfig } from "app/selectors";
import MainTable from "@canonical/react-components/dist/components/MainTable";
Expand Down
2 changes: 1 addition & 1 deletion src/components/panels/MachinesPanel/MachinesPanel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, useCallback } from "react";
import { useMemo, useCallback } from "react";
import MainTable from "@canonical/react-components/dist/components/MainTable";
import cloneDeep from "clone-deep";

Expand Down
2 changes: 1 addition & 1 deletion src/components/panels/UnitsPanel/UnitsPanel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, useCallback } from "react";
import { useMemo, useCallback } from "react";
import MainTable from "@canonical/react-components/dist/components/MainTable";
import cloneDeep from "clone-deep";

Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import { StrictMode } from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { applyMiddleware, combineReducers, createStore } from "redux";
Expand Down Expand Up @@ -106,9 +106,9 @@ function bootstrap() {

ReactDOM.render(
<Provider store={reduxStore}>
<React.StrictMode>
<StrictMode>
<App />
</React.StrictMode>
</StrictMode>
</Provider>,
rootElement
);
Expand Down
2 changes: 0 additions & 2 deletions src/pages/Controllers/ControllerChart/ControllerChart.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import DonutChart from "components/DonutChart/DonutChart";

import { pluralize } from "app/utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { mount } from "enzyme";

import ControllerChart from "./ControllerChart";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { useSelector } from "react-redux";

import {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Controllers/Controllers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import { useState } from "react";
import { useDispatch, useSelector, useStore } from "react-redux";
import { Link } from "react-router-dom";
import cloneDeep from "clone-deep";
Expand Down
1 change: 0 additions & 1 deletion src/pages/Controllers/Controllers.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import cloneDeep from "clone-deep";
import { mount } from "enzyme";
import { MemoryRouter } from "react-router";
Expand Down
1 change: 0 additions & 1 deletion src/pages/Logs/Logs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import Notification from "@canonical/react-components/dist/components/Notification/Notification";

import Layout from "components/Layout/Layout";
Expand Down
1 change: 0 additions & 1 deletion src/pages/Logs/Logs.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { shallow } from "enzyme";
import Logs from "./Logs";

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Models/Details/ModelDetails.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useCallback } from "react";
import { useEffect, useMemo, useCallback } from "react";
import MainTable from "@canonical/react-components/dist/components/MainTable";
import Spinner from "@canonical/react-components/dist/components/Spinner";
import { useDispatch, useSelector } from "react-redux";
Expand Down
1 change: 0 additions & 1 deletion src/pages/Models/Details/ModelDetails.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import configureStore from "redux-mock-store";
import { Provider } from "react-redux";
import { mount } from "enzyme";
Expand Down
1 change: 0 additions & 1 deletion src/pages/Models/Details/generators.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { URL } from "@canonical/jaaslib/lib/urls";
import cloneDeep from "clone-deep";

Expand Down
1 change: 0 additions & 1 deletion src/pages/Models/Models.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { useSelector } from "react-redux";
import { useLocation } from "react-router-dom";
import queryString from "query-string";
Expand Down
1 change: 0 additions & 1 deletion src/pages/Models/Models.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import configureStore from "redux-mock-store";
import { Provider } from "react-redux";
import { mount } from "enzyme";
Expand Down
2 changes: 0 additions & 2 deletions src/pages/NotFound/NotFound.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import Layout from "components/Layout/Layout";

export default function NotFound() {
Expand Down
1 change: 0 additions & 1 deletion src/pages/NotFound/NotFound.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { shallow } from "enzyme";
import NotFound from "./NotFound";

Expand Down
1 change: 0 additions & 1 deletion src/pages/Settings/Settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import Header from "components/Header/Header";
import Layout from "components/Layout/Layout";

Expand Down
1 change: 0 additions & 1 deletion src/pages/Usage/Usage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import Layout from "components/Layout/Layout";
import Notification from "@canonical/react-components/dist/components/Notification/Notification";

Expand Down
1 change: 0 additions & 1 deletion src/pages/Usage/Usage.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { shallow } from "enzyme";
import Usage from "./Usage";

Expand Down
1 change: 0 additions & 1 deletion src/testing/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { shallow } from "enzyme";

/**
Expand Down

0 comments on commit 68dec08

Please sign in to comment.