diff --git a/.eslintrc.js b/.eslintrc.js index 648d7741d5636f..7fa58b888f3840 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -166,6 +166,7 @@ module.exports = { 'no-undef': 'off', 'no-unused-vars': 'off', 'react/jsx-no-undef': 'off', + 'react/jsx-uses-react': 'off', 'react/react-in-jsx-scope': 'off', 'wpcalypso/jsx-classname-namespace': 'off', '@typescript-eslint/no-unused-vars': 'off', diff --git a/apps/notifications/src/panel/Notifications.jsx b/apps/notifications/src/panel/Notifications.jsx index 8b42634b67e9a6..ba96d87a5dc28c 100644 --- a/apps/notifications/src/panel/Notifications.jsx +++ b/apps/notifications/src/panel/Notifications.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { createContext, PureComponent } from 'react'; import { Provider } from 'react-redux'; import repliesCache from './comment-replies-cache'; import RestClient from './rest-client'; @@ -24,7 +24,7 @@ repliesCache.cleanup(); */ export const refreshNotes = () => client && client.refreshNotes.call( client ); -export const RestClientContext = React.createContext( client ); +export const RestClientContext = createContext( client ); export class Notifications extends PureComponent { static propTypes = { diff --git a/apps/notifications/src/panel/indices-to-html/index.js b/apps/notifications/src/panel/indices-to-html/index.js index c4cf0a4f911c28..2212992d77a0cf 100644 --- a/apps/notifications/src/panel/indices-to-html/index.js +++ b/apps/notifications/src/panel/indices-to-html/index.js @@ -1,4 +1,4 @@ -import React from 'react'; +import { createElement } from 'react'; import ReactDOMServer from 'react-dom/server'; import Gridicon from '../templates/gridicons'; import noticon2gridicon from '../utils/noticon2gridicon'; @@ -109,7 +109,7 @@ function render_range( new_sub_text, new_sub_range, range_info, range_data, opti // Gridicons have special text, and are thus not recursed into new_container = document.createElement( 'span' ); new_container.innerHTML = ReactDOMServer.renderToStaticMarkup( - React.createElement( Gridicon, { + createElement( Gridicon, { icon: noticon2gridicon( range_info.value ), size: 18, } ) diff --git a/apps/notifications/src/panel/suggestions/index.jsx b/apps/notifications/src/panel/suggestions/index.jsx index 19277f2dbf920e..1fefe2538afdf4 100644 --- a/apps/notifications/src/panel/suggestions/index.jsx +++ b/apps/notifications/src/panel/suggestions/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { createRef, Component } from 'react'; import { connect } from 'react-redux'; import actions from '../state/actions'; import getSiteSuggestions from '../state/selectors/get-site-suggestions'; @@ -51,8 +51,8 @@ const getSuggestionIndexBySelectedId = function ( suggestions ) { return index > -1 ? index : null; }; -class Suggestions extends React.Component { - suggestionList = React.createRef(); +class Suggestions extends Component { + suggestionList = createRef(); suggestionNodes = {}; state = {}; diff --git a/apps/notifications/src/panel/suggestions/suggestion.jsx b/apps/notifications/src/panel/suggestions/suggestion.jsx index a8ef077688b2ff..cb1458e79f6c07 100644 --- a/apps/notifications/src/panel/suggestions/suggestion.jsx +++ b/apps/notifications/src/panel/suggestions/suggestion.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { Component } from 'react'; const getRegExpFor = function ( type, textToHighlight ) { const expressions = {}; @@ -29,7 +29,7 @@ const highlight = ( content, textToHighlight, type ) => { )[ 0 ]; }; -export class Suggestion extends React.Component { +export class Suggestion extends Component { render() { const username = highlight( this.props.username, this.props.suggestionsQuery, 'username' ); username.unshift( { type: 'text', text: '@' } ); diff --git a/apps/notifications/src/panel/templates/action-button.jsx b/apps/notifications/src/panel/templates/action-button.jsx index e0b518e449003f..cd1fecfb428888 100644 --- a/apps/notifications/src/panel/templates/action-button.jsx +++ b/apps/notifications/src/panel/templates/action-button.jsx @@ -1,6 +1,5 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; import HotkeyContainer from './container-hotkey'; import Gridicon from './gridicons'; diff --git a/apps/notifications/src/panel/templates/actions.jsx b/apps/notifications/src/panel/templates/actions.jsx index 6850feb21c1a1b..353f27b7680d3e 100644 --- a/apps/notifications/src/panel/templates/actions.jsx +++ b/apps/notifications/src/panel/templates/actions.jsx @@ -1,6 +1,5 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import { getActions, getReferenceId } from '../helpers/notes'; import getIsNoteApproved from '../state/selectors/get-is-note-approved'; diff --git a/apps/notifications/src/panel/templates/block-comment.jsx b/apps/notifications/src/panel/templates/block-comment.jsx index f1f1ef2ab92c83..4340673aed8827 100644 --- a/apps/notifications/src/panel/templates/block-comment.jsx +++ b/apps/notifications/src/panel/templates/block-comment.jsx @@ -1,5 +1,4 @@ import classNames from 'classnames'; -import React from 'react'; import { html } from '../indices-to-html'; import { p } from './functions'; diff --git a/apps/notifications/src/panel/templates/block-post.jsx b/apps/notifications/src/panel/templates/block-post.jsx index 8abbeec3c1c4ac..a9e5cc7509f1ca 100644 --- a/apps/notifications/src/panel/templates/block-post.jsx +++ b/apps/notifications/src/panel/templates/block-post.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { html } from '../indices-to-html'; import { p } from './functions'; diff --git a/apps/notifications/src/panel/templates/block-user.jsx b/apps/notifications/src/panel/templates/block-user.jsx index efc3ef6e69a1b0..883e6e01d6c744 100644 --- a/apps/notifications/src/panel/templates/block-user.jsx +++ b/apps/notifications/src/panel/templates/block-user.jsx @@ -1,6 +1,6 @@ import { localize, getLocaleSlug } from 'i18n-calypso'; import moment from 'moment'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import getIsNoteApproved from '../state/selectors/get-is-note-approved'; import FollowLink from './follow-link'; @@ -12,7 +12,7 @@ function getDisplayURL( url ) { return ( parser.hostname + parser.pathname ).replace( /\/$/, '' ); } -export class UserBlock extends React.Component { +export class UserBlock extends Component { /** * Format a timestamp for showing how long * ago an event occurred. Specifically here diff --git a/apps/notifications/src/panel/templates/body.jsx b/apps/notifications/src/panel/templates/body.jsx index 3319d55413b96a..8d4108c87e9c2a 100644 --- a/apps/notifications/src/panel/templates/body.jsx +++ b/apps/notifications/src/panel/templates/body.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { html } from '../indices-to-html'; import { bumpStat } from '../rest-client/bump-stat'; import { wpcom } from '../rest-client/wpcom'; @@ -19,7 +19,7 @@ function ReplyBlock( { block } ) { return
{ replyText }
; } -export class NoteBody extends React.Component { +export class NoteBody extends Component { state = { reply: null, }; diff --git a/apps/notifications/src/panel/templates/button-approve.jsx b/apps/notifications/src/panel/templates/button-approve.jsx index d81fc5a7fa686d..a0fe66a22399f8 100644 --- a/apps/notifications/src/panel/templates/button-approve.jsx +++ b/apps/notifications/src/panel/templates/button-approve.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { connect } from 'react-redux'; import { RestClientContext } from '../Notifications'; import { keys } from '../helpers/input'; diff --git a/apps/notifications/src/panel/templates/button-back.jsx b/apps/notifications/src/panel/templates/button-back.jsx index 9b99b5784489c8..2f3db4deb3ecda 100644 --- a/apps/notifications/src/panel/templates/button-back.jsx +++ b/apps/notifications/src/panel/templates/button-back.jsx @@ -1,6 +1,5 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import actions from '../state/actions'; import Gridicon from './gridicons'; diff --git a/apps/notifications/src/panel/templates/button-edit.jsx b/apps/notifications/src/panel/templates/button-edit.jsx index 95ea3fa2979e02..ade23ec8a4eae2 100644 --- a/apps/notifications/src/panel/templates/button-edit.jsx +++ b/apps/notifications/src/panel/templates/button-edit.jsx @@ -1,6 +1,5 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import { keys } from '../helpers/input'; import { getEditCommentLink } from '../helpers/notes'; diff --git a/apps/notifications/src/panel/templates/button-like.jsx b/apps/notifications/src/panel/templates/button-like.jsx index 0c2e98848eaa43..7bb8ad72b17885 100644 --- a/apps/notifications/src/panel/templates/button-like.jsx +++ b/apps/notifications/src/panel/templates/button-like.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { connect } from 'react-redux'; import { RestClientContext } from '../Notifications'; import { keys } from '../helpers/input'; diff --git a/apps/notifications/src/panel/templates/button-spam.jsx b/apps/notifications/src/panel/templates/button-spam.jsx index 6810689eabd1b9..ad2583a6db96fb 100644 --- a/apps/notifications/src/panel/templates/button-spam.jsx +++ b/apps/notifications/src/panel/templates/button-spam.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { connect } from 'react-redux'; import { RestClientContext } from '../Notifications'; import { keys } from '../helpers/input'; diff --git a/apps/notifications/src/panel/templates/button-trash.jsx b/apps/notifications/src/panel/templates/button-trash.jsx index 79354d7d38edbf..dd47d508328048 100644 --- a/apps/notifications/src/panel/templates/button-trash.jsx +++ b/apps/notifications/src/panel/templates/button-trash.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { connect } from 'react-redux'; import { RestClientContext } from '../Notifications'; import { keys } from '../helpers/input'; diff --git a/apps/notifications/src/panel/templates/comment-reply-input.jsx b/apps/notifications/src/panel/templates/comment-reply-input.jsx index ded235263aaba0..681903b65cb0b4 100644 --- a/apps/notifications/src/panel/templates/comment-reply-input.jsx +++ b/apps/notifications/src/panel/templates/comment-reply-input.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; +import { createRef, Component } from 'react'; import { connect } from 'react-redux'; import repliesCache from '../comment-replies-cache'; import { modifierKeyIsActive } from '../helpers/input'; @@ -18,8 +18,8 @@ function stopEvent( event ) { event.preventDefault(); } -class CommentReplyInput extends React.Component { - replyInput = React.createRef(); +class CommentReplyInput extends Component { + replyInput = createRef(); constructor( props ) { super( props ); diff --git a/apps/notifications/src/panel/templates/empty-message.jsx b/apps/notifications/src/panel/templates/empty-message.jsx index 0d87c28b4ed939..52d65258e71c0a 100644 --- a/apps/notifications/src/panel/templates/empty-message.jsx +++ b/apps/notifications/src/panel/templates/empty-message.jsx @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import { bumpStat } from '../rest-client/bump-stat'; // from $wpnc__title-bar-height in boot/sizes.scss diff --git a/apps/notifications/src/panel/templates/error.jsx b/apps/notifications/src/panel/templates/error.jsx index f902804e8b270d..de38202595c639 100644 --- a/apps/notifications/src/panel/templates/error.jsx +++ b/apps/notifications/src/panel/templates/error.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - export const Error = ( { error } ) =>
{ error }
; export default Error; diff --git a/apps/notifications/src/panel/templates/filter-bar.jsx b/apps/notifications/src/panel/templates/filter-bar.jsx index 153fdd70e58917..a9e74561886ec2 100644 --- a/apps/notifications/src/panel/templates/filter-bar.jsx +++ b/apps/notifications/src/panel/templates/filter-bar.jsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import getFilterName from '../state/selectors/get-filter-name'; import Filters from './filters'; diff --git a/apps/notifications/src/panel/templates/follow-link.jsx b/apps/notifications/src/panel/templates/follow-link.jsx index 1fd0ba419ff21f..4e3b8108411b97 100644 --- a/apps/notifications/src/panel/templates/follow-link.jsx +++ b/apps/notifications/src/panel/templates/follow-link.jsx @@ -1,6 +1,6 @@ import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { useState } from 'react'; import useSafe from '../helpers/use-safe'; import { bumpStat } from '../rest-client/bump-stat'; import { wpcom } from '../rest-client/wpcom'; @@ -17,8 +17,8 @@ const followStatTypes = { export const FollowLink = ( { site, noteType, isFollowing: initialIsFollowing } ) => { const translate = useTranslate(); - const [ isRequestRunning, setIsRequestRunning ] = React.useState( false ); - const [ isFollowing, setIsFollowing ] = React.useState( initialIsFollowing ); + const [ isRequestRunning, setIsRequestRunning ] = useState( false ); + const [ isFollowing, setIsFollowing ] = useState( initialIsFollowing ); const safeSetIsFollowing = useSafe( setIsFollowing ); const safeSetIsRequestRunning = useSafe( setIsRequestRunning ); diff --git a/apps/notifications/src/panel/templates/functions.jsx b/apps/notifications/src/panel/templates/functions.jsx index 4eaffeeaac1489..6068d9243610da 100644 --- a/apps/notifications/src/panel/templates/functions.jsx +++ b/apps/notifications/src/panel/templates/functions.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { html as toHtml } from '../indices-to-html'; /** diff --git a/apps/notifications/src/panel/templates/gridicons.jsx b/apps/notifications/src/panel/templates/gridicons.jsx index 0400d4751258e4..34faddc24b2a17 100644 --- a/apps/notifications/src/panel/templates/gridicons.jsx +++ b/apps/notifications/src/panel/templates/gridicons.jsx @@ -1,8 +1,8 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; -export default class extends React.Component { +export default class extends Component { static displayName = 'Gridicons'; static propTypes = { diff --git a/apps/notifications/src/panel/templates/image-loader.jsx b/apps/notifications/src/panel/templates/image-loader.jsx index d31a88fa1800c3..1a1609fbcee608 100644 --- a/apps/notifications/src/panel/templates/image-loader.jsx +++ b/apps/notifications/src/panel/templates/image-loader.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; /** * Module variables diff --git a/apps/notifications/src/panel/templates/index.jsx b/apps/notifications/src/panel/templates/index.jsx index a7d40892f32f84..92e4b8e2e3400d 100644 --- a/apps/notifications/src/panel/templates/index.jsx +++ b/apps/notifications/src/panel/templates/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { Component } from 'react'; import ReactDOM from 'react-dom'; import { connect } from 'react-redux'; import { modifierKeyIsActive } from '../helpers/input'; @@ -62,7 +62,7 @@ export const findNextNoteId = ( noteId, notes ) => { return notes[ nextIndex ].id; }; -class Layout extends React.Component { +class Layout extends Component { state = { lastSelectedIndex: 0, navigationEnabled: true, diff --git a/apps/notifications/src/panel/templates/list-header.jsx b/apps/notifications/src/panel/templates/list-header.jsx index a9a8c6f4b4e481..5987ea7b46f9bd 100644 --- a/apps/notifications/src/panel/templates/list-header.jsx +++ b/apps/notifications/src/panel/templates/list-header.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import actions from '../state/actions'; import Gridicon from './gridicons'; diff --git a/apps/notifications/src/panel/templates/nav-button.jsx b/apps/notifications/src/panel/templates/nav-button.jsx index 1707d23ecbf74e..58e79197a18bee 100644 --- a/apps/notifications/src/panel/templates/nav-button.jsx +++ b/apps/notifications/src/panel/templates/nav-button.jsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import Gridicon from './gridicons'; const noop = () => {}; diff --git a/apps/notifications/src/panel/templates/note-list.jsx b/apps/notifications/src/panel/templates/note-list.jsx index 9dd5c6b1e89182..84bc5b500a7f12 100644 --- a/apps/notifications/src/panel/templates/note-list.jsx +++ b/apps/notifications/src/panel/templates/note-list.jsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import ReactDOM from 'react-dom'; import { connect } from 'react-redux'; import actions from '../state/actions'; @@ -23,7 +23,7 @@ const DAY_MILLISECONDS = 24 * 60 * 60 * 1000; // from $wpnc__title-bar-height in boot/sizes.scss const TITLE_OFFSET = 38; -export class NoteList extends React.Component { +export class NoteList extends Component { static defaultProps = { scrollTimeout: 200, }; diff --git a/apps/notifications/src/panel/templates/note.jsx b/apps/notifications/src/panel/templates/note.jsx index 4e1a6b4c2c4815..06d160565c500d 100644 --- a/apps/notifications/src/panel/templates/note.jsx +++ b/apps/notifications/src/panel/templates/note.jsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import * as React from 'react'; import { connect } from 'react-redux'; import { getActions } from '../helpers/notes'; import getIsNoteApproved from '../state/selectors/get-is-note-approved'; diff --git a/apps/notifications/src/panel/templates/preface.jsx b/apps/notifications/src/panel/templates/preface.jsx index 20829c116bd594..766f053063038f 100644 --- a/apps/notifications/src/panel/templates/preface.jsx +++ b/apps/notifications/src/panel/templates/preface.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { pSoup } from './functions'; export const Preface = ( { blocks } ) =>
{ pSoup( blocks ) }
; diff --git a/apps/notifications/src/panel/templates/spinner.jsx b/apps/notifications/src/panel/templates/spinner.jsx index 3987a5e2d5f1ac..b9f99d6c92382b 100644 --- a/apps/notifications/src/panel/templates/spinner.jsx +++ b/apps/notifications/src/panel/templates/spinner.jsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; export default class Spinner extends PureComponent { static propTypes = { diff --git a/apps/notifications/src/panel/templates/status-bar.jsx b/apps/notifications/src/panel/templates/status-bar.jsx index bfec82df2cbc89..e38cb889091917 100644 --- a/apps/notifications/src/panel/templates/status-bar.jsx +++ b/apps/notifications/src/panel/templates/status-bar.jsx @@ -1,7 +1,7 @@ -import React from 'react'; +import { Component } from 'react'; import Gridicon from './gridicons'; -export class StatusBar extends React.Component { +export class StatusBar extends Component { static defaultProps = { statusTimeout: 4000, }; diff --git a/apps/notifications/src/panel/templates/summary-in-list.jsx b/apps/notifications/src/panel/templates/summary-in-list.jsx index 9d3ba1d28499c8..b5bc192f8aa459 100644 --- a/apps/notifications/src/panel/templates/summary-in-list.jsx +++ b/apps/notifications/src/panel/templates/summary-in-list.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { recordTracksEvent } from '../helpers/stats'; import { html } from '../indices-to-html'; @@ -7,7 +7,7 @@ import noticon2gridicon from '../utils/noticon2gridicon'; import Gridicon from './gridicons'; import ImagePreloader from './image-loader'; -export class SummaryInList extends React.Component { +export class SummaryInList extends Component { handleClick = ( event ) => { event.stopPropagation(); event.preventDefault(); diff --git a/apps/notifications/src/panel/templates/summary-in-single.jsx b/apps/notifications/src/panel/templates/summary-in-single.jsx index 35cca0b7a0e7d6..8a77809215133f 100644 --- a/apps/notifications/src/panel/templates/summary-in-single.jsx +++ b/apps/notifications/src/panel/templates/summary-in-single.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { Component, createFactory } from 'react'; import { html } from '../indices-to-html'; import { linkProps } from './functions'; @@ -8,7 +8,7 @@ const Snippet = ( { note, snippet, url } ) => ( ); -class UserHeader extends React.Component { +class UserHeader extends Component { render() { const grav = this.props.user.media[ 0 ]; const grav_tag = ; @@ -61,8 +61,8 @@ class UserHeader extends React.Component { } } -const Header = React.createFactory( - class extends React.Component { +const Header = createFactory( + class extends Component { render() { const subject = (
{ document.body.classList.add( 'font-smoothing-antialiased' ); ReactDOM.render( - React.createElement( AuthWrapper( Notifications ), { + createElement( AuthWrapper( Notifications ), { customEnhancer, customMiddleware, isShowing, diff --git a/babel.config.js b/babel.config.js index 9f5500dec9f633..08de75c598f929 100644 --- a/babel.config.js +++ b/babel.config.js @@ -3,7 +3,9 @@ const isBrowser = process.env.BROWSERSLIST_ENV !== 'server'; // We implicitly use browserslist configuration in package.json for build targets. const babelConfig = { - presets: [ [ '@automattic/calypso-build/babel/default', { bugfixes: true } ] ], + presets: [ + [ '@automattic/calypso-build/babel/default', { bugfixes: true, runtime: 'automatic' } ], + ], plugins: [ [ '@automattic/transform-wpcalypso-async', { async: true, ignore: ! isBrowser } ] ], env: { production: { diff --git a/client/blocks/all-sites/all-sites-icon.jsx b/client/blocks/all-sites/all-sites-icon.jsx index f8368613271186..caa26a06b65266 100644 --- a/client/blocks/all-sites/all-sites-icon.jsx +++ b/client/blocks/all-sites/all-sites-icon.jsx @@ -1,12 +1,12 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import SiteIcon from 'calypso/blocks/site-icon'; import './all-sites-icon.scss'; const MAX_ICONS = 10; -export default class AllSitesIcon extends React.Component { +export default class AllSitesIcon extends Component { static propTypes = { sites: PropTypes.array.isRequired, }; diff --git a/client/blocks/all-sites/docs/example.jsx b/client/blocks/all-sites/docs/example.jsx index 6585bc883c5f3a..e9335d0934c726 100644 --- a/client/blocks/all-sites/docs/example.jsx +++ b/client/blocks/all-sites/docs/example.jsx @@ -1,5 +1,4 @@ import { Card } from '@automattic/components'; -import React from 'react'; import AllSites from 'calypso/blocks/all-sites'; const AllSitesExample = () => ( diff --git a/client/blocks/all-sites/index.jsx b/client/blocks/all-sites/index.jsx index 376763d6a5ccd2..e580c6477409c2 100644 --- a/client/blocks/all-sites/index.jsx +++ b/client/blocks/all-sites/index.jsx @@ -2,7 +2,7 @@ import config from '@automattic/calypso-config'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Count from 'calypso/components/count'; import { getCurrentUserVisibleSiteCount } from 'calypso/state/current-user/selectors'; diff --git a/client/blocks/app-banner/index.jsx b/client/blocks/app-banner/index.jsx index 58bbfcd8fa8182..153cc89aeca929 100644 --- a/client/blocks/app-banner/index.jsx +++ b/client/blocks/app-banner/index.jsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { get, includes } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import ReactDom from 'react-dom'; import { connect } from 'react-redux'; import TrackComponentView from 'calypso/lib/analytics/track-component-view'; diff --git a/client/blocks/app-promo/index.jsx b/client/blocks/app-promo/index.jsx index bb2bdf39b38d6d..532621b0f70d1e 100644 --- a/client/blocks/app-promo/index.jsx +++ b/client/blocks/app-promo/index.jsx @@ -3,7 +3,7 @@ import { Button } from '@wordpress/components'; import { localize } from 'i18n-calypso'; import { sample } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import store from 'store'; import wordpressLogoImage from 'calypso/assets/images/illustrations/logo-jpc.svg'; @@ -54,7 +54,7 @@ export const getPromoLink = ( location, promoDetails ) => { return `https://apps.wordpress.com/${ type }/?ref=promo_${ location }_${ promoCode }`; }; -export class AppPromo extends React.Component { +export class AppPromo extends Component { static displayName = 'AppPromo'; static propTypes = { diff --git a/client/blocks/app-promo/test/index.jsx b/client/blocks/app-promo/test/index.jsx index 05e8525cdc2471..152f2d5252d874 100644 --- a/client/blocks/app-promo/test/index.jsx +++ b/client/blocks/app-promo/test/index.jsx @@ -4,7 +4,6 @@ import { expect } from 'chai'; import { shallow, mount } from 'enzyme'; -import React from 'react'; describe( 'AppPromo', () => { const appPromoDetails = { diff --git a/client/blocks/author-compact-profile/docs/example.jsx b/client/blocks/author-compact-profile/docs/example.jsx index ce56721cb4692f..8f221010cc415b 100644 --- a/client/blocks/author-compact-profile/docs/example.jsx +++ b/client/blocks/author-compact-profile/docs/example.jsx @@ -1,8 +1,8 @@ import { Card } from '@automattic/components'; -import React from 'react'; +import { Component } from 'react'; import AuthorCompactProfile from 'calypso/blocks/author-compact-profile'; -export default class AuthorCompactProfileExample extends React.Component { +export default class AuthorCompactProfileExample extends Component { static displayName = 'AuthorCompactProfileExample'; render() { diff --git a/client/blocks/author-compact-profile/index.jsx b/client/blocks/author-compact-profile/index.jsx index 9d6a33588f81ca..f4591035a2f41e 100644 --- a/client/blocks/author-compact-profile/index.jsx +++ b/client/blocks/author-compact-profile/index.jsx @@ -2,7 +2,7 @@ import classnames from 'classnames'; import { numberFormat, localize } from 'i18n-calypso'; import { has } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import ReaderAuthorLink from 'calypso/blocks/reader-author-link'; import ReaderAvatar from 'calypso/blocks/reader-avatar'; import ReaderSiteStreamLink from 'calypso/blocks/reader-site-stream-link'; @@ -13,7 +13,7 @@ import AuthorCompactProfilePlaceholder from './placeholder'; import './style.scss'; -class AuthorCompactProfile extends React.Component { +class AuthorCompactProfile extends Component { static propTypes = { author: PropTypes.object, siteName: PropTypes.string, diff --git a/client/blocks/author-compact-profile/placeholder.jsx b/client/blocks/author-compact-profile/placeholder.jsx index 437b73ce12ecb3..f08d905bdb6b57 100644 --- a/client/blocks/author-compact-profile/placeholder.jsx +++ b/client/blocks/author-compact-profile/placeholder.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReaderAvatar from 'calypso/blocks/reader-avatar'; const AuthorCompactProfilePlaceholder = () => { diff --git a/client/blocks/author-selector/docs/example.jsx b/client/blocks/author-selector/docs/example.jsx index f8f9190e8a2082..0f5820f77dc9b3 100644 --- a/client/blocks/author-selector/docs/example.jsx +++ b/client/blocks/author-selector/docs/example.jsx @@ -1,5 +1,4 @@ import { Card } from '@automattic/components'; -import React from 'react'; import { connect } from 'react-redux'; import { getCurrentUser } from 'calypso/state/current-user/selectors'; import AuthorSelector from '../'; diff --git a/client/blocks/author-selector/index.jsx b/client/blocks/author-selector/index.jsx index e5b5b54911224d..d939ed6d996394 100644 --- a/client/blocks/author-selector/index.jsx +++ b/client/blocks/author-selector/index.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { useState } from 'react'; import useUsersQuery from 'calypso/data/users/use-users-query'; import SwitcherShell from './switcher-shell'; @@ -15,8 +15,8 @@ const AuthorSelector = ( { siteId, transformAuthor, } ) => { - const [ search, setSearch ] = React.useState( '' ); - const [ prevSiteId, setPrevSiteId ] = React.useState( null ); + const [ search, setSearch ] = useState( '' ); + const [ prevSiteId, setPrevSiteId ] = useState( null ); if ( siteId && siteId !== prevSiteId ) { setPrevSiteId( siteId ); diff --git a/client/blocks/author-selector/switcher-shell.jsx b/client/blocks/author-selector/switcher-shell.jsx index 46670af0bac337..7add13716c7c19 100644 --- a/client/blocks/author-selector/switcher-shell.jsx +++ b/client/blocks/author-selector/switcher-shell.jsx @@ -2,7 +2,7 @@ import { Gridicon, Popover } from '@automattic/components'; import debugModule from 'debug'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component, createRef } from 'react'; +import { Component, createRef } from 'react'; import ReactDom from 'react-dom'; import AsyncLoad from 'calypso/components/async-load'; import InfiniteList from 'calypso/components/infinite-list'; diff --git a/client/blocks/blog-stickers/index.jsx b/client/blocks/blog-stickers/index.jsx index 9091263fefc80e..8fb5268f61f5fc 100644 --- a/client/blocks/blog-stickers/index.jsx +++ b/client/blocks/blog-stickers/index.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import BlogStickersList from 'calypso/blocks/blog-stickers/list'; import QueryBlogStickers from 'calypso/components/data/query-blog-stickers'; diff --git a/client/blocks/blog-stickers/list.jsx b/client/blocks/blog-stickers/list.jsx index 6191ed85df669a..7b9a50e199e931 100644 --- a/client/blocks/blog-stickers/list.jsx +++ b/client/blocks/blog-stickers/list.jsx @@ -1,6 +1,5 @@ import { localize } from 'i18n-calypso'; import { map } from 'lodash'; -import React from 'react'; const BlogStickersList = ( { stickers, translate } ) => { return ( diff --git a/client/blocks/calendar-button/docs/example.jsx b/client/blocks/calendar-button/docs/example.jsx index 147b2ae1ad9638..bb9dc550a7d833 100644 --- a/client/blocks/calendar-button/docs/example.jsx +++ b/client/blocks/calendar-button/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import CalendarButton from 'calypso/blocks/calendar-button'; const CalendarButtonExample = () => { diff --git a/client/blocks/calendar-button/index.jsx b/client/blocks/calendar-button/index.jsx index 60e9cab7d4e504..d2f1ae6d448192 100644 --- a/client/blocks/calendar-button/index.jsx +++ b/client/blocks/calendar-button/index.jsx @@ -2,7 +2,7 @@ import { Button, Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { pick } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { createRef, Component, Fragment } from 'react'; import AsyncLoad from 'calypso/components/async-load'; const noop = () => {}; @@ -61,7 +61,7 @@ class CalendarButton extends Component { this.setState( { showPopover: ! this.state.showPopover } ); }; - buttonRef = React.createRef(); + buttonRef = createRef(); renderCalendarPopover() { if ( ! this.state.showPopover ) { diff --git a/client/blocks/calendar-popover/docs/example.jsx b/client/blocks/calendar-popover/docs/example.jsx index abe2732ad1cfea..2af54265492a09 100644 --- a/client/blocks/calendar-popover/docs/example.jsx +++ b/client/blocks/calendar-popover/docs/example.jsx @@ -1,12 +1,12 @@ import { Button } from '@automattic/components'; import moment from 'moment'; -import React, { PureComponent } from 'react'; +import { createRef, PureComponent } from 'react'; import CalendarPopover from 'calypso/blocks/calendar-popover'; const tomorrow = ( date ) => date.date( date.date() + 1 ); class CalendarPopoverExample extends PureComponent { - buttonRef = React.createRef(); + buttonRef = createRef(); state = { show: false, currentDate: tomorrow( moment() ) }; diff --git a/client/blocks/calendar-popover/index.jsx b/client/blocks/calendar-popover/index.jsx index 3785a9b5cb082b..3eda16986bcd8d 100644 --- a/client/blocks/calendar-popover/index.jsx +++ b/client/blocks/calendar-popover/index.jsx @@ -1,7 +1,7 @@ import { Popover } from '@automattic/components'; import { pick } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import PostSchedule from 'calypso/components/post-schedule'; import getSiteGmtOffset from 'calypso/state/selectors/get-site-gmt-offset'; diff --git a/client/blocks/color-scheme-picker/docs/example.jsx b/client/blocks/color-scheme-picker/docs/example.jsx index c1b53762a1e27d..16bcdeadc14da1 100644 --- a/client/blocks/color-scheme-picker/docs/example.jsx +++ b/client/blocks/color-scheme-picker/docs/example.jsx @@ -1,5 +1,5 @@ import { Card } from '@automattic/components'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import ColorSchemePicker from 'calypso/blocks/color-scheme-picker'; class ColorSchemePickerExample extends PureComponent { diff --git a/client/blocks/color-scheme-picker/index.jsx b/client/blocks/color-scheme-picker/index.jsx index e9f8e179569c75..f1a737e391128f 100644 --- a/client/blocks/color-scheme-picker/index.jsx +++ b/client/blocks/color-scheme-picker/index.jsx @@ -1,7 +1,7 @@ import { translate, localize } from 'i18n-calypso'; import { find } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import QueryPreferences from 'calypso/components/data/query-preferences'; import FormRadiosBar from 'calypso/components/forms/form-radios-bar'; diff --git a/client/blocks/comment-button/docs/example.jsx b/client/blocks/comment-button/docs/example.jsx index de9bbfe48065e8..278c3ea6820438 100644 --- a/client/blocks/comment-button/docs/example.jsx +++ b/client/blocks/comment-button/docs/example.jsx @@ -1,8 +1,8 @@ import { Card } from '@automattic/components'; -import React from 'react'; +import { Component } from 'react'; import CommentButton from 'calypso/blocks/comment-button'; -export default class CommentButtonExample extends React.Component { +export default class CommentButtonExample extends Component { static displayName = 'CommentButtonExample'; render() { diff --git a/client/blocks/comment-button/index.jsx b/client/blocks/comment-button/index.jsx index 1b091f88d9cc89..7113fb17ada871 100644 --- a/client/blocks/comment-button/index.jsx +++ b/client/blocks/comment-button/index.jsx @@ -2,7 +2,7 @@ import { Gridicon } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import { omitBy } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createElement } from 'react'; import { connect } from 'react-redux'; import { getPostTotalCommentsCount } from 'calypso/state/comments/selectors'; @@ -14,7 +14,7 @@ function CommentButton( props ) { const { commentCount, href, onClick, showLabel, tagName, target } = props; const translate = useTranslate(); - return React.createElement( + return createElement( tagName, omitBy( { diff --git a/client/blocks/comments/autoresizing-form-textarea.jsx b/client/blocks/comments/autoresizing-form-textarea.jsx index a5ec7372d781cd..c77c9e0b0e1299 100644 --- a/client/blocks/comments/autoresizing-form-textarea.jsx +++ b/client/blocks/comments/autoresizing-form-textarea.jsx @@ -1,5 +1,5 @@ import classnames from 'classnames'; -import React, { forwardRef } from 'react'; +import { forwardRef } from 'react'; import withUserMentions from 'calypso/blocks/user-mentions/index'; import AutoDirection from 'calypso/components/auto-direction'; import FormTextarea from 'calypso/components/forms/form-textarea'; diff --git a/client/blocks/comments/block-editor/autocompleters/user.jsx b/client/blocks/comments/block-editor/autocompleters/user.jsx index e3b5cf659d785e..17b302a234bdf9 100644 --- a/client/blocks/comments/block-editor/autocompleters/user.jsx +++ b/client/blocks/comments/block-editor/autocompleters/user.jsx @@ -1,7 +1,5 @@ /* eslint-disable wpcalypso/jsx-classname-namespace */ -import React from 'react'; - export default ( suggestions ) => ( { name: 'users', className: 'editor-autocompleters__user', diff --git a/client/blocks/comments/block-editor/autocompleters/xpost.jsx b/client/blocks/comments/block-editor/autocompleters/xpost.jsx index c39092eac776f9..41984a92726b3d 100644 --- a/client/blocks/comments/block-editor/autocompleters/xpost.jsx +++ b/client/blocks/comments/block-editor/autocompleters/xpost.jsx @@ -1,6 +1,5 @@ /* eslint-disable wpcalypso/jsx-classname-namespace */ -import React from 'react'; import wpcom from 'calypso/lib/wp'; export default () => ( { diff --git a/client/blocks/comments/block-editor/index.jsx b/client/blocks/comments/block-editor/index.jsx index e22151fd732107..f4be2b34fa71d1 100644 --- a/client/blocks/comments/block-editor/index.jsx +++ b/client/blocks/comments/block-editor/index.jsx @@ -1,6 +1,6 @@ import IsolatedBlockEditor from '@automattic/isolated-block-editor'; import { addFilter } from '@wordpress/hooks'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import connectUserMentions from 'calypso/blocks/user-mentions/connect'; import getAddAutocompleters from './autocompleters'; diff --git a/client/blocks/comments/comment-actions.jsx b/client/blocks/comments/comment-actions.jsx index e7e9b0d15902d0..2db5f04cc11d09 100644 --- a/client/blocks/comments/comment-actions.jsx +++ b/client/blocks/comments/comment-actions.jsx @@ -2,7 +2,6 @@ import { Gridicon } from '@automattic/components'; import { Button } from '@wordpress/components'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import EllipsisMenu from 'calypso/components/ellipsis-menu'; import PopoverMenuItem from 'calypso/components/popover-menu/item'; diff --git a/client/blocks/comments/comment-approve-action.jsx b/client/blocks/comments/comment-approve-action.jsx index 3aac3bfd99a9d2..42962e213bacc1 100644 --- a/client/blocks/comments/comment-approve-action.jsx +++ b/client/blocks/comments/comment-approve-action.jsx @@ -3,7 +3,6 @@ import { Button } from '@wordpress/components'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import './comment-approve-action.scss'; diff --git a/client/blocks/comments/comment-count.jsx b/client/blocks/comments/comment-count.jsx index e05f64547fbd69..b37361f2c0bf24 100644 --- a/client/blocks/comments/comment-count.jsx +++ b/client/blocks/comments/comment-count.jsx @@ -1,6 +1,5 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import './comment-count.scss'; diff --git a/client/blocks/comments/comment-edit-form.jsx b/client/blocks/comments/comment-edit-form.jsx index 36d09e4f2dc4e2..2c0e9689cde636 100644 --- a/client/blocks/comments/comment-edit-form.jsx +++ b/client/blocks/comments/comment-edit-form.jsx @@ -2,7 +2,7 @@ import { isEnabled } from '@automattic/calypso-config'; import classNames from 'classnames'; import { translate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import AsyncLoad from 'calypso/components/async-load'; import FormFieldset from 'calypso/components/forms/form-fieldset'; diff --git a/client/blocks/comments/comment-likes.jsx b/client/blocks/comments/comment-likes.jsx index 77de75663cd6f7..59c4354f2a6ca9 100644 --- a/client/blocks/comments/comment-likes.jsx +++ b/client/blocks/comments/comment-likes.jsx @@ -1,7 +1,7 @@ import { translate } from 'i18n-calypso'; import { get, pick } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import LikeButton from 'calypso/blocks/like-button/button'; import { recordAction, recordGaEvent } from 'calypso/reader/stats'; @@ -9,7 +9,7 @@ import { likeComment, unlikeComment } from 'calypso/state/comments/actions'; import { getCommentLike } from 'calypso/state/comments/selectors'; import { recordReaderTracksEvent } from 'calypso/state/reader/analytics/actions'; -class CommentLikeButtonContainer extends React.Component { +class CommentLikeButtonContainer extends Component { constructor() { super(); this.boundHandleLikeToggle = this.handleLikeToggle.bind( this ); diff --git a/client/blocks/comments/docs/post-comment-example.jsx b/client/blocks/comments/docs/post-comment-example.jsx index b3999e408826da..9c039598eceb8d 100644 --- a/client/blocks/comments/docs/post-comment-example.jsx +++ b/client/blocks/comments/docs/post-comment-example.jsx @@ -1,5 +1,5 @@ import { Card } from '@automattic/components'; -import React from 'react'; +import { Component } from 'react'; import PostComment from 'calypso/blocks/comments/post-comment'; import { POST_COMMENT_DISPLAY_TYPES } from 'calypso/state/comments/constants'; @@ -79,7 +79,7 @@ const commentsToShow = { 4: excerpt, }; -export default class PostCommentExample extends React.Component { +export default class PostCommentExample extends Component { static displayName = 'PostCommentExample'; render() { diff --git a/client/blocks/comments/form-root.jsx b/client/blocks/comments/form-root.jsx index c92d21c43b4670..5eb4269929ab56 100644 --- a/client/blocks/comments/form-root.jsx +++ b/client/blocks/comments/form-root.jsx @@ -1,6 +1,5 @@ import { some } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import PostCommentForm from './form'; const noop = () => {}; diff --git a/client/blocks/comments/form.jsx b/client/blocks/comments/form.jsx index e255354647e440..355fd3226ac096 100644 --- a/client/blocks/comments/form.jsx +++ b/client/blocks/comments/form.jsx @@ -3,7 +3,7 @@ import { Button } from '@automattic/components'; import classNames from 'classnames'; import { translate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { isCommentableDiscoverPost } from 'calypso/blocks/comments/helper'; import AsyncLoad from 'calypso/components/async-load'; @@ -20,7 +20,7 @@ import './form.scss'; const noop = () => {}; -class PostCommentForm extends React.Component { +class PostCommentForm extends Component { constructor( props ) { super(); diff --git a/client/blocks/comments/index.jsx b/client/blocks/comments/index.jsx index a7003cab78b110..4a691eafdd52b8 100644 --- a/client/blocks/comments/index.jsx +++ b/client/blocks/comments/index.jsx @@ -1,12 +1,12 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import { Interval, EVERY_MINUTE } from 'calypso/lib/interval'; import { requestPostComments } from 'calypso/state/comments/actions'; import PostCommentsList from './post-comment-list'; -class PostComments extends React.Component { +class PostComments extends Component { static propTypes = { shouldHighlightNew: PropTypes.bool, post: PropTypes.shape( { diff --git a/client/blocks/comments/post-comment-content.jsx b/client/blocks/comments/post-comment-content.jsx index e999f0597370ee..dcf4766daba03d 100644 --- a/client/blocks/comments/post-comment-content.jsx +++ b/client/blocks/comments/post-comment-content.jsx @@ -1,12 +1,12 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import AutoDirection from 'calypso/components/auto-direction'; import './post-comment-content.scss'; -class PostCommentContent extends React.Component { +class PostCommentContent extends Component { static propTypes = { content: PropTypes.string.isRequired, isPlaceholder: PropTypes.bool, diff --git a/client/blocks/comments/post-comment-list.jsx b/client/blocks/comments/post-comment-list.jsx index 4e4da2d51e9122..7fbc3799cf2166 100644 --- a/client/blocks/comments/post-comment-list.jsx +++ b/client/blocks/comments/post-comment-list.jsx @@ -3,7 +3,7 @@ import classnames from 'classnames'; import { translate } from 'i18n-calypso'; import { get, size, delay } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ConversationFollowButton from 'calypso/blocks/conversation-follow-button'; import { shouldShowConversationFollowButton } from 'calypso/blocks/conversation-follow-button/helper'; @@ -47,7 +47,7 @@ import './post-comment-list.scss'; * */ -class PostCommentList extends React.Component { +class PostCommentList extends Component { static propTypes = { post: PropTypes.shape( { ID: PropTypes.number.isRequired, diff --git a/client/blocks/comments/post-comment-with-error.jsx b/client/blocks/comments/post-comment-with-error.jsx index be1f1a5fa1e5ab..cbd7769cf71294 100644 --- a/client/blocks/comments/post-comment-with-error.jsx +++ b/client/blocks/comments/post-comment-with-error.jsx @@ -1,12 +1,12 @@ import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import PostCommentForm from './form'; import './post-comment.scss'; // intentional, shares styles import './post-comment-with-error.scss'; -export default class PostCommentWithError extends React.Component { +export default class PostCommentWithError extends Component { renderCommentForm() { const { post, commentsTree, commentId, onUpdateCommentText, activeReplyCommentId } = this.props; const commentText = get( commentsTree, [ commentId, 'data', 'content' ] ); diff --git a/client/blocks/comments/post-comment.jsx b/client/blocks/comments/post-comment.jsx index cf8edf283f59a9..61741612361e1b 100644 --- a/client/blocks/comments/post-comment.jsx +++ b/client/blocks/comments/post-comment.jsx @@ -4,7 +4,7 @@ import classnames from 'classnames'; import { translate } from 'i18n-calypso'; import { get, some, flatMap } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import ConversationCaterpillar from 'calypso/blocks/conversation-caterpillar'; import Gravatar from 'calypso/components/gravatar'; @@ -45,7 +45,7 @@ const noop = () => {}; * conversations tool uses a mix depending on the situation. */ -class PostComment extends React.PureComponent { +class PostComment extends PureComponent { static propTypes = { commentsTree: PropTypes.object.isRequired, commentId: PropTypes.oneOfType( [ diff --git a/client/blocks/comments/post-trackback.jsx b/client/blocks/comments/post-trackback.jsx index a3e56727e450d5..6ec6912bf4dc53 100644 --- a/client/blocks/comments/post-trackback.jsx +++ b/client/blocks/comments/post-trackback.jsx @@ -1,7 +1,7 @@ import { Gridicon } from '@automattic/components'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import TimeSince from 'calypso/components/time-since'; import './post-comment.scss'; // yes, this is intentional. they share styles. @@ -10,7 +10,7 @@ function unescape( str ) { return str.replace( /&#(\d+);/g, ( match, entity ) => String.fromCharCode( entity ) ); } -export default class PostTrackback extends React.Component { +export default class PostTrackback extends Component { render() { const commentsTree = this.props.commentsTree; const comment = get( commentsTree[ this.props.commentId ], 'data' ); diff --git a/client/blocks/conversation-caterpillar/docs/example.jsx b/client/blocks/conversation-caterpillar/docs/example.jsx index 08123f8e95a27b..013ad322227e39 100644 --- a/client/blocks/conversation-caterpillar/docs/example.jsx +++ b/client/blocks/conversation-caterpillar/docs/example.jsx @@ -1,6 +1,5 @@ import { Card } from '@automattic/components'; import { size } from 'lodash'; -import React from 'react'; import { ConversationCaterpillar } from 'calypso/blocks/conversation-caterpillar'; import { comments, commentsTree } from 'calypso/blocks/conversation-caterpillar/docs/fixtures'; diff --git a/client/blocks/conversation-caterpillar/index.jsx b/client/blocks/conversation-caterpillar/index.jsx index fba68a7f26314a..1aa355714ef656 100644 --- a/client/blocks/conversation-caterpillar/index.jsx +++ b/client/blocks/conversation-caterpillar/index.jsx @@ -1,7 +1,7 @@ import { localize } from 'i18n-calypso'; import { map, get, last, uniqBy, size, filter, compact } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { isAncestor } from 'calypso/blocks/comments/utils'; import GravatarCaterpillar from 'calypso/components/gravatar-caterpillar'; @@ -16,7 +16,7 @@ import './style.scss'; const MAX_GRAVATARS_TO_DISPLAY = 10; const NUMBER_TO_EXPAND = 10; -class ConversationCaterpillarComponent extends React.Component { +class ConversationCaterpillarComponent extends Component { static propTypes = { blogId: PropTypes.number.isRequired, postId: PropTypes.number.isRequired, diff --git a/client/blocks/conversation-follow-button/button.jsx b/client/blocks/conversation-follow-button/button.jsx index 084c0278e1b340..feee0ecd2d55ea 100644 --- a/client/blocks/conversation-follow-button/button.jsx +++ b/client/blocks/conversation-follow-button/button.jsx @@ -1,11 +1,11 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createElement, Component } from 'react'; const noop = () => {}; -class ConversationFollowButton extends React.Component { +class ConversationFollowButton extends Component { static propTypes = { isFollowing: PropTypes.bool.isRequired, onFollowToggle: PropTypes.func, @@ -55,7 +55,7 @@ class ConversationFollowButton extends React.Component { ); - return React.createElement( + return createElement( this.props.tagName, { onClick: this.toggleFollow, diff --git a/client/blocks/conversation-follow-button/docs/example.jsx b/client/blocks/conversation-follow-button/docs/example.jsx index 7d7a7c6e2ebab8..25dfbe8e14084f 100644 --- a/client/blocks/conversation-follow-button/docs/example.jsx +++ b/client/blocks/conversation-follow-button/docs/example.jsx @@ -2,10 +2,10 @@ */ import { CompactCard as Card } from '@automattic/components'; -import React from 'react'; +import { PureComponent } from 'react'; import ConversationFollowButton from 'calypso/blocks/conversation-follow-button/button'; -export default class ConversationFollowButtonExample extends React.PureComponent { +export default class ConversationFollowButtonExample extends PureComponent { static displayName = 'ConversationFollowButton'; render() { diff --git a/client/blocks/conversation-follow-button/index.jsx b/client/blocks/conversation-follow-button/index.jsx index 3b176c7b798d1e..aede586aacd843 100644 --- a/client/blocks/conversation-follow-button/index.jsx +++ b/client/blocks/conversation-follow-button/index.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { getTracksPropertiesForPost } from 'calypso/reader/stats'; import { recordReaderTracksEvent } from 'calypso/state/reader/analytics/actions'; diff --git a/client/blocks/conversations/docs/example.jsx b/client/blocks/conversations/docs/example.jsx index e21396adb58908..e234d51c2789ed 100644 --- a/client/blocks/conversations/docs/example.jsx +++ b/client/blocks/conversations/docs/example.jsx @@ -1,5 +1,4 @@ import { map, compact } from 'lodash'; -import React from 'react'; import { commentsTree } from 'calypso/blocks/conversations/docs/fixtures'; import { ConversationCommentList } from 'calypso/blocks/conversations/list'; import { posts } from 'calypso/blocks/reader-post-card/docs/fixtures'; diff --git a/client/blocks/conversations/empty.jsx b/client/blocks/conversations/empty.jsx index 7eb199e15512df..0b5a87901ffbe6 100644 --- a/client/blocks/conversations/empty.jsx +++ b/client/blocks/conversations/empty.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import charactersImage from 'calypso/assets/images/reader/reader-conversations-characters.svg'; import EmptyContent from 'calypso/components/empty-content'; @@ -7,7 +7,7 @@ import { withPerformanceTrackerStop } from 'calypso/lib/performance-tracking'; import { recordAction, recordGaEvent } from 'calypso/reader/stats'; import { recordReaderTracksEvent } from 'calypso/state/reader/analytics/actions'; -class ConversationsEmptyContent extends React.Component { +class ConversationsEmptyContent extends Component { shouldComponentUpdate() { return false; } diff --git a/client/blocks/conversations/list.jsx b/client/blocks/conversations/list.jsx index 7dc794f794e124..58594818302a6a 100644 --- a/client/blocks/conversations/list.jsx +++ b/client/blocks/conversations/list.jsx @@ -1,6 +1,6 @@ import { map, zipObject, size, filter, get, compact, partition } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import PostCommentFormRoot from 'calypso/blocks/comments/form-root'; import PostComment from 'calypso/blocks/comments/post-comment'; @@ -49,7 +49,7 @@ import './list.scss'; const FETCH_NEW_COMMENTS_THRESHOLD = 20; const noop = () => {}; -export class ConversationCommentList extends React.Component { +export class ConversationCommentList extends Component { static propTypes = { post: PropTypes.object.isRequired, // required by PostComment commentIds: PropTypes.array.isRequired, diff --git a/client/blocks/daily-post-button/docs/example.jsx b/client/blocks/daily-post-button/docs/example.jsx index 478c199d98eb4a..7a8c4ca07bbc89 100644 --- a/client/blocks/daily-post-button/docs/example.jsx +++ b/client/blocks/daily-post-button/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import DailyPostButton from 'calypso/blocks/daily-post-button'; const DailyPostButtonExample = () => { return ( diff --git a/client/blocks/daily-post-button/index.jsx b/client/blocks/daily-post-button/index.jsx index c2ecee0d31adfd..b829be19e19697 100644 --- a/client/blocks/daily-post-button/index.jsx +++ b/client/blocks/daily-post-button/index.jsx @@ -5,7 +5,7 @@ import { get, defer } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; import { stringify } from 'qs'; -import React from 'react'; +import { createRef, createElement, Component } from 'react'; import { connect } from 'react-redux'; import AsyncLoad from 'calypso/components/async-load'; import { recordGaEvent, recordAction, recordTrackForPost } from 'calypso/reader/stats'; @@ -32,7 +32,7 @@ function getPingbackAttributes( post ) { }; } -export class DailyPostButton extends React.Component { +export class DailyPostButton extends Component { constructor() { super(); this.state = { @@ -41,7 +41,7 @@ export class DailyPostButton extends React.Component { this._closeTimerId = null; this._isMounted = false; - this.dailyPostButtonRef = React.createRef(); + this.dailyPostButtonRef = createRef(); } static propTypes = { @@ -149,7 +149,7 @@ export class DailyPostButton extends React.Component { return null; } - return React.createElement( + return createElement( this.props.tagName, { className: 'daily-post-button', diff --git a/client/blocks/daily-post-button/test/index.jsx b/client/blocks/daily-post-button/test/index.jsx index aeb0e56870e266..dd18e8355ac446 100644 --- a/client/blocks/daily-post-button/test/index.jsx +++ b/client/blocks/daily-post-button/test/index.jsx @@ -6,7 +6,6 @@ import { assert } from 'chai'; import { shallow } from 'enzyme'; import pageSpy from 'page'; import { parse } from 'qs'; -import React from 'react'; import { DailyPostButton } from '../index'; import { sites, dailyPromptPost } from './fixtures'; diff --git a/client/blocks/disconnect-jetpack/index.jsx b/client/blocks/disconnect-jetpack/index.jsx index b05777004c96ef..d4f00ed2c401e5 100644 --- a/client/blocks/disconnect-jetpack/index.jsx +++ b/client/blocks/disconnect-jetpack/index.jsx @@ -3,7 +3,7 @@ import { Button, Card, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import QueryRewindState from 'calypso/components/data/query-rewind-state'; import HappychatButton from 'calypso/components/happychat/button'; diff --git a/client/blocks/dismissible-card/docs/example.jsx b/client/blocks/dismissible-card/docs/example.jsx index 79522afc1ece17..448d22f3e19cff 100644 --- a/client/blocks/dismissible-card/docs/example.jsx +++ b/client/blocks/dismissible-card/docs/example.jsx @@ -1,5 +1,4 @@ import { Button } from '@automattic/components'; -import React from 'react'; import { useDispatch } from 'react-redux'; import { savePreference } from 'calypso/state/preferences/actions'; import DismissibleCard from '../'; diff --git a/client/blocks/dismissible-card/index.jsx b/client/blocks/dismissible-card/index.jsx index 77d7f7747a9e8a..4fcad6c84111f2 100644 --- a/client/blocks/dismissible-card/index.jsx +++ b/client/blocks/dismissible-card/index.jsx @@ -1,6 +1,5 @@ import { Card, Gridicon } from '@automattic/components'; import PropTypes from 'prop-types'; -import React from 'react'; import { useSelector, useDispatch } from 'react-redux'; import QueryPreferences from 'calypso/components/data/query-preferences'; import { savePreference, setPreference } from 'calypso/state/preferences/actions'; diff --git a/client/blocks/domain-tip/docs/example.jsx b/client/blocks/domain-tip/docs/example.jsx index a964abf9a0c079..ec68fa822e9e37 100644 --- a/client/blocks/domain-tip/docs/example.jsx +++ b/client/blocks/domain-tip/docs/example.jsx @@ -1,5 +1,4 @@ import { get } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import { getCurrentUser } from 'calypso/state/current-user/selectors'; import DomainTip from '../index'; diff --git a/client/blocks/domain-tip/index.jsx b/client/blocks/domain-tip/index.jsx index 864e4e6d0d9306..0696f10064c452 100644 --- a/client/blocks/domain-tip/index.jsx +++ b/client/blocks/domain-tip/index.jsx @@ -1,7 +1,7 @@ import { FEATURE_CUSTOM_DOMAIN, isFreePlanProduct } from '@automattic/calypso-products'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import UpsellNudge from 'calypso/blocks/upsell-nudge'; import QueryDomainsSuggestions from 'calypso/components/data/query-domains-suggestions'; @@ -24,7 +24,7 @@ function getQueryObject( site, siteSlug, vendor ) { }; } -class DomainTip extends React.Component { +class DomainTip extends Component { static propTypes = { event: PropTypes.string.isRequired, hasDomainCredit: PropTypes.bool, diff --git a/client/blocks/domain-to-plan-nudge/index.jsx b/client/blocks/domain-to-plan-nudge/index.jsx index d357a2e46a49c0..f8877cc8c8bfc9 100644 --- a/client/blocks/domain-to-plan-nudge/index.jsx +++ b/client/blocks/domain-to-plan-nudge/index.jsx @@ -2,7 +2,7 @@ import { getPlan, PLAN_PERSONAL, FEATURE_NO_ADS } from '@automattic/calypso-prod import formatCurrency from '@automattic/format-currency'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import UpsellNudge from 'calypso/blocks/upsell-nudge'; import QuerySitePlans from 'calypso/components/data/query-site-plans'; diff --git a/client/blocks/edit-gravatar/index.jsx b/client/blocks/edit-gravatar/index.jsx index 888d8bee4f9615..7c0b78b7990d92 100644 --- a/client/blocks/edit-gravatar/index.jsx +++ b/client/blocks/edit-gravatar/index.jsx @@ -3,7 +3,7 @@ import { Dialog, Gridicon } from '@automattic/components'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ImageEditor from 'calypso/blocks/image-editor'; import DropZone from 'calypso/components/drop-zone'; diff --git a/client/blocks/edit-gravatar/test/index.jsx b/client/blocks/edit-gravatar/test/index.jsx index e83fe074a0333d..ac68d53e112701 100644 --- a/client/blocks/edit-gravatar/test/index.jsx +++ b/client/blocks/edit-gravatar/test/index.jsx @@ -4,7 +4,6 @@ import { expect } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import { EditGravatar } from 'calypso/blocks/edit-gravatar'; import ImageEditor from 'calypso/blocks/image-editor'; import DropZone from 'calypso/components/drop-zone'; diff --git a/client/blocks/follow-button/button.jsx b/client/blocks/follow-button/button.jsx index 7e5ab82f867762..3895049174fcf4 100644 --- a/client/blocks/follow-button/button.jsx +++ b/client/blocks/follow-button/button.jsx @@ -1,13 +1,13 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createElement, Component } from 'react'; import './style.scss'; const noop = () => {}; -class FollowButton extends React.Component { +class FollowButton extends Component { static propTypes = { following: PropTypes.bool.isRequired, onFollowToggle: PropTypes.func, @@ -64,7 +64,7 @@ class FollowButton extends React.Component { ); - return React.createElement( + return createElement( this.props.tagName, { onClick: this.toggleFollow, diff --git a/client/blocks/follow-button/docs/example.jsx b/client/blocks/follow-button/docs/example.jsx index 1b866250c759a9..629214f9b2ce65 100644 --- a/client/blocks/follow-button/docs/example.jsx +++ b/client/blocks/follow-button/docs/example.jsx @@ -1,8 +1,8 @@ import { CompactCard as Card } from '@automattic/components'; -import React from 'react'; +import { PureComponent } from 'react'; import FollowButton from 'calypso/blocks/follow-button/button'; -export default class FollowButtonExample extends React.PureComponent { +export default class FollowButtonExample extends PureComponent { static displayName = 'FollowButtonExample'; render() { diff --git a/client/blocks/follow-button/index.jsx b/client/blocks/follow-button/index.jsx index 67750f430e1cbb..3d946514fc4fbd 100644 --- a/client/blocks/follow-button/index.jsx +++ b/client/blocks/follow-button/index.jsx @@ -1,6 +1,6 @@ import { omitBy } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { follow, unfollow } from 'calypso/state/reader/follows/actions'; import { isFollowing } from 'calypso/state/reader/follows/selectors'; diff --git a/client/blocks/follow-button/test/button.js b/client/blocks/follow-button/test/button.js index 510174dc49dcb4..7211e3830aecc0 100644 --- a/client/blocks/follow-button/test/button.js +++ b/client/blocks/follow-button/test/button.js @@ -1,6 +1,5 @@ import { expect } from 'chai'; import { render } from 'enzyme'; -import React from 'react'; import FollowButton from '../button'; describe( 'FollowButton', () => { diff --git a/client/blocks/followers-count/index.jsx b/client/blocks/followers-count/index.jsx index c4b1d755684ae0..22cd869221b0e1 100644 --- a/client/blocks/followers-count/index.jsx +++ b/client/blocks/followers-count/index.jsx @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Count from 'calypso/components/count'; import QuerySiteStats from 'calypso/components/data/query-site-stats'; diff --git a/client/blocks/gdpr-banner/index.jsx b/client/blocks/gdpr-banner/index.jsx index f389b2f6b4ca9e..4be533ba809b72 100644 --- a/client/blocks/gdpr-banner/index.jsx +++ b/client/blocks/gdpr-banner/index.jsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import cookie from 'cookie'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { isCurrentUserMaybeInGdprZone } from 'calypso/lib/analytics/utils'; import { decodeEntities, preventWidows } from 'calypso/lib/formatting'; diff --git a/client/blocks/get-apps/apps-badge.jsx b/client/blocks/get-apps/apps-badge.jsx index 0b853f60cd8ab3..8ebbf07e956bfb 100644 --- a/client/blocks/get-apps/apps-badge.jsx +++ b/client/blocks/get-apps/apps-badge.jsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import { translate } from 'i18n-calypso'; import { startsWith } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import TranslatableString from 'calypso/components/translatable/proptype'; import { getLocaleSlug } from 'calypso/lib/i18n-utils'; diff --git a/client/blocks/get-apps/desktop-download-card.jsx b/client/blocks/get-apps/desktop-download-card.jsx index e48b7b29629e17..e13c64acfd7829 100644 --- a/client/blocks/get-apps/desktop-download-card.jsx +++ b/client/blocks/get-apps/desktop-download-card.jsx @@ -1,7 +1,7 @@ import { Card, Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; diff --git a/client/blocks/get-apps/illustration.jsx b/client/blocks/get-apps/illustration.jsx index 9b0c3f3d1b11d4..3b1896c22d6876 100644 --- a/client/blocks/get-apps/illustration.jsx +++ b/client/blocks/get-apps/illustration.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import getAppsImage from 'calypso/assets/images/illustrations/get-apps-banner.svg'; const GetAppsIllustration = ( { translate } ) => ( diff --git a/client/blocks/get-apps/index.jsx b/client/blocks/get-apps/index.jsx index fadb480249bddc..b364fd7892125a 100644 --- a/client/blocks/get-apps/index.jsx +++ b/client/blocks/get-apps/index.jsx @@ -1,5 +1,4 @@ import config from '@automattic/calypso-config'; -import React from 'react'; import DesktopDownloadCard from './desktop-download-card.jsx'; import GetAppsIllustration from './illustration.jsx'; import MobileDownloadCard from './mobile-download-card.jsx'; diff --git a/client/blocks/get-apps/mobile-download-card.jsx b/client/blocks/get-apps/mobile-download-card.jsx index 3cca6b7fba1b7f..5a39fdefe64378 100644 --- a/client/blocks/get-apps/mobile-download-card.jsx +++ b/client/blocks/get-apps/mobile-download-card.jsx @@ -1,7 +1,7 @@ import { Card, Button } from '@automattic/components'; import i18n, { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QuerySmsCountries from 'calypso/components/data/query-countries/sms'; import FormPhoneInput from 'calypso/components/forms/form-phone-input'; @@ -45,7 +45,7 @@ function sendSMS( phone ) { } ); } -class MobileDownloadCard extends React.Component { +class MobileDownloadCard extends Component { static propTypes = { translate: PropTypes.func, countriesList: PropTypes.array.isRequired, diff --git a/client/blocks/get-apps/test/apps-badge.js b/client/blocks/get-apps/test/apps-badge.js index 15101aa67032f4..f887d811d45ed4 100644 --- a/client/blocks/get-apps/test/apps-badge.js +++ b/client/blocks/get-apps/test/apps-badge.js @@ -3,7 +3,6 @@ */ import { shallow } from 'enzyme'; -import React from 'react'; import { AppsBadge } from '../apps-badge'; jest.mock( 'calypso/lib/i18n-utils', () => ( { diff --git a/client/blocks/image-editor/docs/example.jsx b/client/blocks/image-editor/docs/example.jsx index 4965d5d7816e6b..49669b6998bff9 100644 --- a/client/blocks/image-editor/docs/example.jsx +++ b/client/blocks/image-editor/docs/example.jsx @@ -1,5 +1,5 @@ import { get } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { getCurrentUser } from 'calypso/state/current-user/selectors'; import { AspectRatios } from 'calypso/state/editor/image-editor/constants'; diff --git a/client/blocks/image-editor/image-editor-buttons.jsx b/client/blocks/image-editor/image-editor-buttons.jsx index 9f5ea2f804ce25..0825420454eb64 100644 --- a/client/blocks/image-editor/image-editor-buttons.jsx +++ b/client/blocks/image-editor/image-editor-buttons.jsx @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { getImageEditorFileInfo, diff --git a/client/blocks/image-editor/image-editor-canvas.jsx b/client/blocks/image-editor/image-editor-canvas.jsx index bdc52c3ac52ece..060064680a2c2a 100644 --- a/client/blocks/image-editor/image-editor-canvas.jsx +++ b/client/blocks/image-editor/image-editor-canvas.jsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { createRef, Component } from 'react'; import { connect } from 'react-redux'; import { mediaURLToProxyConfig, canvasToBlob } from 'calypso/lib/media/utils'; import wpcom from 'calypso/lib/wp'; @@ -69,7 +69,7 @@ export class ImageEditorCanvas extends Component { requestAnimationFrameId = null; lastTimestamp = null; isMounted = false; - canvasRef = React.createRef(); + canvasRef = createRef(); onWindowResize = () => { this.requestAnimationFrameId = window.requestAnimationFrame( this.updateCanvasPosition ); diff --git a/client/blocks/image-editor/image-editor-crop.jsx b/client/blocks/image-editor/image-editor-crop.jsx index 7afb2e337094af..abfdb27cdc4ebc 100644 --- a/client/blocks/image-editor/image-editor-crop.jsx +++ b/client/blocks/image-editor/image-editor-crop.jsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import { isEqual } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Draggable from 'calypso/components/draggable'; import { diff --git a/client/blocks/image-editor/image-editor-toolbar.jsx b/client/blocks/image-editor/image-editor-toolbar.jsx index 786e9c28ae8212..c6ba06a16913d3 100644 --- a/client/blocks/image-editor/image-editor-toolbar.jsx +++ b/client/blocks/image-editor/image-editor-toolbar.jsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { values as objectValues } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import PopoverMenu from 'calypso/components/popover-menu'; import PopoverMenuItem from 'calypso/components/popover-menu/item'; diff --git a/client/blocks/image-editor/index.jsx b/client/blocks/image-editor/index.jsx index 2eaaf4196fa32f..d440962cee91a8 100644 --- a/client/blocks/image-editor/index.jsx +++ b/client/blocks/image-editor/index.jsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { isEqual } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createRef, Component } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import CloseOnEscape from 'calypso/components/close-on-escape'; @@ -32,7 +32,7 @@ import './style.scss'; const noop = () => {}; -class ImageEditor extends React.Component { +class ImageEditor extends Component { static propTypes = { // Component props media: PropTypes.object, @@ -69,7 +69,7 @@ class ImageEditor extends React.Component { noticeStatus: 'is-info', }; - editCanvasRef = React.createRef(); + editCanvasRef = createRef(); UNSAFE_componentWillReceiveProps( newProps ) { const { media: currentMedia } = this.props; diff --git a/client/blocks/image-editor/test/image-editor-canvas.jsx b/client/blocks/image-editor/test/image-editor-canvas.jsx index e99bad872944d2..e38f98c7fb7ebe 100644 --- a/client/blocks/image-editor/test/image-editor-canvas.jsx +++ b/client/blocks/image-editor/test/image-editor-canvas.jsx @@ -4,7 +4,6 @@ import { expect } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import { ImageEditorCanvas } from '../image-editor-canvas'; jest.mock( 'calypso/blocks/image-editor/image-editor-crop', () => { diff --git a/client/blocks/image-editor/test/image-editor-toolbar.jsx b/client/blocks/image-editor/test/image-editor-toolbar.jsx index 962f09d8b72a89..02715652f5ac9f 100644 --- a/client/blocks/image-editor/test/image-editor-toolbar.jsx +++ b/client/blocks/image-editor/test/image-editor-toolbar.jsx @@ -4,7 +4,6 @@ import { expect } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import { useSandbox } from 'calypso/test-helpers/use-sinon'; import { ImageEditorToolbar } from '../image-editor-toolbar'; diff --git a/client/blocks/inline-help/data/use-inline-help-search-query.js b/client/blocks/inline-help/data/use-inline-help-search-query.js index 30ebdd577db594..e8f24310a82a19 100644 --- a/client/blocks/inline-help/data/use-inline-help-search-query.js +++ b/client/blocks/inline-help/data/use-inline-help-search-query.js @@ -1,5 +1,4 @@ import { createHigherOrderComponent } from '@wordpress/compose'; -import React from 'react'; import { useQuery } from 'react-query'; import { useSelector } from 'react-redux'; import wpcom from 'calypso/lib/wp'; diff --git a/client/blocks/inline-help/dialog.jsx b/client/blocks/inline-help/dialog.jsx index 8ec426bac26248..89d92741b9490b 100644 --- a/client/blocks/inline-help/dialog.jsx +++ b/client/blocks/inline-help/dialog.jsx @@ -1,7 +1,6 @@ import { Button, Dialog } from '@automattic/components'; import classNames from 'classnames'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import ResizableIframe from 'calypso/components/resizable-iframe'; import './dialog.scss'; diff --git a/client/blocks/inline-help/index.jsx b/client/blocks/inline-help/index.jsx index 6dee26c07a698e..45745cefafc89f 100644 --- a/client/blocks/inline-help/index.jsx +++ b/client/blocks/inline-help/index.jsx @@ -5,7 +5,7 @@ import classNames from 'classnames'; import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import AsyncLoad from 'calypso/components/async-load'; import getGlobalKeyboardShortcuts from 'calypso/lib/keyboard-shortcuts/global'; diff --git a/client/blocks/inline-help/inline-help-compact-result.jsx b/client/blocks/inline-help/inline-help-compact-result.jsx index 2d6385b823caf7..64eb5b2a2ec1e2 100644 --- a/client/blocks/inline-help/inline-help-compact-result.jsx +++ b/client/blocks/inline-help/inline-help-compact-result.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { decodeEntities, preventWidows } from 'calypso/lib/formatting'; class InlineHelpCompactResult extends Component { diff --git a/client/blocks/inline-help/inline-help-compact-results.jsx b/client/blocks/inline-help/inline-help-compact-results.jsx index 996afe111ddd0c..14c96f39062989 100644 --- a/client/blocks/inline-help/inline-help-compact-results.jsx +++ b/client/blocks/inline-help/inline-help-compact-results.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import InlineHelpCompactResult from 'calypso/blocks/inline-help/inline-help-compact-result'; class InlineHelpCompactResults extends Component { diff --git a/client/blocks/inline-help/inline-help-contact-view.jsx b/client/blocks/inline-help/inline-help-contact-view.jsx index 684a3a5f410e73..74dd2322b8354e 100644 --- a/client/blocks/inline-help/inline-help-contact-view.jsx +++ b/client/blocks/inline-help/inline-help-contact-view.jsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import InlineHelpForumView from 'calypso/blocks/inline-help/inline-help-forum-view'; import PlaceholderLines from 'calypso/blocks/inline-help/placeholder-lines'; diff --git a/client/blocks/inline-help/inline-help-forum-view.jsx b/client/blocks/inline-help/inline-help-forum-view.jsx index 898282520ba082..ccca467567e7f8 100644 --- a/client/blocks/inline-help/inline-help-forum-view.jsx +++ b/client/blocks/inline-help/inline-help-forum-view.jsx @@ -1,6 +1,5 @@ import { Button } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { recordTracksEvent } from 'calypso/lib/analytics/tracks'; import { preventWidows } from 'calypso/lib/formatting'; import { localizeUrl } from 'calypso/lib/i18n-utils'; diff --git a/client/blocks/inline-help/inline-help-query-support-types.jsx b/client/blocks/inline-help/inline-help-query-support-types.jsx index efc739f564c600..77ef583ad134b3 100644 --- a/client/blocks/inline-help/inline-help-query-support-types.jsx +++ b/client/blocks/inline-help/inline-help-query-support-types.jsx @@ -1,5 +1,5 @@ import config from '@automattic/calypso-config'; -import React, { Component } from 'react'; +import { Fragment, Component } from 'react'; import { connect } from 'react-redux'; import QueryLanguageNames from 'calypso/components/data/query-language-names'; import QuerySupportHistory from 'calypso/components/data/query-support-history'; @@ -52,12 +52,12 @@ class QueryInlineHelpSupportTypes extends Component { render() { return ( - + { this.props.shouldStartHappychatConnection && } - + ); } } diff --git a/client/blocks/inline-help/inline-help-rich-result.jsx b/client/blocks/inline-help/inline-help-rich-result.jsx index 2c1385a7e066fa..01248627cc9973 100644 --- a/client/blocks/inline-help/inline-help-rich-result.jsx +++ b/client/blocks/inline-help/inline-help-rich-result.jsx @@ -2,7 +2,7 @@ import { Button, Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { localize, getLocaleSlug } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { decodeEntities, preventWidows } from 'calypso/lib/formatting'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; diff --git a/client/blocks/inline-help/inline-help-search-card.jsx b/client/blocks/inline-help/inline-help-search-card.jsx index f32138ceeff33a..0a35c8b1912a6e 100644 --- a/client/blocks/inline-help/inline-help-search-card.jsx +++ b/client/blocks/inline-help/inline-help-search-card.jsx @@ -1,7 +1,7 @@ import debugFactory from 'debug'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { useRef, useEffect } from 'react'; +import { useRef, useEffect } from 'react'; import { useDispatch } from 'react-redux'; import SearchCard from 'calypso/components/search-card'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; diff --git a/client/blocks/inline-help/inline-help-search-results.jsx b/client/blocks/inline-help/inline-help-search-results.jsx index a188ed792b6b7b..ff39cbfcd48bf9 100644 --- a/client/blocks/inline-help/inline-help-search-results.jsx +++ b/client/blocks/inline-help/inline-help-search-results.jsx @@ -4,7 +4,7 @@ import { useTranslate } from 'i18n-calypso'; import { debounce } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Fragment, useEffect } from 'react'; +import { Fragment, useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import QueryUserPurchases from 'calypso/components/data/query-user-purchases'; import { decodeEntities, preventWidows } from 'calypso/lib/formatting'; diff --git a/client/blocks/inline-help/placeholder-lines.jsx b/client/blocks/inline-help/placeholder-lines.jsx index 520d9cce526523..f8a2543321ae0e 100644 --- a/client/blocks/inline-help/placeholder-lines.jsx +++ b/client/blocks/inline-help/placeholder-lines.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - export default ( { lines = 4 } ) => (
{ Array.from( { length: lines }, ( _, n ) => ( diff --git a/client/blocks/inline-help/popover.jsx b/client/blocks/inline-help/popover.jsx index 35edd5092d93b8..e3004d78234742 100644 --- a/client/blocks/inline-help/popover.jsx +++ b/client/blocks/inline-help/popover.jsx @@ -4,7 +4,7 @@ import { __ } from '@wordpress/i18n'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { createRef, Component, Fragment } from 'react'; import { connect } from 'react-redux'; import InlineHelpContactView from 'calypso/blocks/inline-help/inline-help-contact-view'; import QuerySupportTypes from 'calypso/blocks/inline-help/inline-help-query-support-types'; @@ -32,7 +32,7 @@ class InlineHelpPopover extends Component { selectedResult: null, }; - secondaryViewRef = React.createRef(); + secondaryViewRef = createRef(); openResultView = ( event, result ) => { event.preventDefault(); diff --git a/client/blocks/jetpack-backup-creds-banner/index.jsx b/client/blocks/jetpack-backup-creds-banner/index.jsx index ecffee8f782f59..3356d9708acd46 100644 --- a/client/blocks/jetpack-backup-creds-banner/index.jsx +++ b/client/blocks/jetpack-backup-creds-banner/index.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import jetpackDisconnected from 'calypso/assets/images/jetpack/disconnected.svg'; import Banner from 'calypso/components/banner'; diff --git a/client/blocks/jetpack-benefits/test/scan-history.jsx b/client/blocks/jetpack-benefits/test/scan-history.jsx index 3d360511a33dc5..2f5922bb3a95b6 100644 --- a/client/blocks/jetpack-benefits/test/scan-history.jsx +++ b/client/blocks/jetpack-benefits/test/scan-history.jsx @@ -1,5 +1,4 @@ import { shallow } from 'enzyme'; -import React from 'react'; import { JetpackBenefitsCard } from 'calypso/blocks/jetpack-benefits/benefit-card'; import { JetpackBenefitsStandaloneCard } from 'calypso/blocks/jetpack-benefits/standalone-benefit-card'; import getSiteScanState from 'calypso/state/selectors/get-site-scan-state'; diff --git a/client/blocks/jetpack-benefits/test/site-backups.jsx b/client/blocks/jetpack-benefits/test/site-backups.jsx index 2c95d8909c8b8a..02aeae217d7ed2 100644 --- a/client/blocks/jetpack-benefits/test/site-backups.jsx +++ b/client/blocks/jetpack-benefits/test/site-backups.jsx @@ -1,5 +1,4 @@ import { shallow } from 'enzyme'; -import React from 'react'; import getRewindBackups from 'calypso/state/selectors/get-rewind-backups'; import JetpackBenefitsSiteBackups from '../site-backups'; diff --git a/client/blocks/jetpack-connect-site-only/index.js b/client/blocks/jetpack-connect-site-only/index.js index 8a8629cd92ee4d..9ea1f42d50e45c 100644 --- a/client/blocks/jetpack-connect-site-only/index.js +++ b/client/blocks/jetpack-connect-site-only/index.js @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { recordTracksEvent } from 'calypso/lib/analytics/tracks'; import { addQueryArgs } from 'calypso/lib/route'; import { urlToSlug } from 'calypso/lib/url'; diff --git a/client/blocks/jitm/index.jsx b/client/blocks/jitm/index.jsx index 9521b0afd734fe..0bc55149b3100e 100644 --- a/client/blocks/jitm/index.jsx +++ b/client/blocks/jitm/index.jsx @@ -1,6 +1,6 @@ import debugFactory from 'debug'; import PropTypes from 'prop-types'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { connect, useDispatch } from 'react-redux'; import AsyncLoad from 'calypso/components/async-load'; import QueryJITM from 'calypso/components/data/query-jitm'; diff --git a/client/blocks/jitm/templates/default.jsx b/client/blocks/jitm/templates/default.jsx index c800c9d7df1478..9cb8787640b3dd 100644 --- a/client/blocks/jitm/templates/default.jsx +++ b/client/blocks/jitm/templates/default.jsx @@ -1,5 +1,4 @@ import { get } from 'lodash'; -import React from 'react'; import UpsellNudge from 'calypso/blocks/upsell-nudge'; export default function DefaultTemplate( { diff --git a/client/blocks/jitm/templates/modal.jsx b/client/blocks/jitm/templates/modal.jsx index cffeaf70feee9d..236dcc1da4d4b4 100644 --- a/client/blocks/jitm/templates/modal.jsx +++ b/client/blocks/jitm/templates/modal.jsx @@ -1,6 +1,6 @@ import { Button, Guide } from '@wordpress/components'; import { take } from 'lodash-es/array'; -import React, { useState } from 'react'; +import { useState } from 'react'; import './modal-style.scss'; import Visual from './plans-visual.svg'; diff --git a/client/blocks/jitm/templates/notice.jsx b/client/blocks/jitm/templates/notice.jsx index c7e36a34d59313..7239d7d6365bde 100644 --- a/client/blocks/jitm/templates/notice.jsx +++ b/client/blocks/jitm/templates/notice.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import UpsellNudge from 'calypso/blocks/upsell-nudge'; export default function NoticeTemplate( { id, CTA, tracks, ...props } ) { diff --git a/client/blocks/jitm/templates/sidebar-banner.jsx b/client/blocks/jitm/templates/sidebar-banner.jsx index 958bcde0a075c3..b9206f0e70cbd1 100644 --- a/client/blocks/jitm/templates/sidebar-banner.jsx +++ b/client/blocks/jitm/templates/sidebar-banner.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import UpsellNudge from 'calypso/blocks/upsell-nudge'; import { preventWidows } from 'calypso/lib/formatting'; diff --git a/client/blocks/keyring-connect-button/index.js b/client/blocks/keyring-connect-button/index.js index 288cdd7d833e94..5cb639e9071198 100644 --- a/client/blocks/keyring-connect-button/index.js +++ b/client/blocks/keyring-connect-button/index.js @@ -3,7 +3,7 @@ import requestExternalAccess from '@automattic/request-external-access'; import { localize } from 'i18n-calypso'; import { find, last, some } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryKeyringServices from 'calypso/components/data/query-keyring-services'; import { diff --git a/client/blocks/legal-updates-banner/index.js b/client/blocks/legal-updates-banner/index.js index 43e8a2dedf9701..f0e7428a2ef34e 100644 --- a/client/blocks/legal-updates-banner/index.js +++ b/client/blocks/legal-updates-banner/index.js @@ -1,6 +1,6 @@ import { Button, Card } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { connect } from 'react-redux'; import ExternalLink from 'calypso/components/external-link'; import { localizeUrl } from 'calypso/lib/i18n-utils'; diff --git a/client/blocks/like-button/button.jsx b/client/blocks/like-button/button.jsx index 30ca99ab68a440..86e9487992a577 100644 --- a/client/blocks/like-button/button.jsx +++ b/client/blocks/like-button/button.jsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { omitBy } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { createElement, PureComponent } from 'react'; import LikeIcons from './icons'; import './style.scss'; @@ -101,7 +101,7 @@ class LikeButton extends PureComponent { ); const href = isLink ? `/stats/post/${ postId }/${ slug }` : null; - return React.createElement( + return createElement( containerTag, omitBy( { diff --git a/client/blocks/like-button/docs/example.jsx b/client/blocks/like-button/docs/example.jsx index 48ce20018e1d9b..cea1af73b0ead1 100644 --- a/client/blocks/like-button/docs/example.jsx +++ b/client/blocks/like-button/docs/example.jsx @@ -1,8 +1,8 @@ import { CompactCard as Card } from '@automattic/components'; -import React from 'react'; +import { PureComponent } from 'react'; import LikeButton from 'calypso/blocks/like-button/button'; -class SimpleLikeButtonContainer extends React.PureComponent { +class SimpleLikeButtonContainer extends PureComponent { state = { liked: !! this.props.liked, count: this.props.likeCount || 0, @@ -27,7 +27,7 @@ class SimpleLikeButtonContainer extends React.PureComponent { }; } -class LikeButtons extends React.PureComponent { +class LikeButtons extends PureComponent { static displayName = 'LikeButton'; render() { diff --git a/client/blocks/like-button/icons.jsx b/client/blocks/like-button/icons.jsx index 43fcb0707ce191..9b1c7328ccc98f 100644 --- a/client/blocks/like-button/icons.jsx +++ b/client/blocks/like-button/icons.jsx @@ -1,6 +1,5 @@ import { Gridicon } from '@automattic/components'; import PropTypes from 'prop-types'; -import React from 'react'; import './icons.scss'; diff --git a/client/blocks/like-button/index.jsx b/client/blocks/like-button/index.jsx index b2d27d18de2b21..bc1bd47d2dcfd3 100644 --- a/client/blocks/like-button/index.jsx +++ b/client/blocks/like-button/index.jsx @@ -1,6 +1,6 @@ import { omit } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryPostLikes from 'calypso/components/data/query-post-likes'; import { like, unlike } from 'calypso/state/posts/likes/actions'; diff --git a/client/blocks/login/continue-as-user.jsx b/client/blocks/login/continue-as-user.jsx index 603ad2845eb895..fdeefec541665f 100644 --- a/client/blocks/login/continue-as-user.jsx +++ b/client/blocks/login/continue-as-user.jsx @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import { get } from 'lodash'; -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import Gravatar from 'calypso/components/gravatar'; import wpcom from 'calypso/lib/wp'; diff --git a/client/blocks/login/divider.jsx b/client/blocks/login/divider.jsx index dbf9a4841b7350..661b19d4b4e817 100644 --- a/client/blocks/login/divider.jsx +++ b/client/blocks/login/divider.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - import './divider.scss'; export default function Divider( { children } ) { diff --git a/client/blocks/login/docs/example.jsx b/client/blocks/login/docs/example.jsx index 1e7dbd1cda9aa2..387c6ad80daa8a 100644 --- a/client/blocks/login/docs/example.jsx +++ b/client/blocks/login/docs/example.jsx @@ -1,12 +1,12 @@ -import React from 'react'; +import { Fragment } from 'react'; import LoginBlock from 'calypso/blocks/login'; const LoginExample = () => ( - +

- + ); LoginExample.displayName = 'Login'; diff --git a/client/blocks/login/error-notice.jsx b/client/blocks/login/error-notice.jsx index ba551907b9b08a..58eda6c68f6001 100644 --- a/client/blocks/login/error-notice.jsx +++ b/client/blocks/login/error-notice.jsx @@ -1,7 +1,7 @@ import config from '@automattic/calypso-config'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Notice from 'calypso/components/notice'; import { diff --git a/client/blocks/login/index.jsx b/client/blocks/login/index.jsx index 740b6b25d1706e..1e78aab88b7928 100644 --- a/client/blocks/login/index.jsx +++ b/client/blocks/login/index.jsx @@ -5,7 +5,7 @@ import { localize } from 'i18n-calypso'; import { capitalize, get } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import VisitSite from 'calypso/blocks/visit-site'; import AsyncLoad from 'calypso/components/async-load'; diff --git a/client/blocks/login/login-form.jsx b/client/blocks/login/login-form.jsx index 9e109a08d0e32a..1c83e4ba2522e6 100644 --- a/client/blocks/login/login-form.jsx +++ b/client/blocks/login/login-form.jsx @@ -5,7 +5,7 @@ import { localize } from 'i18n-calypso'; import { capitalize, defer, includes, get } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import ReactDom from 'react-dom'; import { connect } from 'react-redux'; import JetpackConnectSiteOnly from 'calypso/blocks/jetpack-connect-site-only'; diff --git a/client/blocks/login/social-connect-prompt.jsx b/client/blocks/login/social-connect-prompt.jsx index e405c2783c8f6f..e7f448a4f9291f 100644 --- a/client/blocks/login/social-connect-prompt.jsx +++ b/client/blocks/login/social-connect-prompt.jsx @@ -2,7 +2,7 @@ import { Button, Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { capitalize } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import AppleIcon from 'calypso/components/social-icons/apple'; import GoogleIcon from 'calypso/components/social-icons/google'; diff --git a/client/blocks/login/social.jsx b/client/blocks/login/social.jsx index b121cbd95b339e..aa9390caddd235 100644 --- a/client/blocks/login/social.jsx +++ b/client/blocks/login/social.jsx @@ -2,7 +2,7 @@ import config from '@automattic/calypso-config'; import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { InfoNotice } from 'calypso/blocks/global-notice'; import AppleLoginButton from 'calypso/components/social-buttons/apple'; diff --git a/client/blocks/login/test/login-form.jsx b/client/blocks/login/test/login-form.jsx index 3a692e13deb257..3711dfaf7b954c 100644 --- a/client/blocks/login/test/login-form.jsx +++ b/client/blocks/login/test/login-form.jsx @@ -4,7 +4,6 @@ import { expect } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import FormsButton from 'calypso/components/forms/form-button'; import FormPasswordInput from 'calypso/components/forms/form-password-input'; import FormTextInput from 'calypso/components/forms/form-text-input'; diff --git a/client/blocks/login/two-factor-authentication/push-notification-illustration.jsx b/client/blocks/login/two-factor-authentication/push-notification-illustration.jsx index c4503c3f21fb2b..ca667fc48a22ab 100644 --- a/client/blocks/login/two-factor-authentication/push-notification-illustration.jsx +++ b/client/blocks/login/two-factor-authentication/push-notification-illustration.jsx @@ -1,5 +1,4 @@ import colorStudio from '@automattic/color-studio'; -import React from 'react'; import './push-notification-illustration.scss'; diff --git a/client/blocks/login/two-factor-authentication/security-key-form.jsx b/client/blocks/login/two-factor-authentication/security-key-form.jsx index 1c8da6593d8686..4722d9d1452008 100644 --- a/client/blocks/login/two-factor-authentication/security-key-form.jsx +++ b/client/blocks/login/two-factor-authentication/security-key-form.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import Spinner from 'calypso/components/spinner'; diff --git a/client/blocks/login/two-factor-authentication/two-factor-actions.jsx b/client/blocks/login/two-factor-authentication/two-factor-actions.jsx index dd812dfddeb6de..918ea02637465d 100644 --- a/client/blocks/login/two-factor-authentication/two-factor-actions.jsx +++ b/client/blocks/login/two-factor-authentication/two-factor-actions.jsx @@ -1,7 +1,7 @@ import { Button, Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { isWebAuthnSupported } from 'calypso/lib/webauthn'; import { recordTracksEventWithClientId as recordTracksEvent } from 'calypso/state/analytics/actions'; diff --git a/client/blocks/login/two-factor-authentication/two-factor-content.jsx b/client/blocks/login/two-factor-authentication/two-factor-content.jsx index d18b68a12f8144..db65b3f25a82d8 100644 --- a/client/blocks/login/two-factor-authentication/two-factor-content.jsx +++ b/client/blocks/login/two-factor-authentication/two-factor-content.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import PushNotificationApprovalPoller from './push-notification-approval-poller'; import SecurityKeyForm from './security-key-form'; import VerificationCodeForm from './verification-code-form'; diff --git a/client/blocks/login/two-factor-authentication/verification-code-form.jsx b/client/blocks/login/two-factor-authentication/verification-code-form.jsx index be26ac28089b4f..b3aa2ce9b39d4d 100644 --- a/client/blocks/login/two-factor-authentication/verification-code-form.jsx +++ b/client/blocks/login/two-factor-authentication/verification-code-form.jsx @@ -2,7 +2,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { defer } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import FormFieldset from 'calypso/components/forms/form-fieldset'; diff --git a/client/blocks/login/two-factor-authentication/waiting-notification-approval.jsx b/client/blocks/login/two-factor-authentication/waiting-notification-approval.jsx index 185d4dea5a92f9..aff223b59b7aa3 100644 --- a/client/blocks/login/two-factor-authentication/waiting-notification-approval.jsx +++ b/client/blocks/login/two-factor-authentication/waiting-notification-approval.jsx @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import Divider from '../divider'; import PushNotificationIllustration from './push-notification-illustration'; import TwoFactorActions from './two-factor-actions'; diff --git a/client/blocks/plan-storage/bar.jsx b/client/blocks/plan-storage/bar.jsx index 8b6f5ed8236043..3a4ad64a10c902 100644 --- a/client/blocks/plan-storage/bar.jsx +++ b/client/blocks/plan-storage/bar.jsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import filesize from 'filesize'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; const ALERT_PERCENT = 80; const WARN_PERCENT = 60; diff --git a/client/blocks/plan-storage/docs/example.jsx b/client/blocks/plan-storage/docs/example.jsx index 0e5362284e989b..296ecdae6c2f47 100644 --- a/client/blocks/plan-storage/docs/example.jsx +++ b/client/blocks/plan-storage/docs/example.jsx @@ -6,7 +6,6 @@ import { PLAN_FREE, } from '@automattic/calypso-products'; import { get } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import { getCurrentUser } from 'calypso/state/current-user/selectors'; import { getSiteSlug } from 'calypso/state/sites/selectors'; diff --git a/client/blocks/plan-storage/index.jsx b/client/blocks/plan-storage/index.jsx index 8e9b9db3c33c95..59240e1c8b4479 100644 --- a/client/blocks/plan-storage/index.jsx +++ b/client/blocks/plan-storage/index.jsx @@ -7,7 +7,7 @@ import { import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryMediaStorage from 'calypso/components/data/query-media-storage'; import { canCurrentUser } from 'calypso/state/selectors/can-current-user'; diff --git a/client/blocks/plan-storage/test/bar.jsx b/client/blocks/plan-storage/test/bar.jsx index 58e3cd8b65b7f3..280bb893379fda 100644 --- a/client/blocks/plan-storage/test/bar.jsx +++ b/client/blocks/plan-storage/test/bar.jsx @@ -13,7 +13,6 @@ import { } from '@automattic/calypso-products'; import { assert } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import { PlanStorageBar } from '../bar'; describe( 'PlanStorageBar basic tests', () => { diff --git a/client/blocks/plan-storage/test/plan-storage.jsx b/client/blocks/plan-storage/test/plan-storage.jsx index 06ffa0d4d67dfb..3daf52681518bb 100644 --- a/client/blocks/plan-storage/test/plan-storage.jsx +++ b/client/blocks/plan-storage/test/plan-storage.jsx @@ -11,7 +11,6 @@ import { } from '@automattic/calypso-products'; import { assert } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import { PlanStorage } from '../index'; describe( 'PlanStorage basic tests', () => { diff --git a/client/blocks/plan-storage/tooltip.jsx b/client/blocks/plan-storage/tooltip.jsx index ddaced90389415..be8c9dac07afb1 100644 --- a/client/blocks/plan-storage/tooltip.jsx +++ b/client/blocks/plan-storage/tooltip.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { cloneElement } from 'react'; import { useTooltipState, Tooltip as ReakitTooltip, @@ -11,7 +11,7 @@ function Tooltip( { children, title, ...props } ) { return ( <> - { ( referenceProps ) => React.cloneElement( children, referenceProps ) } + { ( referenceProps ) => cloneElement( children, referenceProps ) } diff --git a/client/blocks/plan-thank-you-card/docs/example.jsx b/client/blocks/plan-thank-you-card/docs/example.jsx index 142b3bfcb0732b..8c1e49d29770fc 100644 --- a/client/blocks/plan-thank-you-card/docs/example.jsx +++ b/client/blocks/plan-thank-you-card/docs/example.jsx @@ -1,5 +1,4 @@ import { get } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import { getCurrentUser } from 'calypso/state/current-user/selectors'; import PlanThankYouCard from '../'; diff --git a/client/blocks/plan-thank-you-card/index.jsx b/client/blocks/plan-thank-you-card/index.jsx index 964f71ea7553d8..28bf70054b692f 100644 --- a/client/blocks/plan-thank-you-card/index.jsx +++ b/client/blocks/plan-thank-you-card/index.jsx @@ -4,7 +4,7 @@ import formatCurrency from '@automattic/format-currency'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QuerySitePlans from 'calypso/components/data/query-site-plans'; import QuerySites from 'calypso/components/data/query-sites'; diff --git a/client/blocks/post-edit-button/docs/example.jsx b/client/blocks/post-edit-button/docs/example.jsx index ee0fc63162658d..fdf3906b611aa4 100644 --- a/client/blocks/post-edit-button/docs/example.jsx +++ b/client/blocks/post-edit-button/docs/example.jsx @@ -1,7 +1,7 @@ -import React from 'react'; +import { PureComponent } from 'react'; import PostEditButton from 'calypso/blocks/post-edit-button'; -export default class PostEditButtonExample extends React.PureComponent { +export default class PostEditButtonExample extends PureComponent { static displayName = 'PostEditButtonExample'; render() { diff --git a/client/blocks/post-edit-button/index.jsx b/client/blocks/post-edit-button/index.jsx index 9bf2f8dd801546..ce37c2f94ccfc0 100644 --- a/client/blocks/post-edit-button/index.jsx +++ b/client/blocks/post-edit-button/index.jsx @@ -1,7 +1,6 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { getEditURL } from 'calypso/state/posts/utils'; import './style.scss'; diff --git a/client/blocks/post-likes/docs/example.jsx b/client/blocks/post-likes/docs/example.jsx index 00719f0b20b4bf..26f920dc750eaf 100644 --- a/client/blocks/post-likes/docs/example.jsx +++ b/client/blocks/post-likes/docs/example.jsx @@ -1,12 +1,12 @@ import { Button } from '@automattic/components'; -import React from 'react'; +import { createRef, PureComponent } from 'react'; import FormCheckbox from 'calypso/components/forms/form-checkbox'; import FormLabel from 'calypso/components/forms/form-label'; import PostLikes from '../'; import PostLikesPopover from '../popover'; -class PostLikesExample extends React.PureComponent { - popoverContext = React.createRef(); +class PostLikesExample extends PureComponent { + popoverContext = createRef(); state = { showDisplayNames: false, diff --git a/client/blocks/post-likes/index.jsx b/client/blocks/post-likes/index.jsx index f3234bdb92e626..e98a5b9d3d6ed1 100644 --- a/client/blocks/post-likes/index.jsx +++ b/client/blocks/post-likes/index.jsx @@ -1,6 +1,6 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import QueryPostLikes from 'calypso/components/data/query-post-likes'; import Gravatar from 'calypso/components/gravatar'; @@ -10,7 +10,7 @@ import { getPostLikes } from 'calypso/state/posts/selectors/get-post-likes'; import './style.scss'; -class PostLikes extends React.PureComponent { +class PostLikes extends PureComponent { static defaultProps = { postType: 'post', showDisplayNames: false, diff --git a/client/blocks/post-likes/popover.jsx b/client/blocks/post-likes/popover.jsx index 23a1dd63ea56ac..5d2d6b141fa928 100644 --- a/client/blocks/post-likes/popover.jsx +++ b/client/blocks/post-likes/popover.jsx @@ -1,7 +1,6 @@ import { Popover } from '@automattic/components'; import classnames from 'classnames'; import { omit } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import { countPostLikes } from 'calypso/state/posts/selectors/count-post-likes'; import { getPostLikes } from 'calypso/state/posts/selectors/get-post-likes'; diff --git a/client/blocks/post-share/connection.jsx b/client/blocks/post-share/connection.jsx index 9c2209fdbea3a5..28c015ab09f64e 100644 --- a/client/blocks/post-share/connection.jsx +++ b/client/blocks/post-share/connection.jsx @@ -1,6 +1,5 @@ import { FormToggle, BaseControl } from '@wordpress/components'; import classNames from 'classnames'; -import React from 'react'; import SocialLogo from 'calypso/components/social-logo'; import cssSafeUrl from 'calypso/lib/css-safe-url'; diff --git a/client/blocks/post-share/connections-list.jsx b/client/blocks/post-share/connections-list.jsx index 48b91d16398eb0..a189d74dcf8a18 100644 --- a/client/blocks/post-share/connections-list.jsx +++ b/client/blocks/post-share/connections-list.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import Connection from './connection'; class ConnectionsList extends PureComponent { diff --git a/client/blocks/post-share/docs/example.jsx b/client/blocks/post-share/docs/example.jsx index f2b8d94505dd03..d02f6d434642e3 100644 --- a/client/blocks/post-share/docs/example.jsx +++ b/client/blocks/post-share/docs/example.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { ToggleControl } from '@wordpress/components'; import { get } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import PostShare from 'calypso/blocks/post-share'; import QueryPosts from 'calypso/components/data/query-posts'; diff --git a/client/blocks/post-share/index.jsx b/client/blocks/post-share/index.jsx index 533a1e6ffc3d8d..434ea0c7ebdec8 100644 --- a/client/blocks/post-share/index.jsx +++ b/client/blocks/post-share/index.jsx @@ -6,7 +6,7 @@ import { localize } from 'i18n-calypso'; import { get, includes, map, concat } from 'lodash'; import { current as currentPage } from 'page'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import CalendarButton from 'calypso/blocks/calendar-button'; import ButtonGroup from 'calypso/components/button-group'; diff --git a/client/blocks/post-share/no-connections-notice.jsx b/client/blocks/post-share/no-connections-notice.jsx index 8967c7b46de190..9398fff8db58e4 100644 --- a/client/blocks/post-share/no-connections-notice.jsx +++ b/client/blocks/post-share/no-connections-notice.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import Notice from 'calypso/components/notice'; import NoticeAction from 'calypso/components/notice/notice-action'; diff --git a/client/blocks/post-share/nudges.jsx b/client/blocks/post-share/nudges.jsx index c558ded0cec0fd..f11944010c3fb0 100644 --- a/client/blocks/post-share/nudges.jsx +++ b/client/blocks/post-share/nudges.jsx @@ -1,6 +1,5 @@ import { findFirstSimilarPlanKey, TYPE_PREMIUM, TERM_ANNUALLY } from '@automattic/calypso-products'; import formatCurrency from '@automattic/format-currency'; -import React from 'react'; import { connect } from 'react-redux'; import UpsellNudge from 'calypso/blocks/upsell-nudge'; import { canCurrentUser } from 'calypso/state/selectors/can-current-user'; diff --git a/client/blocks/post-share/publicize-actions-list.jsx b/client/blocks/post-share/publicize-actions-list.jsx index f6c9cbdac36c37..3072246df153a8 100644 --- a/client/blocks/post-share/publicize-actions-list.jsx +++ b/client/blocks/post-share/publicize-actions-list.jsx @@ -2,7 +2,7 @@ import { isEnabled } from '@automattic/calypso-config'; import { Dialog, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import QuerySharePostActions from 'calypso/components/data/query-share-post-actions/index.jsx'; import EllipsisMenu from 'calypso/components/ellipsis-menu'; diff --git a/client/blocks/post-share/sharing-preview-modal.jsx b/client/blocks/post-share/sharing-preview-modal.jsx index dd950b99ad0acf..36032b94c64707 100644 --- a/client/blocks/post-share/sharing-preview-modal.jsx +++ b/client/blocks/post-share/sharing-preview-modal.jsx @@ -1,6 +1,5 @@ import { Dialog, Gridicon } from '@automattic/components'; import PropTypes from 'prop-types'; -import React from 'react'; import SharingPreviewPane from 'calypso/blocks/sharing-preview-pane'; const SharingPreviewModal = ( props ) => { diff --git a/client/blocks/post-share/test/nudges.jsx b/client/blocks/post-share/test/nudges.jsx index ec8ffaa3e9a625..4b25d9ac69776b 100644 --- a/client/blocks/post-share/test/nudges.jsx +++ b/client/blocks/post-share/test/nudges.jsx @@ -25,7 +25,6 @@ import { PLAN_ECOMMERCE_2_YEARS, } from '@automattic/calypso-products'; import { shallow } from 'enzyme'; -import React from 'react'; import { UpgradeToPremiumNudgePure } from '../nudges'; const props = { diff --git a/client/blocks/privacy-policy-banner/index.jsx b/client/blocks/privacy-policy-banner/index.jsx index f4a4ef9004958f..c463422889559d 100644 --- a/client/blocks/privacy-policy-banner/index.jsx +++ b/client/blocks/privacy-policy-banner/index.jsx @@ -2,7 +2,7 @@ import config from '@automattic/calypso-config'; import { localize } from 'i18n-calypso'; import { flowRight as compose, get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import Banner from 'calypso/components/banner'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; diff --git a/client/blocks/privacy-policy-banner/privacy-policy-dialog.jsx b/client/blocks/privacy-policy-banner/privacy-policy-dialog.jsx index cdeb8a00af0eca..dc8696d2dd59c7 100644 --- a/client/blocks/privacy-policy-banner/privacy-policy-dialog.jsx +++ b/client/blocks/privacy-policy-banner/privacy-policy-dialog.jsx @@ -1,6 +1,5 @@ import { Dialog, Button } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import './privacy-policy-dialog.scss'; diff --git a/client/blocks/product-plan-overlap-notices/docs/example.jsx b/client/blocks/product-plan-overlap-notices/docs/example.jsx index 048a0d1a1cc6e9..7f6d2bc558fcd2 100644 --- a/client/blocks/product-plan-overlap-notices/docs/example.jsx +++ b/client/blocks/product-plan-overlap-notices/docs/example.jsx @@ -1,5 +1,5 @@ import { JETPACK_PRODUCTS_LIST, JETPACK_PLANS } from '@automattic/calypso-products'; -import React, { Component } from 'react'; +import { Component } from 'react'; import SitesDropdown from 'calypso/components/sites-dropdown'; import ProductPlanOverlapNotices from '../'; diff --git a/client/blocks/product-plan-overlap-notices/index.jsx b/client/blocks/product-plan-overlap-notices/index.jsx index 612c0c28879461..2d17792ed4edb3 100644 --- a/client/blocks/product-plan-overlap-notices/index.jsx +++ b/client/blocks/product-plan-overlap-notices/index.jsx @@ -5,7 +5,7 @@ import { } from '@automattic/calypso-products'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryProductsList from 'calypso/components/data/query-products-list'; import QuerySitePlans from 'calypso/components/data/query-site-plans'; diff --git a/client/blocks/product-purchase-features-list/advertising-removed.jsx b/client/blocks/product-purchase-features-list/advertising-removed.jsx index 3fa3ecd313246b..f2d7d2fc956f50 100644 --- a/client/blocks/product-purchase-features-list/advertising-removed.jsx +++ b/client/blocks/product-purchase-features-list/advertising-removed.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import adsRemovedImage from 'calypso/assets/images/illustrations/removed-ads.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/blocks/product-purchase-features-list/business-onboarding.jsx b/client/blocks/product-purchase-features-list/business-onboarding.jsx index a15732016bb653..3d76b6398ded27 100644 --- a/client/blocks/product-purchase-features-list/business-onboarding.jsx +++ b/client/blocks/product-purchase-features-list/business-onboarding.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import conciergeImage from 'calypso/assets/images/illustrations/jetpack-concierge.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/blocks/product-purchase-features-list/custom-css.jsx b/client/blocks/product-purchase-features-list/custom-css.jsx index 9df6a6bdb082f5..02af4dfe4b73f0 100644 --- a/client/blocks/product-purchase-features-list/custom-css.jsx +++ b/client/blocks/product-purchase-features-list/custom-css.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import customizeImage from 'calypso/assets/images/illustrations/dashboard.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/blocks/product-purchase-features-list/custom-domain.jsx b/client/blocks/product-purchase-features-list/custom-domain.jsx index 17ff15bab5333f..4af26271fe11c3 100644 --- a/client/blocks/product-purchase-features-list/custom-domain.jsx +++ b/client/blocks/product-purchase-features-list/custom-domain.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import CustomDomainPurchaseDetail from 'calypso/my-sites/checkout/checkout-thank-you/custom-domain-purchase-detail'; export default function CustomDomainPurchaseDetailItem( { diff --git a/client/blocks/product-purchase-features-list/customize-theme.jsx b/client/blocks/product-purchase-features-list/customize-theme.jsx index 3e0da69eeffa80..43adfeb71c6f7f 100644 --- a/client/blocks/product-purchase-features-list/customize-theme.jsx +++ b/client/blocks/product-purchase-features-list/customize-theme.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import customizeImage from 'calypso/assets/images/illustrations/dashboard.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/blocks/product-purchase-features-list/google-analytics-stats.jsx b/client/blocks/product-purchase-features-list/google-analytics-stats.jsx index 981715bcfdf925..762fdd0c5a2043 100644 --- a/client/blocks/product-purchase-features-list/google-analytics-stats.jsx +++ b/client/blocks/product-purchase-features-list/google-analytics-stats.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import googleAnalyticsImage from 'calypso/assets/images/illustrations/google-analytics.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/blocks/product-purchase-features-list/google-my-business.js b/client/blocks/product-purchase-features-list/google-my-business.js index 707ceb783b3b85..aea7427a7828b5 100644 --- a/client/blocks/product-purchase-features-list/google-my-business.js +++ b/client/blocks/product-purchase-features-list/google-my-business.js @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import googleMyBusinessImage from 'calypso/assets/images/illustrations/google-my-business-feature.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/blocks/product-purchase-features-list/happiness-support-card.jsx b/client/blocks/product-purchase-features-list/happiness-support-card.jsx index 1f6f3bb7bc03d0..ad68e22d3dd710 100644 --- a/client/blocks/product-purchase-features-list/happiness-support-card.jsx +++ b/client/blocks/product-purchase-features-list/happiness-support-card.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import HappinessSupport from 'calypso/components/happiness-support'; export const HappinessSupportCard = ( { diff --git a/client/blocks/product-purchase-features-list/index.jsx b/client/blocks/product-purchase-features-list/index.jsx index d6a3c9bfd6b06f..5afbeee8820548 100644 --- a/client/blocks/product-purchase-features-list/index.jsx +++ b/client/blocks/product-purchase-features-list/index.jsx @@ -19,7 +19,7 @@ import { getPlans, } from '@automattic/calypso-products'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; import { isWordadsInstantActivationEligible } from 'calypso/lib/ads/utils'; diff --git a/client/blocks/product-purchase-features-list/jetpack-publicize.jsx b/client/blocks/product-purchase-features-list/jetpack-publicize.jsx index a4adc5f0501907..56d7e7f425fb8e 100644 --- a/client/blocks/product-purchase-features-list/jetpack-publicize.jsx +++ b/client/blocks/product-purchase-features-list/jetpack-publicize.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import marketingImage from 'calypso/assets/images/illustrations/marketing.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/blocks/product-purchase-features-list/mobile-apps.jsx b/client/blocks/product-purchase-features-list/mobile-apps.jsx index a1340c21ccdc86..c35beb547c604a 100644 --- a/client/blocks/product-purchase-features-list/mobile-apps.jsx +++ b/client/blocks/product-purchase-features-list/mobile-apps.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import appsImage from 'calypso/assets/images/illustrations/apps.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; import { addQueryArgs } from 'calypso/lib/route'; diff --git a/client/blocks/product-purchase-features-list/monetize-site.jsx b/client/blocks/product-purchase-features-list/monetize-site.jsx index c80a35c7118b9b..ab8a792963dd1c 100644 --- a/client/blocks/product-purchase-features-list/monetize-site.jsx +++ b/client/blocks/product-purchase-features-list/monetize-site.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import wordAdsImage from 'calypso/assets/images/illustrations/dotcom-wordads.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/blocks/product-purchase-features-list/sell-online-paypal.jsx b/client/blocks/product-purchase-features-list/sell-online-paypal.jsx index 3b63f8a0c725a5..1092397e0d51b8 100644 --- a/client/blocks/product-purchase-features-list/sell-online-paypal.jsx +++ b/client/blocks/product-purchase-features-list/sell-online-paypal.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import paymentsImage from 'calypso/assets/images/illustrations/payments.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; import { localizeUrl } from 'calypso/lib/i18n-utils'; diff --git a/client/blocks/product-purchase-features-list/site-activity.jsx b/client/blocks/product-purchase-features-list/site-activity.jsx index ee135763597a9d..c867aa330fd1fd 100644 --- a/client/blocks/product-purchase-features-list/site-activity.jsx +++ b/client/blocks/product-purchase-features-list/site-activity.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import siteActivity from 'calypso/assets/images/illustrations/site-activity.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/blocks/product-purchase-features-list/test/product-purchase-features-list.jsx b/client/blocks/product-purchase-features-list/test/product-purchase-features-list.jsx index bbbc43cc1f7604..421535d5761f2b 100644 --- a/client/blocks/product-purchase-features-list/test/product-purchase-features-list.jsx +++ b/client/blocks/product-purchase-features-list/test/product-purchase-features-list.jsx @@ -19,7 +19,6 @@ import { PLAN_JETPACK_BUSINESS_MONTHLY, } from '@automattic/calypso-products'; import { shallow } from 'enzyme'; -import React from 'react'; import { ProductPurchaseFeaturesList } from '../index'; jest.mock( diff --git a/client/blocks/product-purchase-features-list/test/video-audio-posts.jsx b/client/blocks/product-purchase-features-list/test/video-audio-posts.jsx index 8c2c18957cbd6a..378f7af7f0105e 100644 --- a/client/blocks/product-purchase-features-list/test/video-audio-posts.jsx +++ b/client/blocks/product-purchase-features-list/test/video-audio-posts.jsx @@ -19,7 +19,6 @@ import { PLAN_JETPACK_BUSINESS_MONTHLY, } from '@automattic/calypso-products'; import { shallow } from 'enzyme'; -import React from 'react'; import { VideoAudioPosts } from '../video-audio-posts'; describe( 'VideoAudioPosts basic tests', () => { diff --git a/client/blocks/product-purchase-features-list/upload-plugins.jsx b/client/blocks/product-purchase-features-list/upload-plugins.jsx index ac42666a522822..1b73548244b5fc 100644 --- a/client/blocks/product-purchase-features-list/upload-plugins.jsx +++ b/client/blocks/product-purchase-features-list/upload-plugins.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import updatesImage from 'calypso/assets/images/illustrations/updates.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/blocks/product-purchase-features-list/video-audio-posts.jsx b/client/blocks/product-purchase-features-list/video-audio-posts.jsx index 9b74b72e268a1a..bd0f4636aec7f8 100644 --- a/client/blocks/product-purchase-features-list/video-audio-posts.jsx +++ b/client/blocks/product-purchase-features-list/video-audio-posts.jsx @@ -4,7 +4,6 @@ import { isWpComPremiumPlan, } from '@automattic/calypso-products'; import { localize } from 'i18n-calypso'; -import React from 'react'; import videoImage from 'calypso/assets/images/illustrations/video-hosting.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; import { newPost } from 'calypso/lib/paths'; diff --git a/client/blocks/reader-author-link/docs/example.jsx b/client/blocks/reader-author-link/docs/example.jsx index 7c5aad34c9726d..73ae6b9972b45f 100644 --- a/client/blocks/reader-author-link/docs/example.jsx +++ b/client/blocks/reader-author-link/docs/example.jsx @@ -1,5 +1,4 @@ import { Card } from '@automattic/components'; -import React from 'react'; import ReaderAuthorLink from 'calypso/blocks/reader-author-link'; const ReaderAuthorLinkExample = () => { diff --git a/client/blocks/reader-author-link/index.jsx b/client/blocks/reader-author-link/index.jsx index 28826d80c7ccb1..3adec76cab2178 100644 --- a/client/blocks/reader-author-link/index.jsx +++ b/client/blocks/reader-author-link/index.jsx @@ -1,7 +1,6 @@ import classnames from 'classnames'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import { isAuthorNameBlocked } from 'calypso/reader/lib/author-name-blocklist'; import * as stats from 'calypso/reader/stats'; diff --git a/client/blocks/reader-author-link/test/index.js b/client/blocks/reader-author-link/test/index.js index d66184752becad..3f42537867b352 100644 --- a/client/blocks/reader-author-link/test/index.js +++ b/client/blocks/reader-author-link/test/index.js @@ -1,5 +1,4 @@ import { shallow } from 'enzyme'; -import React from 'react'; import ReaderAuthorLink from '../index'; jest.mock( 'calypso/reader/stats', () => ( { diff --git a/client/blocks/reader-avatar/docs/example.jsx b/client/blocks/reader-avatar/docs/example.jsx index c139284630a57c..f8a803932808cc 100644 --- a/client/blocks/reader-avatar/docs/example.jsx +++ b/client/blocks/reader-avatar/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReaderAvatar from 'calypso/blocks/reader-avatar'; const ReaderAvatarExample = () => { diff --git a/client/blocks/reader-avatar/index.jsx b/client/blocks/reader-avatar/index.jsx index 67a105e64355e2..2dc22777fe0fd1 100644 --- a/client/blocks/reader-avatar/index.jsx +++ b/client/blocks/reader-avatar/index.jsx @@ -2,7 +2,6 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import { startsWith, get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import SiteIcon from 'calypso/blocks/site-icon'; import Gravatar from 'calypso/components/gravatar'; import safeImageUrl from 'calypso/lib/safe-image-url'; diff --git a/client/blocks/reader-combined-card/docs/example.jsx b/client/blocks/reader-combined-card/docs/example.jsx index e74d71134a7e61..8e74021c228e40 100644 --- a/client/blocks/reader-combined-card/docs/example.jsx +++ b/client/blocks/reader-combined-card/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { ReaderCombinedCard, combinedCardPostKeyToKeys } from 'calypso/blocks/reader-combined-card'; import { posts, feed, site } from 'calypso/blocks/reader-post-card/docs/fixtures'; diff --git a/client/blocks/reader-combined-card/index.jsx b/client/blocks/reader-combined-card/index.jsx index be24ce5ad446e9..066e15d9c02daa 100644 --- a/client/blocks/reader-combined-card/index.jsx +++ b/client/blocks/reader-combined-card/index.jsx @@ -2,7 +2,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get, size, filter, isEmpty, includes } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ReaderAvatar from 'calypso/blocks/reader-avatar'; import PostBlocked from 'calypso/blocks/reader-post-card/blocked'; @@ -24,7 +24,7 @@ import ReaderCombinedCardPost from './post'; import './style.scss'; -class ReaderCombinedCardComponent extends React.Component { +class ReaderCombinedCardComponent extends Component { static propTypes = { currentRoute: PropTypes.string, posts: PropTypes.array.isRequired, diff --git a/client/blocks/reader-combined-card/placeholders/post.jsx b/client/blocks/reader-combined-card/placeholders/post.jsx index 9b76776bfa5ff7..eb354048df8b3e 100644 --- a/client/blocks/reader-combined-card/placeholders/post.jsx +++ b/client/blocks/reader-combined-card/placeholders/post.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - const ReaderCombinedCardPostPlaceholder = () => { /* eslint-disable wpcalypso/jsx-classname-namespace */ return ( diff --git a/client/blocks/reader-combined-card/post.jsx b/client/blocks/reader-combined-card/post.jsx index 453365d6713d78..7549f2c3a4a851 100644 --- a/client/blocks/reader-combined-card/post.jsx +++ b/client/blocks/reader-combined-card/post.jsx @@ -3,7 +3,7 @@ import closest from 'component-closest'; import { localize } from 'i18n-calypso'; import { has } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { Component, Fragment } from 'react'; import ReactDom from 'react-dom'; import ReaderAuthorLink from 'calypso/blocks/reader-author-link'; import ReaderCombinedCardPostPlaceholder from 'calypso/blocks/reader-combined-card/placeholders/post'; @@ -22,7 +22,7 @@ import { import { isAuthorNameBlocked } from 'calypso/reader/lib/author-name-blocklist'; import { recordPermalinkClick } from 'calypso/reader/stats'; -class ReaderCombinedCardPost extends React.Component { +class ReaderCombinedCardPost extends Component { static propTypes = { currentRoute: PropTypes.string, isWPForTeamsItem: PropTypes.bool, diff --git a/client/blocks/reader-excerpt/index.jsx b/client/blocks/reader-excerpt/index.jsx index a5e670ccf98fda..3fece48db30dd1 100644 --- a/client/blocks/reader-excerpt/index.jsx +++ b/client/blocks/reader-excerpt/index.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import AutoDirection from 'calypso/components/auto-direction'; import './style.scss'; diff --git a/client/blocks/reader-export-button/docs/example.jsx b/client/blocks/reader-export-button/docs/example.jsx index 6f0289b4c7e2ff..3d91d71b91c55a 100644 --- a/client/blocks/reader-export-button/docs/example.jsx +++ b/client/blocks/reader-export-button/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReaderExportButtonBlock from 'calypso/blocks/reader-export-button'; const ReaderExportButton = () => ( diff --git a/client/blocks/reader-export-button/index.jsx b/client/blocks/reader-export-button/index.jsx index f88ea3cc436faa..adf5e22c403028 100644 --- a/client/blocks/reader-export-button/index.jsx +++ b/client/blocks/reader-export-button/index.jsx @@ -3,7 +3,7 @@ import { saveAs } from 'browser-filesaver'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { READER_EXPORT_TYPE_SUBSCRIPTIONS, @@ -14,7 +14,7 @@ import { errorNotice } from 'calypso/state/notices/actions'; import './style.scss'; -class ReaderExportButton extends React.Component { +class ReaderExportButton extends Component { static propTypes = { borderless: PropTypes.bool, disabled: PropTypes.bool, diff --git a/client/blocks/reader-featured-image/index.jsx b/client/blocks/reader-featured-image/index.jsx index ae03f1f9ccde35..5e822f97ceac04 100644 --- a/client/blocks/reader-featured-image/index.jsx +++ b/client/blocks/reader-featured-image/index.jsx @@ -1,6 +1,5 @@ import classnames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; import cssSafeUrl from 'calypso/lib/css-safe-url'; import resizeImageUrl from 'calypso/lib/resize-image-url'; diff --git a/client/blocks/reader-featured-video/docs/example.jsx b/client/blocks/reader-featured-video/docs/example.jsx index cdfbafc6be7906..f2f3c52e5c2416 100644 --- a/client/blocks/reader-featured-video/docs/example.jsx +++ b/client/blocks/reader-featured-video/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReaderFeaturedVideoBlock from 'calypso/blocks/reader-featured-video'; const exampleVideo = { diff --git a/client/blocks/reader-featured-video/index.jsx b/client/blocks/reader-featured-video/index.jsx index 39ef6b69b8a3de..5b000df0007842 100644 --- a/client/blocks/reader-featured-video/index.jsx +++ b/client/blocks/reader-featured-video/index.jsx @@ -2,7 +2,7 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import { throttle } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import ReactDom from 'react-dom'; import { connect } from 'react-redux'; import playIconImage from 'calypso/assets/images/reader/play-icon.png'; @@ -16,7 +16,7 @@ import './style.scss'; const noop = () => {}; const defaultSizingFunction = () => ( {} ); -class ReaderFeaturedVideo extends React.Component { +class ReaderFeaturedVideo extends Component { static propTypes = { thumbnailUrl: PropTypes.string, autoplayIframe: PropTypes.string, diff --git a/client/blocks/reader-feed-header/badge.jsx b/client/blocks/reader-feed-header/badge.jsx index 3cd1262e622497..91da3ebfe7aa02 100644 --- a/client/blocks/reader-feed-header/badge.jsx +++ b/client/blocks/reader-feed-header/badge.jsx @@ -1,6 +1,5 @@ import { Gridicon } from '@automattic/components'; import PropTypes from 'prop-types'; -import React from 'react'; const ReaderFeedHeaderSiteBadge = ( { site } ) => { /* eslint-disable wpcalypso/jsx-gridicon-size */ diff --git a/client/blocks/reader-feed-header/index.jsx b/client/blocks/reader-feed-header/index.jsx index 343e456543d3f7..563e943eee29d0 100644 --- a/client/blocks/reader-feed-header/index.jsx +++ b/client/blocks/reader-feed-header/index.jsx @@ -2,7 +2,7 @@ import { Card, Gridicon } from '@automattic/components'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import BlogStickers from 'calypso/blocks/blog-stickers'; import ReaderSiteNotificationSettings from 'calypso/blocks/reader-site-notification-settings'; diff --git a/client/blocks/reader-full-post/featured-image.jsx b/client/blocks/reader-full-post/featured-image.jsx index 9075e26f1260a3..bb48eb7dd81eb9 100644 --- a/client/blocks/reader-full-post/featured-image.jsx +++ b/client/blocks/reader-full-post/featured-image.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; -export default class FeaturedImage extends React.Component { +export default class FeaturedImage extends Component { constructor( props ) { super(); this.state = { src: props.src }; diff --git a/client/blocks/reader-full-post/header-tags.jsx b/client/blocks/reader-full-post/header-tags.jsx index fd3658672c8503..cd3421980f9f04 100644 --- a/client/blocks/reader-full-post/header-tags.jsx +++ b/client/blocks/reader-full-post/header-tags.jsx @@ -1,6 +1,5 @@ import { take, values } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; const TAGS_TO_SHOW = 5; diff --git a/client/blocks/reader-full-post/header.jsx b/client/blocks/reader-full-post/header.jsx index 20ae544221e030..9804c1bf205416 100644 --- a/client/blocks/reader-full-post/header.jsx +++ b/client/blocks/reader-full-post/header.jsx @@ -2,7 +2,6 @@ import { Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { keys, trim } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import AutoDirection from 'calypso/components/auto-direction'; import ExternalLink from 'calypso/components/external-link'; import TimeSince from 'calypso/components/time-since'; diff --git a/client/blocks/reader-full-post/index.jsx b/client/blocks/reader-full-post/index.jsx index 12d27517fa390e..f58e00cc4bb2c7 100644 --- a/client/blocks/reader-full-post/index.jsx +++ b/client/blocks/reader-full-post/index.jsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import { translate } from 'i18n-calypso'; import { get, startsWith, pickBy } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createRef, Component } from 'react'; import { connect } from 'react-redux'; import AuthorCompactProfile from 'calypso/blocks/author-compact-profile'; import CommentButton from 'calypso/blocks/comment-button'; @@ -84,7 +84,7 @@ import ReaderFullPostUnavailable from './unavailable'; import './style.scss'; -export class FullPostView extends React.Component { +export class FullPostView extends Component { static propTypes = { post: PropTypes.object, onClose: PropTypes.func.isRequired, @@ -95,8 +95,8 @@ export class FullPostView extends React.Component { }; hasScrolledToCommentAnchor = false; - commentsWrapper = React.createRef(); - postContentWrapper = React.createRef(); + commentsWrapper = createRef(); + postContentWrapper = createRef(); componentDidMount() { KeyboardShortcuts.on( 'close-full-post', this.handleBack ); diff --git a/client/blocks/reader-full-post/placeholders/content.jsx b/client/blocks/reader-full-post/placeholders/content.jsx index 4d1818f6a05a1d..ea23b364b70425 100644 --- a/client/blocks/reader-full-post/placeholders/content.jsx +++ b/client/blocks/reader-full-post/placeholders/content.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - const ReaderFullPostContentPlaceholder = () => { /* eslint-disable wpcalypso/jsx-classname-namespace */ return ( diff --git a/client/blocks/reader-full-post/placeholders/header.jsx b/client/blocks/reader-full-post/placeholders/header.jsx index fa3744f5b8bec0..0abf38ce59d13d 100644 --- a/client/blocks/reader-full-post/placeholders/header.jsx +++ b/client/blocks/reader-full-post/placeholders/header.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - const ReaderFullPostHeaderPlaceholder = () => { /* eslint-disable wpcalypso/jsx-classname-namespace */ return ( diff --git a/client/blocks/reader-full-post/test/featured-image.jsx b/client/blocks/reader-full-post/test/featured-image.jsx index 09df6c11b0f6a5..a788382746644b 100644 --- a/client/blocks/reader-full-post/test/featured-image.jsx +++ b/client/blocks/reader-full-post/test/featured-image.jsx @@ -1,6 +1,5 @@ import { assert } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import FeaturedImage from '../featured-image'; describe( 'FeaturedImage', () => { diff --git a/client/blocks/reader-full-post/unavailable.jsx b/client/blocks/reader-full-post/unavailable.jsx index 26727aa480ef67..3dd336b29d2355 100644 --- a/client/blocks/reader-full-post/unavailable.jsx +++ b/client/blocks/reader-full-post/unavailable.jsx @@ -2,7 +2,7 @@ import config from '@automattic/calypso-config'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import BackButton from 'calypso/components/back-button'; import DocumentHead from 'calypso/components/data/document-head'; import ExternalLink from 'calypso/components/external-link'; diff --git a/client/blocks/reader-import-button/docs/example.jsx b/client/blocks/reader-import-button/docs/example.jsx index ff0e885f608193..35c63d1155974c 100644 --- a/client/blocks/reader-import-button/docs/example.jsx +++ b/client/blocks/reader-import-button/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReaderImportButtonBlock from 'calypso/blocks/reader-import-button'; const ReaderImportButton = () => ( diff --git a/client/blocks/reader-import-button/index.jsx b/client/blocks/reader-import-button/index.jsx index 06e53ee4b734cf..0c8a91829af57b 100644 --- a/client/blocks/reader-import-button/index.jsx +++ b/client/blocks/reader-import-button/index.jsx @@ -1,7 +1,7 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FilePicker from 'calypso/components/file-picker'; import wpcom from 'calypso/lib/wp'; @@ -11,7 +11,7 @@ import './style.scss'; const noop = () => {}; -class ReaderImportButton extends React.Component { +class ReaderImportButton extends Component { static propTypes = { borderless: PropTypes.bool, onProgress: PropTypes.func, diff --git a/client/blocks/reader-list-item/connected.jsx b/client/blocks/reader-list-item/connected.jsx index 4773d41d4aa2ac..e4adb9140489f1 100644 --- a/client/blocks/reader-list-item/connected.jsx +++ b/client/blocks/reader-list-item/connected.jsx @@ -1,6 +1,6 @@ import { flowRight as compose } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import connectSite from 'calypso/lib/reader-connect-site'; import { isFollowing as isFollowingSelector } from 'calypso/state/reader/follows/selectors'; @@ -8,7 +8,7 @@ import ReaderListItem from '.'; const noop = () => {}; -class ConnectedReaderListItem extends React.Component { +class ConnectedReaderListItem extends Component { static propTypes = { feed: PropTypes.object, site: PropTypes.object, diff --git a/client/blocks/reader-list-item/docs/example.jsx b/client/blocks/reader-list-item/docs/example.jsx index 972175c4756be8..838cea7026ea6e 100644 --- a/client/blocks/reader-list-item/docs/example.jsx +++ b/client/blocks/reader-list-item/docs/example.jsx @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { map } from 'lodash'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import ConnectedReaderListItem from 'calypso/blocks/reader-list-item/connected'; import ReaderListItemPlaceholder from 'calypso/blocks/reader-list-item/placeholder'; diff --git a/client/blocks/reader-list-item/index.jsx b/client/blocks/reader-list-item/index.jsx index 5406c946c15423..4034d8355086ed 100644 --- a/client/blocks/reader-list-item/index.jsx +++ b/client/blocks/reader-list-item/index.jsx @@ -1,7 +1,6 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import { flowRight as compose, isEmpty, get } from 'lodash'; -import React from 'react'; import { useDispatch } from 'react-redux'; import ReaderAvatar from 'calypso/blocks/reader-avatar'; import ReaderListItemPlaceholder from 'calypso/blocks/reader-list-item/placeholder'; diff --git a/client/blocks/reader-list-item/placeholder.jsx b/client/blocks/reader-list-item/placeholder.jsx index dfc7e5a8d9cee4..5216dfffc29f9b 100644 --- a/client/blocks/reader-list-item/placeholder.jsx +++ b/client/blocks/reader-list-item/placeholder.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReaderAvatar from 'calypso/blocks/reader-avatar'; const ReaderListItemPlaceholder = () => { diff --git a/client/blocks/reader-post-actions/index.jsx b/client/blocks/reader-post-actions/index.jsx index d5c6bfb73fe4df..83ff7372da90d1 100644 --- a/client/blocks/reader-post-actions/index.jsx +++ b/client/blocks/reader-post-actions/index.jsx @@ -1,7 +1,6 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import CommentButton from 'calypso/blocks/comment-button'; import { shouldShowComments } from 'calypso/blocks/comments/helper'; import PostEditButton from 'calypso/blocks/post-edit-button'; diff --git a/client/blocks/reader-post-card/blocked.jsx b/client/blocks/reader-post-card/blocked.jsx index bc0b742398a14e..2d67e20f9b8c1c 100644 --- a/client/blocks/reader-post-card/blocked.jsx +++ b/client/blocks/reader-post-card/blocked.jsx @@ -1,13 +1,13 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { recordTrack as recordReaderTrack } from 'calypso/reader/stats'; import { bumpStat, recordGoogleEvent } from 'calypso/state/analytics/actions'; import { unblockSite } from 'calypso/state/reader/site-blocks/actions'; -class PostBlocked extends React.Component { +class PostBlocked extends Component { static propTypes = { post: PropTypes.object, }; diff --git a/client/blocks/reader-post-card/byline.jsx b/client/blocks/reader-post-card/byline.jsx index 5ce43126d72ee7..bf6f7f784faf35 100644 --- a/client/blocks/reader-post-card/byline.jsx +++ b/client/blocks/reader-post-card/byline.jsx @@ -1,7 +1,7 @@ import { Gridicon } from '@automattic/components'; import { get, map, take, values } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import ReaderAuthorLink from 'calypso/blocks/reader-author-link'; import ReaderAvatar from 'calypso/blocks/reader-avatar'; import ReaderSiteStreamLink from 'calypso/blocks/reader-site-stream-link'; @@ -19,7 +19,7 @@ import { const TAGS_TO_SHOW = 3; -class TagLink extends React.Component { +class TagLink extends Component { recordSingleTagClick = () => { const tag = this.props.tag; recordAction( 'click_tag' ); @@ -45,7 +45,7 @@ class TagLink extends React.Component { } } -class PostByline extends React.Component { +class PostByline extends Component { static propTypes = { post: PropTypes.object.isRequired, site: PropTypes.object, diff --git a/client/blocks/reader-post-card/compact.jsx b/client/blocks/reader-post-card/compact.jsx index 2f2cc34ea9ba45..b094a887b97883 100644 --- a/client/blocks/reader-post-card/compact.jsx +++ b/client/blocks/reader-post-card/compact.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import ReaderExcerpt from 'calypso/blocks/reader-excerpt'; import ReaderPostOptionsMenu from 'calypso/blocks/reader-post-options-menu'; import AutoDirection from 'calypso/components/auto-direction'; diff --git a/client/blocks/reader-post-card/conversation-post.jsx b/client/blocks/reader-post-card/conversation-post.jsx index 5718db76ca8248..a33e5edf5d25e6 100644 --- a/client/blocks/reader-post-card/conversation-post.jsx +++ b/client/blocks/reader-post-card/conversation-post.jsx @@ -1,9 +1,9 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import ConversationPostList from 'calypso/blocks/conversations/list'; import CompactPostCard from 'calypso/blocks/reader-post-card/compact'; -class ConversationPost extends React.Component { +class ConversationPost extends Component { static propTypes = { post: PropTypes.object.isRequired, commentIds: PropTypes.array.isRequired, diff --git a/client/blocks/reader-post-card/docs/example.jsx b/client/blocks/reader-post-card/docs/example.jsx index cc6d8b4361ace9..05ffdaef5ef5d0 100644 --- a/client/blocks/reader-post-card/docs/example.jsx +++ b/client/blocks/reader-post-card/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReaderPostCardBlock from 'calypso/blocks/reader-post-card'; import { posts, site } from './fixtures'; diff --git a/client/blocks/reader-post-card/featured-asset.jsx b/client/blocks/reader-post-card/featured-asset.jsx index 829e82e157cd9d..267d772e6ddc27 100644 --- a/client/blocks/reader-post-card/featured-asset.jsx +++ b/client/blocks/reader-post-card/featured-asset.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import ReaderFeaturedImage from 'calypso/blocks/reader-featured-image'; import ReaderFeaturedVideo from 'calypso/blocks/reader-featured-video'; diff --git a/client/blocks/reader-post-card/gallery.jsx b/client/blocks/reader-post-card/gallery.jsx index 12fdfd032fa2f4..36d9e6c6f200ec 100644 --- a/client/blocks/reader-post-card/gallery.jsx +++ b/client/blocks/reader-post-card/gallery.jsx @@ -1,6 +1,5 @@ import { map, take, filter } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import ReaderExcerpt from 'calypso/blocks/reader-excerpt'; import AutoDirection from 'calypso/components/auto-direction'; import cssSafeUrl from 'calypso/lib/css-safe-url'; diff --git a/client/blocks/reader-post-card/index.jsx b/client/blocks/reader-post-card/index.jsx index e8875ea9f435fe..06d13084fcba72 100644 --- a/client/blocks/reader-post-card/index.jsx +++ b/client/blocks/reader-post-card/index.jsx @@ -3,7 +3,7 @@ import classnames from 'classnames'; import closest from 'component-closest'; import { truncate, get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import ReactDom from 'react-dom'; import { connect } from 'react-redux'; import DailyPostButton from 'calypso/blocks/daily-post-button'; @@ -38,7 +38,7 @@ import './style.scss'; const noop = () => {}; -class ReaderPostCard extends React.Component { +class ReaderPostCard extends Component { static propTypes = { currentRoute: PropTypes.string, post: PropTypes.object.isRequired, diff --git a/client/blocks/reader-post-card/photo.jsx b/client/blocks/reader-post-card/photo.jsx index 903a6a8f88c447..11ce63faeb6a5f 100644 --- a/client/blocks/reader-post-card/photo.jsx +++ b/client/blocks/reader-post-card/photo.jsx @@ -1,13 +1,13 @@ import classnames from 'classnames'; import { debounce } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import AutoDirection from 'calypso/components/auto-direction'; import cssSafeUrl from 'calypso/lib/css-safe-url'; const noop = () => {}; -class PostPhoto extends React.Component { +class PostPhoto extends Component { state = { cardWidth: 800, }; diff --git a/client/blocks/reader-post-card/standard.jsx b/client/blocks/reader-post-card/standard.jsx index 0728b5a2e5fa4f..0887d36192e4c0 100644 --- a/client/blocks/reader-post-card/standard.jsx +++ b/client/blocks/reader-post-card/standard.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import ReaderExcerpt from 'calypso/blocks/reader-excerpt'; import AutoDirection from 'calypso/components/auto-direction'; import FeaturedAsset from './featured-asset'; diff --git a/client/blocks/reader-post-options-menu/blog-sticker-menu-item.jsx b/client/blocks/reader-post-options-menu/blog-sticker-menu-item.jsx index 3f679425a7c6b5..de68e287e72787 100644 --- a/client/blocks/reader-post-options-menu/blog-sticker-menu-item.jsx +++ b/client/blocks/reader-post-options-menu/blog-sticker-menu-item.jsx @@ -1,11 +1,11 @@ import classnames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import PopoverMenuItem from 'calypso/components/popover-menu/item'; import { addBlogSticker, removeBlogSticker } from 'calypso/state/sites/blog-stickers/actions'; -class ReaderPostOptionsMenuBlogStickerMenuItem extends React.Component { +class ReaderPostOptionsMenuBlogStickerMenuItem extends Component { static propTypes = { blogId: PropTypes.number, blogStickerName: PropTypes.string, diff --git a/client/blocks/reader-post-options-menu/blog-stickers.jsx b/client/blocks/reader-post-options-menu/blog-stickers.jsx index 6e8bdcb65418f8..49c74c1b15f412 100644 --- a/client/blocks/reader-post-options-menu/blog-stickers.jsx +++ b/client/blocks/reader-post-options-menu/blog-stickers.jsx @@ -1,12 +1,12 @@ import { map, includes } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryBlogStickers from 'calypso/components/data/query-blog-stickers'; import getBlogStickers from 'calypso/state/selectors/get-blog-stickers'; import ReaderPostOptionsMenuBlogStickerMenuItem from './blog-sticker-menu-item'; -class ReaderPostOptionsMenuBlogStickers extends React.Component { +class ReaderPostOptionsMenuBlogStickers extends Component { static propTypes = { blogId: PropTypes.number.isRequired, }; diff --git a/client/blocks/reader-post-options-menu/docs/example.jsx b/client/blocks/reader-post-options-menu/docs/example.jsx index e640ff3a3e67b0..f0216c3e80c334 100644 --- a/client/blocks/reader-post-options-menu/docs/example.jsx +++ b/client/blocks/reader-post-options-menu/docs/example.jsx @@ -1,7 +1,7 @@ -import React from 'react'; +import { Component } from 'react'; import ReaderPostOptionsMenu from 'calypso/blocks/reader-post-options-menu'; -export default class ReaderPostOptionsMenuExample extends React.Component { +export default class ReaderPostOptionsMenuExample extends Component { static displayName = 'ReaderPostOptionsMenuExample'; render() { diff --git a/client/blocks/reader-post-options-menu/index.jsx b/client/blocks/reader-post-options-menu/index.jsx index b5da6f601f51d8..bcc6a97d0e62ce 100644 --- a/client/blocks/reader-post-options-menu/index.jsx +++ b/client/blocks/reader-post-options-menu/index.jsx @@ -3,7 +3,7 @@ import { localize } from 'i18n-calypso'; import { size, map } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ConversationFollowButton from 'calypso/blocks/conversation-follow-button'; import { shouldShowConversationFollowButton } from 'calypso/blocks/conversation-follow-button/helper'; @@ -39,7 +39,7 @@ import './style.scss'; const noop = () => {}; -class ReaderPostOptionsMenu extends React.Component { +class ReaderPostOptionsMenu extends Component { static propTypes = { currentRoute: PropTypes.string, post: PropTypes.object, diff --git a/client/blocks/reader-recommended-sites/docs/example.jsx b/client/blocks/reader-recommended-sites/docs/example.jsx index 1cdfdced71c619..fcff0d0aed0a24 100644 --- a/client/blocks/reader-recommended-sites/docs/example.jsx +++ b/client/blocks/reader-recommended-sites/docs/example.jsx @@ -1,5 +1,5 @@ import { Card } from '@automattic/components'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import ReaderRecommendedSites from '../'; const sites = { diff --git a/client/blocks/reader-recommended-sites/index.jsx b/client/blocks/reader-recommended-sites/index.jsx index 0062d97802f10d..3bf1462bf41142 100644 --- a/client/blocks/reader-recommended-sites/index.jsx +++ b/client/blocks/reader-recommended-sites/index.jsx @@ -2,7 +2,7 @@ import { Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { isEmpty } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import ConnectedListItem from 'calypso/blocks/reader-list-item/connected'; import { @@ -14,7 +14,7 @@ import { dismissSite } from 'calypso/state/reader/site-dismissals/actions'; import './style.scss'; -export class RecommendedSites extends React.PureComponent { +export class RecommendedSites extends PureComponent { static propTypes = { translate: PropTypes.func, sites: PropTypes.array, diff --git a/client/blocks/reader-related-card/docs/example.jsx b/client/blocks/reader-related-card/docs/example.jsx index 39f69413b8599f..0878f5c64fa8ac 100644 --- a/client/blocks/reader-related-card/docs/example.jsx +++ b/client/blocks/reader-related-card/docs/example.jsx @@ -1,5 +1,5 @@ import { Card } from '@automattic/components'; -import React from 'react'; +import { Component } from 'react'; import { RelatedPostsFromSameSite, RelatedPostsFromOtherSites, @@ -8,7 +8,7 @@ import { const LONGREADS_SITE_ID = 70135762; const LONGREADS_POST_ID = 65877; -class RelatedPostCardExample extends React.Component { +class RelatedPostCardExample extends Component { static displayName = 'RelatedPostCard'; render() { diff --git a/client/blocks/reader-related-card/index.jsx b/client/blocks/reader-related-card/index.jsx index c2b63d838beb92..de6eaba758e353 100644 --- a/client/blocks/reader-related-card/index.jsx +++ b/client/blocks/reader-related-card/index.jsx @@ -2,7 +2,6 @@ import { CompactCard as Card } from '@automattic/components'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import ReaderAuthorLink from 'calypso/blocks/reader-author-link'; import ReaderFeaturedImage from 'calypso/blocks/reader-featured-image'; diff --git a/client/blocks/reader-share/docs/example.jsx b/client/blocks/reader-share/docs/example.jsx index c5d5095788f224..5fbaabe4e48634 100644 --- a/client/blocks/reader-share/docs/example.jsx +++ b/client/blocks/reader-share/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { posts } from 'calypso/blocks/reader-post-card/docs/fixtures'; import ReaderShare from 'calypso/blocks/reader-share'; diff --git a/client/blocks/reader-share/index.jsx b/client/blocks/reader-share/index.jsx index 7eee4a7ad8da86..a98ff7572d38b3 100644 --- a/client/blocks/reader-share/index.jsx +++ b/client/blocks/reader-share/index.jsx @@ -5,7 +5,7 @@ import { localize } from 'i18n-calypso'; import { defer } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createRef, Component } from 'react'; import { connect } from 'react-redux'; import PopoverMenuItem from 'calypso/components/popover-menu/item'; import SiteSelector from 'calypso/components/site-selector'; @@ -66,7 +66,7 @@ function buildQuerystringForPost( post ) { return params.toString(); } -class ReaderShare extends React.Component { +class ReaderShare extends Component { static propTypes = { iconSize: PropTypes.number, }; @@ -83,7 +83,7 @@ class ReaderShare extends React.Component { constructor( props ) { super( props ); this.mounted = false; - this.shareButton = React.createRef(); + this.shareButton = createRef(); } componentDidMount() { diff --git a/client/blocks/reader-site-notification-settings/index.jsx b/client/blocks/reader-site-notification-settings/index.jsx index d5e81026b7111d..4afea58f5c0e86 100644 --- a/client/blocks/reader-site-notification-settings/index.jsx +++ b/client/blocks/reader-site-notification-settings/index.jsx @@ -3,7 +3,7 @@ import { ToggleControl } from '@wordpress/components'; import { localize } from 'i18n-calypso'; import { find, get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { createRef, Component } from 'react'; import { connect } from 'react-redux'; import QueryUserSettings from 'calypso/components/data/query-user-settings'; import SegmentedControl from 'calypso/components/segmented-control'; @@ -34,8 +34,8 @@ class ReaderSiteNotificationSettings extends Component { selected: this.props.emailDeliveryFrequency, }; - iconRef = React.createRef(); - spanRef = React.createRef(); + iconRef = createRef(); + spanRef = createRef(); UNSAFE_componentWillReceiveProps( nextProps ) { if ( nextProps.emailDeliveryFrequency !== this.props.emailDeliveryFrequency ) { diff --git a/client/blocks/reader-site-stream-link/docs/example.jsx b/client/blocks/reader-site-stream-link/docs/example.jsx index ce323055258149..90c6359ec186e4 100644 --- a/client/blocks/reader-site-stream-link/docs/example.jsx +++ b/client/blocks/reader-site-stream-link/docs/example.jsx @@ -1,8 +1,8 @@ import { Card } from '@automattic/components'; -import React from 'react'; +import { Component } from 'react'; import ReaderSiteStreamLink from 'calypso/blocks/reader-site-stream-link'; -export default class ReaderSiteStreamLinkExample extends React.Component { +export default class ReaderSiteStreamLinkExample extends Component { static displayName = 'ReaderSiteStreamLinkExample'; render() { diff --git a/client/blocks/reader-site-stream-link/index.jsx b/client/blocks/reader-site-stream-link/index.jsx index d950973aaa742a..ad55b3242e56a4 100644 --- a/client/blocks/reader-site-stream-link/index.jsx +++ b/client/blocks/reader-site-stream-link/index.jsx @@ -1,9 +1,9 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { getStreamUrl } from 'calypso/reader/route'; import { recordAction, recordGaEvent, recordTrackForPost } from 'calypso/reader/stats'; -class ReaderSiteStreamLink extends React.Component { +class ReaderSiteStreamLink extends Component { static propTypes = { feedId: PropTypes.number, siteId: PropTypes.number, diff --git a/client/blocks/reader-subscription-list-item/connected.jsx b/client/blocks/reader-subscription-list-item/connected.jsx index 64e1747284b9fb..7e081795079378 100644 --- a/client/blocks/reader-subscription-list-item/connected.jsx +++ b/client/blocks/reader-subscription-list-item/connected.jsx @@ -1,6 +1,6 @@ import { flowRight as compose } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import connectSite from 'calypso/lib/reader-connect-site'; import { isFollowing as isFollowingSelector } from 'calypso/state/reader/follows/selectors'; @@ -8,7 +8,7 @@ import SubscriptionListItem from '.'; const noop = () => {}; -class ConnectedSubscriptionListItem extends React.Component { +class ConnectedSubscriptionListItem extends Component { static propTypes = { feed: PropTypes.object, site: PropTypes.object, diff --git a/client/blocks/reader-subscription-list-item/docs/example.jsx b/client/blocks/reader-subscription-list-item/docs/example.jsx index 37e92a32ce7701..d88c0387435640 100644 --- a/client/blocks/reader-subscription-list-item/docs/example.jsx +++ b/client/blocks/reader-subscription-list-item/docs/example.jsx @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { map } from 'lodash'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import ConnectedReaderSubscriptionListItem from 'calypso/blocks/reader-subscription-list-item/connected'; import ReaderSubscriptionListItemPlaceholder from 'calypso/blocks/reader-subscription-list-item/placeholder'; diff --git a/client/blocks/reader-subscription-list-item/index.jsx b/client/blocks/reader-subscription-list-item/index.jsx index 078b9ff0b73e02..645dcd22c08ee9 100644 --- a/client/blocks/reader-subscription-list-item/index.jsx +++ b/client/blocks/reader-subscription-list-item/index.jsx @@ -1,7 +1,6 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import { flowRight as compose, isEmpty, get } from 'lodash'; -import React from 'react'; import ReaderAvatar from 'calypso/blocks/reader-avatar'; import ReaderSiteNotificationSettings from 'calypso/blocks/reader-site-notification-settings'; import ReaderSubscriptionListItemPlaceholder from 'calypso/blocks/reader-subscription-list-item/placeholder'; diff --git a/client/blocks/reader-subscription-list-item/placeholder.jsx b/client/blocks/reader-subscription-list-item/placeholder.jsx index a9197d0bbf8dab..a71626b1ce5bd2 100644 --- a/client/blocks/reader-subscription-list-item/placeholder.jsx +++ b/client/blocks/reader-subscription-list-item/placeholder.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReaderAvatar from 'calypso/blocks/reader-avatar'; const ReaderSubscriptionListItemPlaceholder = () => { diff --git a/client/blocks/reader-visit-link/index.jsx b/client/blocks/reader-visit-link/index.jsx index 94f835dcee8a7e..46fd36900e8f27 100644 --- a/client/blocks/reader-visit-link/index.jsx +++ b/client/blocks/reader-visit-link/index.jsx @@ -1,12 +1,12 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import ExternalLink from 'calypso/components/external-link'; import './style.scss'; const noop = () => {}; -class ReaderVisitLink extends React.Component { +class ReaderVisitLink extends Component { static propTypes = { href: PropTypes.string, iconSize: PropTypes.number, diff --git a/client/blocks/sharing-preview-pane/docs/example.jsx b/client/blocks/sharing-preview-pane/docs/example.jsx index c565a50a5cea1e..93a9e04e2f273c 100644 --- a/client/blocks/sharing-preview-pane/docs/example.jsx +++ b/client/blocks/sharing-preview-pane/docs/example.jsx @@ -1,6 +1,5 @@ import { Card } from '@automattic/components'; import { get } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import SharingPreviewPane from 'calypso/blocks/sharing-preview-pane'; import QueryPosts from 'calypso/components/data/query-posts'; diff --git a/client/blocks/sharing-preview-pane/index.jsx b/client/blocks/sharing-preview-pane/index.jsx index d015a4a613e444..33584f96bee3a6 100644 --- a/client/blocks/sharing-preview-pane/index.jsx +++ b/client/blocks/sharing-preview-pane/index.jsx @@ -1,7 +1,7 @@ import { localize } from 'i18n-calypso'; import { get, find, map } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import Notice from 'calypso/components/notice'; import NoticeAction from 'calypso/components/notice/notice-action'; diff --git a/client/blocks/shortcode/frame.js b/client/blocks/shortcode/frame.js index d9913053b10352..f59676da95f5ad 100644 --- a/client/blocks/shortcode/frame.js +++ b/client/blocks/shortcode/frame.js @@ -1,11 +1,11 @@ import classNames from 'classnames'; import { isEqual, omit } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import ResizableIframe from 'calypso/components/resizable-iframe'; import generateEmbedFrameMarkup from 'calypso/lib/embed-frame-markup'; -export default class ShortcodeFrame extends React.Component { +export default class ShortcodeFrame extends Component { static propTypes = { body: PropTypes.string, scripts: PropTypes.object, diff --git a/client/blocks/shortcode/index.js b/client/blocks/shortcode/index.js index 61780a0dc600b6..3dd5dfe726e71c 100644 --- a/client/blocks/shortcode/index.js +++ b/client/blocks/shortcode/index.js @@ -1,7 +1,7 @@ import classNames from 'classnames'; import { omit } from 'lodash'; import PropTypes from 'prop-types'; -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import wpcom from 'calypso/lib/wp'; import ShortcodeFrame from './frame'; diff --git a/client/blocks/signup-form/crowdsignal.jsx b/client/blocks/signup-form/crowdsignal.jsx index 11714bafd6641f..e0fc9a47b6371e 100644 --- a/client/blocks/signup-form/crowdsignal.jsx +++ b/client/blocks/signup-form/crowdsignal.jsx @@ -2,7 +2,7 @@ import { Button, Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import AutomatticLogo from 'calypso/components/automattic-logo'; import FormButton from 'calypso/components/forms/form-button'; import LoggedOutForm from 'calypso/components/logged-out-form'; diff --git a/client/blocks/signup-form/index.jsx b/client/blocks/signup-form/index.jsx index e1e83702c744d2..1a066ce2e413bb 100644 --- a/client/blocks/signup-form/index.jsx +++ b/client/blocks/signup-form/index.jsx @@ -20,7 +20,7 @@ import { } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component, useEffect } from 'react'; +import { Component, useEffect } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import FormInputValidation from 'calypso/components/forms/form-input-validation'; diff --git a/client/blocks/signup-form/p2.jsx b/client/blocks/signup-form/p2.jsx index 3a636291a5b5cd..ac442df4f677dd 100644 --- a/client/blocks/signup-form/p2.jsx +++ b/client/blocks/signup-form/p2.jsx @@ -1,6 +1,6 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import LoggedOutForm from 'calypso/components/logged-out-form'; import SocialSignupForm from './social'; diff --git a/client/blocks/signup-form/social.jsx b/client/blocks/signup-form/social.jsx index 7992fa99ef9847..0afc6cba17291b 100644 --- a/client/blocks/signup-form/social.jsx +++ b/client/blocks/signup-form/social.jsx @@ -1,7 +1,7 @@ import config from '@automattic/calypso-config'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import AppleLoginButton from 'calypso/components/social-buttons/apple'; import GoogleLoginButton from 'calypso/components/social-buttons/google'; diff --git a/client/blocks/site-address-changer/dialog.jsx b/client/blocks/site-address-changer/dialog.jsx index 215940560269af..a611ac765f05a4 100644 --- a/client/blocks/site-address-changer/dialog.jsx +++ b/client/blocks/site-address-changer/dialog.jsx @@ -1,7 +1,7 @@ import { Dialog, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import FormInputCheckbox from 'calypso/components/forms/form-checkbox'; import FormLabel from 'calypso/components/forms/form-label'; import TrackComponentView from 'calypso/lib/analytics/track-component-view'; diff --git a/client/blocks/site-address-changer/index.jsx b/client/blocks/site-address-changer/index.jsx index 6d6135c9b6af6a..b889ca566aab12 100644 --- a/client/blocks/site-address-changer/index.jsx +++ b/client/blocks/site-address-changer/index.jsx @@ -2,7 +2,7 @@ import { Card, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { debounce, get, isEmpty } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import FormButtonsBar from 'calypso/components/forms/form-buttons-bar'; diff --git a/client/blocks/site-icon/docs/example.jsx b/client/blocks/site-icon/docs/example.jsx index 47b33c886bbf68..3695b74f0ba2d3 100644 --- a/client/blocks/site-icon/docs/example.jsx +++ b/client/blocks/site-icon/docs/example.jsx @@ -1,5 +1,4 @@ import { get } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import { getCurrentUser } from 'calypso/state/current-user/selectors'; import SiteIcon from '../'; diff --git a/client/blocks/site-icon/index.jsx b/client/blocks/site-icon/index.jsx index 4619a90d15c809..11b01ec69acbb4 100644 --- a/client/blocks/site-icon/index.jsx +++ b/client/blocks/site-icon/index.jsx @@ -2,7 +2,6 @@ import { Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import QuerySites from 'calypso/components/data/query-sites'; import Image from 'calypso/components/image'; diff --git a/client/blocks/site-preview/index.jsx b/client/blocks/site-preview/index.jsx index 2206668eaa00bd..f0d4c10baf1730 100644 --- a/client/blocks/site-preview/index.jsx +++ b/client/blocks/site-preview/index.jsx @@ -1,6 +1,6 @@ import debugFactory from 'debug'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import WebPreview from 'calypso/components/web-preview'; import { addQueryArgs } from 'calypso/lib/route'; diff --git a/client/blocks/site/docs/example.jsx b/client/blocks/site/docs/example.jsx index c749e65c2547c1..e178a0b5c47ee2 100644 --- a/client/blocks/site/docs/example.jsx +++ b/client/blocks/site/docs/example.jsx @@ -1,6 +1,5 @@ import { Card } from '@automattic/components'; import { get } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import Site from 'calypso/blocks/site'; import { getCurrentUser } from 'calypso/state/current-user/selectors'; diff --git a/client/blocks/site/docs/placeholder-example.jsx b/client/blocks/site/docs/placeholder-example.jsx index 5bb992f07966fb..46dd15ebebb2fd 100644 --- a/client/blocks/site/docs/placeholder-example.jsx +++ b/client/blocks/site/docs/placeholder-example.jsx @@ -1,4 +1,4 @@ -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import SitePlaceholder from 'calypso/blocks/site/placeholder'; export default class SitePlaceholderExample extends PureComponent { diff --git a/client/blocks/site/index.jsx b/client/blocks/site/index.jsx index 8acdc61f2d2c3b..e782008f03c496 100644 --- a/client/blocks/site/index.jsx +++ b/client/blocks/site/index.jsx @@ -4,7 +4,7 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import SiteIcon from 'calypso/blocks/site-icon'; import SiteIndicator from 'calypso/my-sites/site-indicator'; @@ -17,7 +17,7 @@ import './style.scss'; const noop = () => {}; -class Site extends React.Component { +class Site extends Component { static defaultProps = { // onSelect callback onSelect: noop, diff --git a/client/blocks/site/placeholder.jsx b/client/blocks/site/placeholder.jsx index 721aafae45ff64..ace459a53826b7 100644 --- a/client/blocks/site/placeholder.jsx +++ b/client/blocks/site/placeholder.jsx @@ -1,8 +1,8 @@ import debugFactory from 'debug'; -import React from 'react'; +import { Component } from 'react'; const debug = debugFactory( 'calypso:my-sites:site' ); -export default class extends React.Component { +export default class extends Component { static displayName = 'SitePlaceholder'; componentDidMount() { diff --git a/client/blocks/stats-navigation/index.js b/client/blocks/stats-navigation/index.js index 5b4db4f166573e..984e62aed6b8d2 100644 --- a/client/blocks/stats-navigation/index.js +++ b/client/blocks/stats-navigation/index.js @@ -1,7 +1,7 @@ import config from '@automattic/calypso-config'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FollowersCount from 'calypso/blocks/followers-count'; import SectionNav from 'calypso/components/section-nav'; diff --git a/client/blocks/stats-navigation/intervals.js b/client/blocks/stats-navigation/intervals.js index bb037ef88e2456..096df1bcd610a6 100644 --- a/client/blocks/stats-navigation/intervals.js +++ b/client/blocks/stats-navigation/intervals.js @@ -1,7 +1,6 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import SegmentedControl from 'calypso/components/segmented-control'; import { intervals } from './constants'; diff --git a/client/blocks/stats-sparkline/index.jsx b/client/blocks/stats-sparkline/index.jsx index 2db35f72043eb5..b5dad720bcfc4d 100644 --- a/client/blocks/stats-sparkline/index.jsx +++ b/client/blocks/stats-sparkline/index.jsx @@ -1,7 +1,6 @@ import classnames from 'classnames'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { useSelector } from 'react-redux'; import QuerySiteStats from 'calypso/components/data/query-site-stats'; import { getSiteStatsNormalizedData } from 'calypso/state/stats/lists/selectors'; diff --git a/client/blocks/support-article-dialog/dialog.jsx b/client/blocks/support-article-dialog/dialog.jsx index 247d38afa6f59b..3134348aacdbe1 100644 --- a/client/blocks/support-article-dialog/dialog.jsx +++ b/client/blocks/support-article-dialog/dialog.jsx @@ -2,7 +2,7 @@ import { Button, Dialog, Gridicon } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import { memoize } from 'lodash'; import PropTypes from 'prop-types'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { connect } from 'react-redux'; import { SUPPORT_BLOG_ID } from 'calypso/blocks/inline-help/constants'; import QueryReaderPost from 'calypso/components/data/query-reader-post'; diff --git a/client/blocks/support-article-dialog/docs/example.jsx b/client/blocks/support-article-dialog/docs/example.jsx index 8af6c3ee7f9797..38ba935e007f8d 100644 --- a/client/blocks/support-article-dialog/docs/example.jsx +++ b/client/blocks/support-article-dialog/docs/example.jsx @@ -1,5 +1,5 @@ import { Button } from '@automattic/components'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { localizeUrl } from 'calypso/lib/i18n-utils'; import { openSupportArticleDialog } from 'calypso/state/inline-support-article/actions'; diff --git a/client/blocks/support-article-dialog/header.jsx b/client/blocks/support-article-dialog/header.jsx index 1ae12f47ff231f..f194f99e8a3566 100644 --- a/client/blocks/support-article-dialog/header.jsx +++ b/client/blocks/support-article-dialog/header.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import ExternalLink from 'calypso/components/external-link'; const SupportArticleHeader = ( { post, isLoading } ) => diff --git a/client/blocks/support-article-dialog/index.jsx b/client/blocks/support-article-dialog/index.jsx index a379ec1a132192..462e4c2fdaa2b0 100644 --- a/client/blocks/support-article-dialog/index.jsx +++ b/client/blocks/support-article-dialog/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import AsyncLoad from 'calypso/components/async-load'; import isInlineSupportArticleVisible from 'calypso/state/selectors/is-inline-support-article-visible'; diff --git a/client/blocks/support-article-dialog/placeholders.jsx b/client/blocks/support-article-dialog/placeholders.jsx index 0a375b64ab800d..4fad3d629611fc 100644 --- a/client/blocks/support-article-dialog/placeholders.jsx +++ b/client/blocks/support-article-dialog/placeholders.jsx @@ -1,7 +1,7 @@ -import React from 'react'; +import { Fragment } from 'react'; const PlaceHolders = () => ( - +

@@ -18,7 +18,7 @@ const PlaceHolders = () => (

-
+ ); export default PlaceHolders; diff --git a/client/blocks/taxonomy-manager/index.jsx b/client/blocks/taxonomy-manager/index.jsx index 7a05785bc3d752..ec627fcd2b9d97 100644 --- a/client/blocks/taxonomy-manager/index.jsx +++ b/client/blocks/taxonomy-manager/index.jsx @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import TermFormDialog from 'calypso/blocks/term-form-dialog'; import QueryTaxonomies from 'calypso/components/data/query-taxonomies'; diff --git a/client/blocks/taxonomy-manager/list-item.jsx b/client/blocks/taxonomy-manager/list-item.jsx index f19fa0a10ccac4..df64cf9205dbc5 100644 --- a/client/blocks/taxonomy-manager/list-item.jsx +++ b/client/blocks/taxonomy-manager/list-item.jsx @@ -4,7 +4,7 @@ import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Count from 'calypso/components/count'; import EllipsisMenu from 'calypso/components/ellipsis-menu'; diff --git a/client/blocks/taxonomy-manager/list.jsx b/client/blocks/taxonomy-manager/list.jsx index c6e1153702f2e5..c435d57dd34165 100644 --- a/client/blocks/taxonomy-manager/list.jsx +++ b/client/blocks/taxonomy-manager/list.jsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { includes, filter, map, reduce } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QuerySiteSettings from 'calypso/components/data/query-site-settings'; import QueryTerms from 'calypso/components/data/query-terms'; diff --git a/client/blocks/term-form-dialog/index.jsx b/client/blocks/term-form-dialog/index.jsx index ac7c06350b7bf4..ab837f24cd6647 100644 --- a/client/blocks/term-form-dialog/index.jsx +++ b/client/blocks/term-form-dialog/index.jsx @@ -4,7 +4,7 @@ import { ToggleControl } from '@wordpress/components'; import { localize } from 'i18n-calypso'; import { get, find } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import TermTreeSelectorTerms from 'calypso/blocks/term-tree-selector/terms'; import FormFieldset from 'calypso/components/forms/form-fieldset'; diff --git a/client/blocks/term-tree-selector/add-term.jsx b/client/blocks/term-tree-selector/add-term.jsx index 04b0233fc20627..e50e8e91da4f11 100644 --- a/client/blocks/term-tree-selector/add-term.jsx +++ b/client/blocks/term-tree-selector/add-term.jsx @@ -2,7 +2,7 @@ import { Button, Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import TermFormDialog from 'calypso/blocks/term-form-dialog'; import QueryTaxonomies from 'calypso/components/data/query-taxonomies'; diff --git a/client/blocks/term-tree-selector/index.jsx b/client/blocks/term-tree-selector/index.jsx index a30b19aee59108..352923dc1df4ef 100644 --- a/client/blocks/term-tree-selector/index.jsx +++ b/client/blocks/term-tree-selector/index.jsx @@ -1,9 +1,9 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import TermSelectorAddTerm from './add-term'; import TermTreeSelectorTerms from './terms'; -export default class TermTreeSelector extends React.Component { +export default class TermTreeSelector extends Component { static propTypes = { multiple: PropTypes.bool, className: PropTypes.string, diff --git a/client/blocks/term-tree-selector/no-results.jsx b/client/blocks/term-tree-selector/no-results.jsx index ed2cfeff5aa1f8..ac28e9abc1295c 100644 --- a/client/blocks/term-tree-selector/no-results.jsx +++ b/client/blocks/term-tree-selector/no-results.jsx @@ -1,8 +1,8 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; -class TermTreeSelectorNoResults extends React.PureComponent { +class TermTreeSelectorNoResults extends PureComponent { static displayName = 'TermTreeSelectorNoResults'; static propTypes = { diff --git a/client/blocks/term-tree-selector/search.jsx b/client/blocks/term-tree-selector/search.jsx index e0ec3928fc4075..8fb6775fd47f20 100644 --- a/client/blocks/term-tree-selector/search.jsx +++ b/client/blocks/term-tree-selector/search.jsx @@ -1,7 +1,6 @@ import { Gridicon } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import FormTextInput from 'calypso/components/forms/form-text-input'; import './search.scss'; diff --git a/client/blocks/term-tree-selector/terms.jsx b/client/blocks/term-tree-selector/terms.jsx index 22a2cdb2ae937f..dd20e2b61925e5 100644 --- a/client/blocks/term-tree-selector/terms.jsx +++ b/client/blocks/term-tree-selector/terms.jsx @@ -13,7 +13,7 @@ import { reduce, } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QuerySiteSettings from 'calypso/components/data/query-site-settings'; import QueryTerms from 'calypso/components/data/query-terms'; diff --git a/client/blocks/time-mismatch-warning/test/index.jsx b/client/blocks/time-mismatch-warning/test/index.jsx index f2de72a34eef38..33707ce6a58e42 100644 --- a/client/blocks/time-mismatch-warning/test/index.jsx +++ b/client/blocks/time-mismatch-warning/test/index.jsx @@ -2,7 +2,6 @@ import { shallow } from 'enzyme'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { useDispatch } from 'react-redux'; import { getPreference } from 'calypso/state/preferences/selectors'; import getSiteGmtOffset from 'calypso/state/selectors/get-site-gmt-offset'; diff --git a/client/blocks/upload-drop-zone/index.jsx b/client/blocks/upload-drop-zone/index.jsx index c3df9ef9e4ca20..e46312f3bb10a4 100644 --- a/client/blocks/upload-drop-zone/index.jsx +++ b/client/blocks/upload-drop-zone/index.jsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import DropZone from 'calypso/components/drop-zone'; import FilePicker from 'calypso/components/file-picker'; diff --git a/client/blocks/upsell-nudge/docs/example.jsx b/client/blocks/upsell-nudge/docs/example.jsx index 27b58d1ad06862..66f68ae25f24dc 100644 --- a/client/blocks/upsell-nudge/docs/example.jsx +++ b/client/blocks/upsell-nudge/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import UpsellNudge from 'calypso/blocks/upsell-nudge'; const UpsellNudgeExample = () => ( diff --git a/client/blocks/upsell-nudge/index.jsx b/client/blocks/upsell-nudge/index.jsx index 5d1cf196bba5f1..70755c6a1945d7 100644 --- a/client/blocks/upsell-nudge/index.jsx +++ b/client/blocks/upsell-nudge/index.jsx @@ -11,7 +11,6 @@ import { isFreePlanProduct, } from '@automattic/calypso-products'; import classnames from 'classnames'; -import React from 'react'; import { connect } from 'react-redux'; import Banner from 'calypso/components/banner'; import { addQueryArgs } from 'calypso/lib/url'; diff --git a/client/blocks/upsell-nudge/test/index.jsx b/client/blocks/upsell-nudge/test/index.jsx index df35f93d87329b..820e9b24d71105 100644 --- a/client/blocks/upsell-nudge/test/index.jsx +++ b/client/blocks/upsell-nudge/test/index.jsx @@ -13,7 +13,6 @@ import { PLAN_JETPACK_BUSINESS_MONTHLY, } from '@automattic/calypso-products'; import { shallow } from 'enzyme'; -import React from 'react'; import { UpsellNudge } from '../index'; const props = { diff --git a/client/blocks/upwork-banner/index.jsx b/client/blocks/upwork-banner/index.jsx index ddfe7790fe8de6..d301d92a6cd554 100644 --- a/client/blocks/upwork-banner/index.jsx +++ b/client/blocks/upwork-banner/index.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import UpsellNudge from 'calypso/blocks/upsell-nudge'; import { getCurrentPlan } from 'calypso/state/sites/plans/selectors'; diff --git a/client/blocks/user-mentions/add.jsx b/client/blocks/user-mentions/add.jsx index d36badec011720..e8c86f8e10c47a 100644 --- a/client/blocks/user-mentions/add.jsx +++ b/client/blocks/user-mentions/add.jsx @@ -1,5 +1,5 @@ import { escapeRegExp, findIndex, get, throttle, pick } from 'lodash'; -import React, { Fragment } from 'react'; +import { createRef, Component, Fragment } from 'react'; import getCaretCoordinates from 'textarea-caret'; import UserMentionSuggestionList from './suggestion-list'; @@ -16,7 +16,7 @@ const keys = { tab: 9, enter: 13, esc: 27, spaceBar: 32, upArrow: 38, downArrow: * @returns {object} the enhanced component */ export default ( WrappedComponent ) => - class AddUserMentions extends React.Component { + class AddUserMentions extends Component { matchingSuggestions = []; static displayName = `withUserMentions( ${ @@ -34,7 +34,7 @@ export default ( WrappedComponent ) => constructor( props ) { super( props ); // create a ref to store the textarea DOM element - this.textInput = React.createRef(); + this.textInput = createRef(); } componentDidMount() { diff --git a/client/blocks/user-mentions/connect.jsx b/client/blocks/user-mentions/connect.jsx index ef411be07539c7..2931a53829b539 100644 --- a/client/blocks/user-mentions/connect.jsx +++ b/client/blocks/user-mentions/connect.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { PureComponent, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryUsersSuggestions from 'calypso/components/data/query-users-suggestions'; import { getUserSuggestions } from 'calypso/state/user-suggestions/selectors'; @@ -13,7 +13,7 @@ import { getUserSuggestions } from 'calypso/state/user-suggestions/selectors'; * @returns {object} the enhanced component */ const connectUserMentions = ( WrappedComponent ) => { - class connectUserMentionsFetcher extends React.PureComponent { + class connectUserMentionsFetcher extends PureComponent { static propTypes = { siteId: PropTypes.number, }; diff --git a/client/blocks/user-mentions/docs/example-input.jsx b/client/blocks/user-mentions/docs/example-input.jsx index c48c067e982fd6..351825293de26b 100644 --- a/client/blocks/user-mentions/docs/example-input.jsx +++ b/client/blocks/user-mentions/docs/example-input.jsx @@ -1,8 +1,8 @@ -import React from 'react'; +import { forwardRef } from 'react'; import FormTextarea from 'calypso/components/forms/form-textarea'; import addUserMentions from '../add'; -const UserMentionsExampleInput = React.forwardRef( ( props, ref ) => ( +const UserMentionsExampleInput = forwardRef( ( props, ref ) => ( ) ); diff --git a/client/blocks/user-mentions/docs/example.jsx b/client/blocks/user-mentions/docs/example.jsx index 216995ccd3912d..4509397e28f204 100644 --- a/client/blocks/user-mentions/docs/example.jsx +++ b/client/blocks/user-mentions/docs/example.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import UserMentionsExampleInput from './example-input'; const exampleSuggestions = [ diff --git a/client/blocks/user-mentions/index.jsx b/client/blocks/user-mentions/index.jsx index 7641d260b95377..b10c99f0b6675f 100644 --- a/client/blocks/user-mentions/index.jsx +++ b/client/blocks/user-mentions/index.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent, forwardRef } from 'react'; import addUserMentions from './add'; import connectUserMentions from './connect'; @@ -11,7 +11,7 @@ import connectUserMentions from './connect'; * @returns {object} the enhanced component */ const withUserMentions = ( WrappedComponent ) => { - class TextInputWrapper extends React.PureComponent { + class TextInputWrapper extends PureComponent { static propTypes = { siteId: PropTypes.number, }; @@ -23,7 +23,7 @@ const withUserMentions = ( WrappedComponent ) => { return connectUserMentions( addUserMentions( - React.forwardRef( ( props, ref ) => { + forwardRef( ( props, ref ) => { return ; } ) ) diff --git a/client/blocks/user-mentions/suggestion-list.jsx b/client/blocks/user-mentions/suggestion-list.jsx index 604a35c09de70f..6e2f3eb156c132 100644 --- a/client/blocks/user-mentions/suggestion-list.jsx +++ b/client/blocks/user-mentions/suggestion-list.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import UserMentionsSuggestion from 'calypso/blocks/user-mentions/suggestion'; import PopoverMenu from 'calypso/components/popover-menu'; import PopoverMenuItem from 'calypso/components/popover-menu/item'; diff --git a/client/blocks/user-mentions/suggestion.jsx b/client/blocks/user-mentions/suggestion.jsx index e755e6e9a2af59..0851f4cf9f5701 100644 --- a/client/blocks/user-mentions/suggestion.jsx +++ b/client/blocks/user-mentions/suggestion.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import './suggestion.scss'; diff --git a/client/blocks/video-editor/docs/example.jsx b/client/blocks/video-editor/docs/example.jsx index bc049802592413..6fe45d54f1b63c 100644 --- a/client/blocks/video-editor/docs/example.jsx +++ b/client/blocks/video-editor/docs/example.jsx @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import VideoEditor from '../'; class VideoEditorExample extends Component { diff --git a/client/blocks/video-editor/index.jsx b/client/blocks/video-editor/index.jsx index a4de72d6d64887..6fdc21b8815a60 100644 --- a/client/blocks/video-editor/index.jsx +++ b/client/blocks/video-editor/index.jsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Notice from 'calypso/components/notice'; import DetailPreviewVideo from 'calypso/post-editor/media-modal/detail/detail-preview-video'; diff --git a/client/blocks/video-editor/video-editor-controls.jsx b/client/blocks/video-editor/video-editor-controls.jsx index 89999de15a5e96..db4374e7206992 100644 --- a/client/blocks/video-editor/video-editor-controls.jsx +++ b/client/blocks/video-editor/video-editor-controls.jsx @@ -1,7 +1,6 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import UploadButton from './video-editor-upload-button'; const noop = () => {}; diff --git a/client/blocks/video-editor/video-editor-upload-button.js b/client/blocks/video-editor/video-editor-upload-button.js index d1ea1e2252cbe0..b5a7fe83d55f6d 100644 --- a/client/blocks/video-editor/video-editor-upload-button.js +++ b/client/blocks/video-editor/video-editor-upload-button.js @@ -1,6 +1,6 @@ import { Button } from '@automattic/components'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import FilePicker from 'calypso/components/file-picker'; const noop = () => {}; diff --git a/client/blocks/visit-site/index.jsx b/client/blocks/visit-site/index.jsx index a5a076891a4af9..0ed79ad2896663 100644 --- a/client/blocks/visit-site/index.jsx +++ b/client/blocks/visit-site/index.jsx @@ -1,5 +1,5 @@ import { useTranslate } from 'i18n-calypso'; -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import wpcom from 'calypso/lib/wp'; import './style.scss'; diff --git a/client/boot/common.js b/client/boot/common.js index cdc12848a07945..05de414d6d85e5 100644 --- a/client/boot/common.js +++ b/client/boot/common.js @@ -3,7 +3,7 @@ import config from '@automattic/calypso-config'; import { getUrlParts } from '@automattic/calypso-url'; import debugFactory from 'debug'; import page from 'page'; -import React from 'react'; +import { createElement } from 'react'; import ReactDom from 'react-dom'; import Modal from 'react-modal'; import store from 'store'; @@ -409,7 +409,7 @@ const setupMiddlewares = ( currentUser, reduxStore ) => { }; function renderLayout( reduxStore ) { - const layoutElement = React.createElement( ProviderWrappedLayout, { + const layoutElement = createElement( ProviderWrappedLayout, { store: reduxStore, } ); diff --git a/client/components/action-card/docs/example.jsx b/client/components/action-card/docs/example.jsx index 549707318ba712..9ea0e3403b9714 100644 --- a/client/components/action-card/docs/example.jsx +++ b/client/components/action-card/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ActionCard from '../index'; ActionCard.displayName = 'ActionCard'; diff --git a/client/components/action-card/index.jsx b/client/components/action-card/index.jsx index bdb7e0cc4a244d..f669549ee0e27b 100644 --- a/client/components/action-card/index.jsx +++ b/client/components/action-card/index.jsx @@ -1,7 +1,6 @@ import { Card, Button, Gridicon } from '@automattic/components'; import classnames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; import './style.scss'; diff --git a/client/components/action-panel/body.jsx b/client/components/action-panel/body.jsx index 009d14ed4f2891..1171eb8a3d5075 100644 --- a/client/components/action-panel/body.jsx +++ b/client/components/action-panel/body.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - const ActionPanelBody = ( { children } ) => { return
{ children }
; }; diff --git a/client/components/action-panel/cta.jsx b/client/components/action-panel/cta.jsx index b9d4b5fad082c1..9e0af0447c7d81 100644 --- a/client/components/action-panel/cta.jsx +++ b/client/components/action-panel/cta.jsx @@ -1,5 +1,4 @@ import classNames from 'classnames'; -import React from 'react'; const ActionPanelCta = ( { children, className } ) => { return
{ children }
; diff --git a/client/components/action-panel/docs/example.jsx b/client/components/action-panel/docs/example.jsx index 83be8d94ef9b99..5a8fcc5dc11593 100644 --- a/client/components/action-panel/docs/example.jsx +++ b/client/components/action-panel/docs/example.jsx @@ -1,5 +1,4 @@ import { Button } from '@automattic/components'; -import React from 'react'; import ActionPanel from 'calypso/components/action-panel'; import ActionPanelBody from 'calypso/components/action-panel/body'; import ActionPanelCta from 'calypso/components/action-panel/cta'; diff --git a/client/components/action-panel/figure-header.jsx b/client/components/action-panel/figure-header.jsx index f7acc68dacabfa..a5c4069faf3174 100644 --- a/client/components/action-panel/figure-header.jsx +++ b/client/components/action-panel/figure-header.jsx @@ -1,5 +1,4 @@ import classnames from 'classnames'; -import React from 'react'; const ActionPanelFigureHeader = ( { children, className } ) => { return

{ children }

; diff --git a/client/components/action-panel/figure-list-item.jsx b/client/components/action-panel/figure-list-item.jsx index d8a97819b49eac..41c18d927cf4ca 100644 --- a/client/components/action-panel/figure-list-item.jsx +++ b/client/components/action-panel/figure-list-item.jsx @@ -1,5 +1,4 @@ import classnames from 'classnames'; -import React from 'react'; const ActionPanelFigureListItem = ( { children, className } ) => { return ( diff --git a/client/components/action-panel/figure-list.jsx b/client/components/action-panel/figure-list.jsx index 46c6a261733d5d..8c94896c873e24 100644 --- a/client/components/action-panel/figure-list.jsx +++ b/client/components/action-panel/figure-list.jsx @@ -1,5 +1,4 @@ import classnames from 'classnames'; -import React from 'react'; const ActionPanelFigureList = ( { children, className } ) => { return
    { children }
; diff --git a/client/components/action-panel/figure.jsx b/client/components/action-panel/figure.jsx index 6f90518dc076e2..d81a7f8c3eaca2 100644 --- a/client/components/action-panel/figure.jsx +++ b/client/components/action-panel/figure.jsx @@ -1,6 +1,5 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; const ActionPanelFigure = ( { inlineBodyText, align, children } ) => { const figureClasses = classNames( { diff --git a/client/components/action-panel/footer.jsx b/client/components/action-panel/footer.jsx index 7bdcf3c153f8c3..37cacd31fdf80c 100644 --- a/client/components/action-panel/footer.jsx +++ b/client/components/action-panel/footer.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import ActionPanelCta from './cta'; const ActionPanelFooter = ( { children } ) => { diff --git a/client/components/action-panel/index.jsx b/client/components/action-panel/index.jsx index e0f7336a7c3b71..4652c547bc5207 100644 --- a/client/components/action-panel/index.jsx +++ b/client/components/action-panel/index.jsx @@ -1,6 +1,5 @@ import { Card } from '@automattic/components'; import classnames from 'classnames'; -import React from 'react'; import './style.scss'; diff --git a/client/components/action-panel/link.jsx b/client/components/action-panel/link.jsx index 97bb2923ed4eee..45363852d2806a 100644 --- a/client/components/action-panel/link.jsx +++ b/client/components/action-panel/link.jsx @@ -1,5 +1,4 @@ import classnames from 'classnames'; -import React from 'react'; const ActionPanelLink = ( { children, href, className } ) => { return ( diff --git a/client/components/action-panel/title.jsx b/client/components/action-panel/title.jsx index 24fee46e5432e4..a8acb9fe21ac39 100644 --- a/client/components/action-panel/title.jsx +++ b/client/components/action-panel/title.jsx @@ -1,5 +1,4 @@ import classnames from 'classnames'; -import React from 'react'; const ActionPanelTitle = ( { children, className } ) => { return

{ children }

; diff --git a/client/components/activity-card-list/index.jsx b/client/components/activity-card-list/index.jsx index c685b313a98c3f..b0ecaae91dbec8 100644 --- a/client/components/activity-card-list/index.jsx +++ b/client/components/activity-card-list/index.jsx @@ -3,7 +3,7 @@ import { withMobileBreakpoint } from '@automattic/viewport-react'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ActivityCard from 'calypso/components/activity-card'; import QueryRewindCapabilities from 'calypso/components/data/query-rewind-capabilities'; diff --git a/client/components/animate/docs/example.jsx b/client/components/animate/docs/example.jsx index 640e6f3dae5941..eada2b80c1f06a 100644 --- a/client/components/animate/docs/example.jsx +++ b/client/components/animate/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import Animate from '../index'; function AnimateExample( props ) { diff --git a/client/components/animate/index.jsx b/client/components/animate/index.jsx index 6acd6dd1d0e7a3..8cd4cc29444176 100644 --- a/client/components/animate/index.jsx +++ b/client/components/animate/index.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import './style.scss'; diff --git a/client/components/async-load/index.jsx b/client/components/async-load/index.jsx index e8100e477b9e7b..bcbe308a55ebda 100644 --- a/client/components/async-load/index.jsx +++ b/client/components/async-load/index.jsx @@ -1,6 +1,6 @@ import { omit } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import './style.scss'; diff --git a/client/components/async-loader/test/index.js b/client/components/async-loader/test/index.js index ab4f9f8301d32f..67d47079ec0761 100644 --- a/client/components/async-loader/test/index.js +++ b/client/components/async-loader/test/index.js @@ -3,7 +3,7 @@ */ import { mount } from 'enzyme'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { asyncLoader } from '../'; const runAfterEvents = ( f ) => diff --git a/client/components/auto-direction/index.jsx b/client/components/auto-direction/index.jsx index bb32e481effd08..30eca68cbcbf43 100644 --- a/client/components/auto-direction/index.jsx +++ b/client/components/auto-direction/index.jsx @@ -1,6 +1,6 @@ import { useRtl } from 'i18n-calypso'; import { get } from 'lodash'; -import React from 'react'; +import { cloneElement, Children } from 'react'; import { stripHTML } from 'calypso/lib/formatting'; import { isRTLCharacter, isLTRCharacter } from './direction'; @@ -51,7 +51,7 @@ const getTaglessIndex = ( text ) => { /** * Gets text content from react element in case that's a leaf element * - * @param {React.Element} reactElement react element + * @param {Element} reactElement react element * @returns {string|null} returns a text content of the react element or null if it's not a leaf element */ const getContent = ( reactElement ) => { @@ -152,19 +152,19 @@ const getChildDirection = ( child, isRtl ) => { * It will set directionality only to the leaf components - because it does so according * to text content and only leaf components have those. * - * @param {React.Element} child element to transform + * @param {Element} child element to transform * @param {boolean} isRtl whether current language is RTL - * @returns {React.Element} transformed child + * @returns {Element} transformed child */ const setChildDirection = ( child, isRtl ) => { const childDirection = getChildDirection( child, isRtl ); if ( childDirection ) { - return React.cloneElement( child, getDirectionProps( child, childDirection ) ); + return cloneElement( child, getDirectionProps( child, childDirection ) ); } if ( child && child.props.children ) { - const children = React.Children.map( child.props.children, ( innerChild ) => { + const children = Children.map( child.props.children, ( innerChild ) => { if ( ! innerChild ) { return innerChild; } @@ -176,7 +176,7 @@ const setChildDirection = ( child, isRtl ) => { return setChildDirection( innerChild, isRtl ); } ); - return React.cloneElement( child, null, children ); + return cloneElement( child, null, children ); } return child; @@ -186,7 +186,7 @@ const setChildDirection = ( child, isRtl ) => { * Auto direction component that will set direction to child components according to their text content * * @param {object.children} props react element props that must contain some children - * @returns {React.Element} returns a react element with adjusted children + * @returns {Element} returns a react element with adjusted children */ export default function AutoDirection( { children } ) { const isRtl = useRtl(); diff --git a/client/components/auto-direction/test/auto-direction.jsx b/client/components/auto-direction/test/auto-direction.jsx index 237b8a86d241d9..282543417bc422 100644 --- a/client/components/auto-direction/test/auto-direction.jsx +++ b/client/components/auto-direction/test/auto-direction.jsx @@ -4,7 +4,6 @@ import { expect } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import AutoDirection from '..'; describe( 'AutoDirection', () => { diff --git a/client/components/back-button/index.jsx b/client/components/back-button/index.jsx index beb2b62f814b59..03a7ea167ed72d 100644 --- a/client/components/back-button/index.jsx +++ b/client/components/back-button/index.jsx @@ -1,7 +1,6 @@ import { Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import './style.scss'; diff --git a/client/components/badge/docs/example.jsx b/client/components/badge/docs/example.jsx index 4830aff669d34a..4461cc0d74959c 100644 --- a/client/components/badge/docs/example.jsx +++ b/client/components/badge/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import Badge from 'calypso/components/badge'; const BadgeExample = () => this.props.exampleCode; diff --git a/client/components/badge/index.jsx b/client/components/badge/index.jsx index 3ccfe2e53ac82e..04163ddb73bf95 100644 --- a/client/components/badge/index.jsx +++ b/client/components/badge/index.jsx @@ -1,10 +1,10 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import './style.scss'; -export default class Badge extends React.Component { +export default class Badge extends Component { static propTypes = { type: PropTypes.oneOf( [ 'warning', diff --git a/client/components/badge/test/index.js b/client/components/badge/test/index.js index 193fffbc9534a4..d6bc0fe808852a 100644 --- a/client/components/badge/test/index.js +++ b/client/components/badge/test/index.js @@ -1,6 +1,5 @@ import { assert } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import Badge from '../index'; describe( 'Badge', () => { diff --git a/client/components/banner/docs/example.jsx b/client/components/banner/docs/example.jsx index 20eee3860a6ebb..4a7fa3b58a09ee 100644 --- a/client/components/banner/docs/example.jsx +++ b/client/components/banner/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import Banner from 'calypso/components/banner'; const BannerExample = () => ( diff --git a/client/components/banner/index.jsx b/client/components/banner/index.jsx index a60bd8a1660e59..dc909dcc986d0e 100644 --- a/client/components/banner/index.jsx +++ b/client/components/banner/index.jsx @@ -12,7 +12,7 @@ import { Button, Card, Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { size } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import DismissibleCard from 'calypso/blocks/dismissible-card'; import JetpackLogo from 'calypso/components/jetpack-logo'; diff --git a/client/components/banner/test/index.jsx b/client/components/banner/test/index.jsx index 0f598304e9f33b..d3bd7d8691cf0f 100644 --- a/client/components/banner/test/index.jsx +++ b/client/components/banner/test/index.jsx @@ -1,16 +1,17 @@ jest.mock( 'calypso/blocks/dismissible-card', () => { - const React = require( 'react' ); - return class DismissibleCard extends React.Component {}; + return function DismissibleCard() { + return null; + }; } ); jest.mock( 'calypso/lib/analytics/track-component-view', () => { - const React = require( 'react' ); - return class TrackComponentView extends React.Component {}; + return function TrackComponentView() { + return null; + }; } ); import { Card, Button } from '@automattic/components'; import { shallow } from 'enzyme'; -import React from 'react'; import PlanPrice from 'calypso/my-sites/plan-price/'; import { Banner } from '../index'; diff --git a/client/components/blank-canvas/index.js b/client/components/blank-canvas/index.js index 6d94b33022d6e8..126d802068d0d5 100644 --- a/client/components/blank-canvas/index.js +++ b/client/components/blank-canvas/index.js @@ -1,7 +1,7 @@ import { Button } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { chevronLeft } from '@wordpress/icons'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import ReactDOM from 'react-dom'; import { useDispatch } from 'react-redux'; import WordPressLogo from 'calypso/components/wordpress-logo'; diff --git a/client/components/bulk-select/docs/example.jsx b/client/components/bulk-select/docs/example.jsx index 3219c7fc1b155b..3c796a16305184 100644 --- a/client/components/bulk-select/docs/example.jsx +++ b/client/components/bulk-select/docs/example.jsx @@ -1,10 +1,10 @@ import { Card } from '@automattic/components'; -import React from 'react'; +import { Component } from 'react'; import BulkSelect from 'calypso/components/bulk-select'; import FormInputCheckbox from 'calypso/components/forms/form-checkbox'; import FormLabel from 'calypso/components/forms/form-label'; -export default class extends React.Component { +export default class extends Component { static displayName = 'BulkSelects'; state = { diff --git a/client/components/bulk-select/index.jsx b/client/components/bulk-select/index.jsx index 724643218ebb0d..b1ad25112b1c9a 100644 --- a/client/components/bulk-select/index.jsx +++ b/client/components/bulk-select/index.jsx @@ -2,14 +2,14 @@ import { Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import Count from 'calypso/components/count'; import FormInputCheckbox from 'calypso/components/forms/form-checkbox'; import FormLabel from 'calypso/components/forms/form-label'; import './style.scss'; -export class BulkSelect extends React.Component { +export class BulkSelect extends Component { static displayName = 'BulkSelect'; static propTypes = { diff --git a/client/components/bulk-select/test/index.js b/client/components/bulk-select/test/index.js index 5e19e848f37e57..01bf79ac619d81 100644 --- a/client/components/bulk-select/test/index.js +++ b/client/components/bulk-select/test/index.js @@ -4,7 +4,6 @@ import { assert } from 'chai'; import { mount, shallow } from 'enzyme'; -import React from 'react'; import { BulkSelect } from '../index'; const noop = () => {}; diff --git a/client/components/button-group/docs/example.jsx b/client/components/button-group/docs/example.jsx index 810c015adefadd..21975479e1c408 100644 --- a/client/components/button-group/docs/example.jsx +++ b/client/components/button-group/docs/example.jsx @@ -1,8 +1,8 @@ import { Button, Card, Gridicon } from '@automattic/components'; -import React from 'react'; +import { PureComponent } from 'react'; import ButtonGroup from 'calypso/components/button-group'; -class Buttons extends React.PureComponent { +class Buttons extends PureComponent { static displayName = 'ButtonGroup'; state = { diff --git a/client/components/button-group/index.jsx b/client/components/button-group/index.jsx index 7f6fed97ae9d3b..3b0f89d17eeeb4 100644 --- a/client/components/button-group/index.jsx +++ b/client/components/button-group/index.jsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import { memo } from 'react'; import './style.scss'; @@ -12,4 +12,4 @@ const ButtonGroup = ( { busy, children, className, primary } ) => { return { children }; }; -export default React.memo( ButtonGroup ); +export default memo( ButtonGroup ); diff --git a/client/components/button-group/test/index.js b/client/components/button-group/test/index.js index 08355e6cd4dceb..9acb13552d1a3a 100644 --- a/client/components/button-group/test/index.js +++ b/client/components/button-group/test/index.js @@ -1,6 +1,5 @@ import { Button } from '@automattic/components'; import { shallow } from 'enzyme'; -import React from 'react'; import ButtonGroup from '..'; describe( 'ButtonGroup', () => { diff --git a/client/components/card-heading/docs/example.jsx b/client/components/card-heading/docs/example.jsx index b906eea11b134c..d9fd8251461e5b 100644 --- a/client/components/card-heading/docs/example.jsx +++ b/client/components/card-heading/docs/example.jsx @@ -1,5 +1,5 @@ import { Card } from '@automattic/components'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import CardHeading from 'calypso/components/card-heading'; export default class CardHeadingExample extends PureComponent { diff --git a/client/components/card-heading/index.jsx b/client/components/card-heading/index.jsx index 8798983ee07a8a..bc94209b96dcbd 100644 --- a/client/components/card-heading/index.jsx +++ b/client/components/card-heading/index.jsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import { includes } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createElement } from 'react'; import { preventWidows } from 'calypso/lib/formatting'; import './style.scss'; @@ -18,7 +18,7 @@ function CardHeading( { tagName = 'h1', size = 20, isBold = false, className, ch className && className, classNameObject ); - return React.createElement( tagName, { className: classes }, preventWidows( children, 2 ) ); + return createElement( tagName, { className: classes }, preventWidows( children, 2 ) ); } CardHeading.propTypes = { diff --git a/client/components/chart/bar-container.jsx b/client/components/chart/bar-container.jsx index d4185b0ce37d69..12b2ea780753f1 100644 --- a/client/components/chart/bar-container.jsx +++ b/client/components/chart/bar-container.jsx @@ -1,11 +1,11 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import Bar from './bar'; import XAxis from './x-axis'; const X_AXIS_LABEL_WIDTH = 42; -export default class ChartBarContainer extends React.PureComponent { +export default class ChartBarContainer extends PureComponent { static propTypes = { barClick: PropTypes.func, data: PropTypes.array, diff --git a/client/components/chart/bar-tooltip.jsx b/client/components/chart/bar-tooltip.jsx index d6dcac8184b892..a43a2fbbf2cd09 100644 --- a/client/components/chart/bar-tooltip.jsx +++ b/client/components/chart/bar-tooltip.jsx @@ -1,9 +1,9 @@ import { Gridicon } from '@automattic/components'; import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; -export default class ChartBarTooltip extends React.PureComponent { +export default class ChartBarTooltip extends PureComponent { static propTypes = { className: PropTypes.string, icon: PropTypes.string, diff --git a/client/components/chart/bar.jsx b/client/components/chart/bar.jsx index fe9d1cf0130e9f..010b00ef5498f2 100644 --- a/client/components/chart/bar.jsx +++ b/client/components/chart/bar.jsx @@ -1,9 +1,9 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import ChartBarTooltip from './bar-tooltip'; -export default class ChartBar extends React.PureComponent { +export default class ChartBar extends PureComponent { static propTypes = { className: PropTypes.string, clickHandler: PropTypes.func, diff --git a/client/components/chart/docs/example.jsx b/client/components/chart/docs/example.jsx index 1c41ec7f2e561f..1d875484c8b071 100644 --- a/client/components/chart/docs/example.jsx +++ b/client/components/chart/docs/example.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import Chart from '../index'; function ChartExample() { diff --git a/client/components/chart/index.jsx b/client/components/chart/index.jsx index eacf975de0f278..dbdec0deeb48b3 100644 --- a/client/components/chart/index.jsx +++ b/client/components/chart/index.jsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import { localize, withRtl } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { useState, useCallback, useMemo } from 'react'; +import { useState, useCallback, useMemo } from 'react'; import Notice from 'calypso/components/notice'; import Tooltip from 'calypso/components/tooltip'; import { hasTouch } from 'calypso/lib/touch-detect'; diff --git a/client/components/chart/label.jsx b/client/components/chart/label.jsx index ec86fca140baed..1ef2fcecd3aaf5 100644 --- a/client/components/chart/label.jsx +++ b/client/components/chart/label.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; -export default class ChartLabel extends React.PureComponent { +export default class ChartLabel extends PureComponent { static propTypes = { isRtl: PropTypes.bool, label: PropTypes.string.isRequired, diff --git a/client/components/chart/legend-item.jsx b/client/components/chart/legend-item.jsx index 7104760421bd13..e34794c61ff713 100644 --- a/client/components/chart/legend-item.jsx +++ b/client/components/chart/legend-item.jsx @@ -1,9 +1,9 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import FormInputCheckbox from 'calypso/components/forms/form-checkbox'; import FormLabel from 'calypso/components/forms/form-label'; -export default class ChartLegendItem extends React.PureComponent { +export default class ChartLegendItem extends PureComponent { static propTypes = { attr: PropTypes.string.isRequired, changeHandler: PropTypes.func.isRequired, diff --git a/client/components/chart/legend.jsx b/client/components/chart/legend.jsx index 21b3650f4e3c3b..5365fe7b2ec4e3 100644 --- a/client/components/chart/legend.jsx +++ b/client/components/chart/legend.jsx @@ -1,12 +1,12 @@ import { localize } from 'i18n-calypso'; import { find } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import ChartLegendItem from './legend-item'; const noop = () => {}; -class ChartLegend extends React.Component { +class ChartLegend extends Component { static propTypes = { activeCharts: PropTypes.array, activeTab: PropTypes.object.isRequired, diff --git a/client/components/chart/x-axis.jsx b/client/components/chart/x-axis.jsx index a8a84a43bb5486..ce6a9148183df2 100644 --- a/client/components/chart/x-axis.jsx +++ b/client/components/chart/x-axis.jsx @@ -1,6 +1,6 @@ import { numberFormat } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { useLayoutEffect, useState } from 'react'; +import { useLayoutEffect, useState } from 'react'; import Label from './label'; const ModuleChartXAxis = ( { data, isRtl, labelWidth, chartWidth } ) => { diff --git a/client/components/checklist/checklist.js b/client/components/checklist/checklist.js index de4e328c6eaaf0..9d98c0f120c6d2 100644 --- a/client/components/checklist/checklist.js +++ b/client/components/checklist/checklist.js @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { times } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Children, PureComponent, cloneElement } from 'react'; +import { Children, PureComponent, cloneElement } from 'react'; import { connect } from 'react-redux'; import { getSelectedSiteId } from 'calypso/state/ui/selectors'; import TaskPlaceholder from './task-placeholder'; diff --git a/client/components/checklist/docs/example.jsx b/client/components/checklist/docs/example.jsx index b4a34909d76a1c..2fdabd6a053124 100644 --- a/client/components/checklist/docs/example.jsx +++ b/client/components/checklist/docs/example.jsx @@ -1,5 +1,5 @@ import { Button } from '@automattic/components'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import accept from 'calypso/lib/accept'; import { Checklist, Task } from '../'; diff --git a/client/components/checklist/task-placeholder.js b/client/components/checklist/task-placeholder.js index 53d7085ff2f622..8f5d316e8270ea 100644 --- a/client/components/checklist/task-placeholder.js +++ b/client/components/checklist/task-placeholder.js @@ -1,5 +1,4 @@ import { Card } from '@automattic/components'; -import React from 'react'; export default function TaskPlaceholder() { return ( diff --git a/client/components/checklist/task.js b/client/components/checklist/task.js index bc126982b7f4f5..d2d485e4c6e885 100644 --- a/client/components/checklist/task.js +++ b/client/components/checklist/task.js @@ -2,7 +2,7 @@ import { Button, CompactCard, ScreenReaderText, Gridicon } from '@automattic/com import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Fragment, PureComponent } from 'react'; +import { Fragment, PureComponent } from 'react'; import Notice from 'calypso/components/notice'; import Spinner from 'calypso/components/spinner'; diff --git a/client/components/clipboard-button-input/docs/example.jsx b/client/components/clipboard-button-input/docs/example.jsx index 63cab541250767..8c288e8b5a1b4a 100644 --- a/client/components/clipboard-button-input/docs/example.jsx +++ b/client/components/clipboard-button-input/docs/example.jsx @@ -1,7 +1,7 @@ -import React from 'react'; +import { PureComponent } from 'react'; import ClipboardButtonInput from '../'; -export default class extends React.PureComponent { +export default class extends PureComponent { static displayName = 'ClipboardButtonInput'; render() { diff --git a/client/components/clipboard-button-input/index.jsx b/client/components/clipboard-button-input/index.jsx index 748dc7a26d0d86..af149b1d2a1258 100644 --- a/client/components/clipboard-button-input/index.jsx +++ b/client/components/clipboard-button-input/index.jsx @@ -1,7 +1,7 @@ import classnames from 'classnames'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import ClipboardButton from 'calypso/components/forms/clipboard-button'; import FormTextInput from 'calypso/components/forms/form-text-input'; @@ -13,10 +13,10 @@ import './style.scss'; function ClipboardButtonInput( { value = '', className, disabled, hideHttp, dispatch, ...rest } ) { const translate = useTranslate(); - const [ isCopied, setCopied ] = React.useState( false ); + const [ isCopied, setCopied ] = useState( false ); // toggle the `isCopied` flag back to `false` after 4 seconds - React.useEffect( () => { + useEffect( () => { if ( isCopied ) { const confirmationTimeout = setTimeout( () => setCopied( false ), 4000 ); return () => clearTimeout( confirmationTimeout ); diff --git a/client/components/close-on-escape/test/index.jsx b/client/components/close-on-escape/test/index.jsx index 4258921bf124a5..4a6b5af61dc74e 100644 --- a/client/components/close-on-escape/test/index.jsx +++ b/client/components/close-on-escape/test/index.jsx @@ -4,7 +4,6 @@ import { expect } from 'chai'; import { mount, shallow } from 'enzyme'; -import React from 'react'; import { spy } from 'sinon'; import CloseOnEscape from '../'; diff --git a/client/components/community-translator/index.jsx b/client/components/community-translator/index.jsx index 07ba86c4891778..93e036342ea412 100644 --- a/client/components/community-translator/index.jsx +++ b/client/components/community-translator/index.jsx @@ -2,7 +2,7 @@ import languages from '@automattic/languages'; import debugModule from 'debug'; import i18n, { localize } from 'i18n-calypso'; import { find, isEmpty } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryUserSettings from 'calypso/components/data/query-user-settings'; import isCommunityTranslatorEnabled from 'calypso/state/selectors/is-community-translator-enabled'; diff --git a/client/components/community-translator/test/translatable.js b/client/components/community-translator/test/translatable.js index 186d5b0e95b7a3..9085243ea36431 100644 --- a/client/components/community-translator/test/translatable.js +++ b/client/components/community-translator/test/translatable.js @@ -3,7 +3,6 @@ */ import { shallow } from 'enzyme'; -import React from 'react'; import { Translatable } from '../translatable'; const defaultProps = { diff --git a/client/components/community-translator/translatable-textarea.jsx b/client/components/community-translator/translatable-textarea.jsx index 366e47dae984e8..fa9480e53434f9 100644 --- a/client/components/community-translator/translatable-textarea.jsx +++ b/client/components/community-translator/translatable-textarea.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import FormLabel from 'calypso/components/forms/form-label'; import FormTextarea from 'calypso/components/forms/form-textarea'; diff --git a/client/components/community-translator/translatable.jsx b/client/components/community-translator/translatable.jsx index e15739b7ae0a35..3dc5cfc3842fe4 100644 --- a/client/components/community-translator/translatable.jsx +++ b/client/components/community-translator/translatable.jsx @@ -2,7 +2,7 @@ import { Dialog, Button, Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { isEmpty } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import FormFieldset from 'calypso/components/forms/form-fieldset'; import TranslatableTextarea from './translatable-textarea'; import TranslatedSuccess from './translated-success'; diff --git a/client/components/community-translator/translated-success.jsx b/client/components/community-translator/translated-success.jsx index 1da60d9fcb8359..ae131fc759039f 100644 --- a/client/components/community-translator/translated-success.jsx +++ b/client/components/community-translator/translated-success.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; const TranslatedSuccess = ( { translationUrl, translate } ) => (
diff --git a/client/components/count/index.jsx b/client/components/count/index.jsx index 1437dbb8c08a68..436b0bc00a1815 100644 --- a/client/components/count/index.jsx +++ b/client/components/count/index.jsx @@ -2,7 +2,6 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import { omit } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import formatNumberCompact from 'calypso/lib/format-number-compact'; import './style.scss'; diff --git a/client/components/count/test/index.jsx b/client/components/count/test/index.jsx index c48be58eefed4e..901249a02b28e3 100644 --- a/client/components/count/test/index.jsx +++ b/client/components/count/test/index.jsx @@ -1,6 +1,5 @@ import { expect } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import { spy } from 'sinon'; import { Count } from '../'; diff --git a/client/components/credit-card-form-fields/loading-placeholder.jsx b/client/components/credit-card-form-fields/loading-placeholder.jsx index dc7ec343b904ef..e771eac1a64fa9 100644 --- a/client/components/credit-card-form-fields/loading-placeholder.jsx +++ b/client/components/credit-card-form-fields/loading-placeholder.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import FormSelect from 'calypso/components/forms/form-select'; import FormTextInput from 'calypso/components/forms/form-text-input'; diff --git a/client/components/d3-base/index.js b/client/components/d3-base/index.js index a527c500b2d553..4cbfad0bf9ddf0 100644 --- a/client/components/d3-base/index.js +++ b/client/components/d3-base/index.js @@ -2,7 +2,7 @@ import classNames from 'classnames'; import { select as d3Select } from 'd3-selection'; import { isEmpty } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { createRef, Component } from 'react'; /** * Provides foundation to use D3 within React. @@ -30,7 +30,7 @@ export default class D3Base extends Component { getParams: null, }; - chartRef = React.createRef(); + chartRef = createRef(); static getDerivedStateFromProps( nextProps, prevState ) { let state = {}; diff --git a/client/components/d3-base/test/index.js b/client/components/d3-base/test/index.js index c2235021c3b93a..f4dc3a1973a9a4 100644 --- a/client/components/d3-base/test/index.js +++ b/client/components/d3-base/test/index.js @@ -4,7 +4,6 @@ import { assert } from 'chai'; import { shallow, mount } from 'enzyme'; -import React from 'react'; import D3Base from '..'; const noop = () => {}; diff --git a/client/components/data/domain-management/index.jsx b/client/components/data/domain-management/index.jsx index 4c74ba0258b249..dfca290fd5b22e 100644 --- a/client/components/data/domain-management/index.jsx +++ b/client/components/data/domain-management/index.jsx @@ -1,6 +1,6 @@ import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createElement, Component } from 'react'; import { connect } from 'react-redux'; import QueryContactDetailsCache from 'calypso/components/data/query-contact-details-cache'; import QueryProductsList from 'calypso/components/data/query-products-list'; @@ -18,7 +18,7 @@ import { import { getPlansBySite } from 'calypso/state/sites/plans/selectors'; import { getSelectedSite } from 'calypso/state/ui/selectors'; -class DomainManagementData extends React.Component { +class DomainManagementData extends Component { static propTypes = { analyticsPath: PropTypes.string, analyticsTitle: PropTypes.string, @@ -54,7 +54,7 @@ class DomainManagementData extends React.Component { { needsProductsList && } - { React.createElement( this.props.component, { + { createElement( this.props.component, { context: this.props.context, domains: selectedSite ? this.props.domains : null, hasSiteDomainsLoaded: this.props.hasSiteDomainsLoaded, diff --git a/client/components/data/media-list-data/index.jsx b/client/components/data/media-list-data/index.jsx index 81c179ce290cb5..9e5b513db8e3fb 100644 --- a/client/components/data/media-list-data/index.jsx +++ b/client/components/data/media-list-data/index.jsx @@ -1,6 +1,6 @@ import { isEqual } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import passToChildren from 'calypso/lib/react-pass-to-children'; import { setQuery } from 'calypso/state/media/actions'; @@ -9,7 +9,7 @@ import getMediaSortedByDate from 'calypso/state/selectors/get-media-sorted-by-da import hasNextMediaPage from 'calypso/state/selectors/has-next-media-page'; import utils from './utils'; -export class MediaListData extends React.Component { +export class MediaListData extends Component { static displayName = 'MediaListData'; static propTypes = { diff --git a/client/components/data/media-list-data/test/index.jsx b/client/components/data/media-list-data/test/index.jsx index f4be98f0859c6c..3713650b035007 100644 --- a/client/components/data/media-list-data/test/index.jsx +++ b/client/components/data/media-list-data/test/index.jsx @@ -4,7 +4,6 @@ import { expect } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import { MediaListData } from 'calypso/components/data/media-list-data'; /** diff --git a/client/components/data/query-atat-eligibility/index.jsx b/client/components/data/query-atat-eligibility/index.jsx index 8657a3a28ebdbc..bdd8ff824e9934 100644 --- a/client/components/data/query-atat-eligibility/index.jsx +++ b/client/components/data/query-atat-eligibility/index.jsx @@ -1,11 +1,11 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { requestEligibility } from 'calypso/state/automated-transfer/actions'; function QueryAutomatedTransferEligibility( { siteId } ) { const dispatch = useDispatch(); - React.useEffect( () => { + useEffect( () => { siteId && dispatch( requestEligibility( siteId ) ); }, [ siteId, dispatch ] ); diff --git a/client/components/data/query-canonical-theme/index.jsx b/client/components/data/query-canonical-theme/index.jsx index 5deabb1441f927..b8b760ccd94177 100644 --- a/client/components/data/query-canonical-theme/index.jsx +++ b/client/components/data/query-canonical-theme/index.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { connect } from 'react-redux'; import QueryTheme from 'calypso/components/data/query-theme'; import { isWpcomTheme, isWporgTheme } from 'calypso/state/themes/selectors'; diff --git a/client/components/data/query-domain-dns/index.jsx b/client/components/data/query-domain-dns/index.jsx index 6dfa71d328ad7e..4a2e44a904e7d4 100644 --- a/client/components/data/query-domain-dns/index.jsx +++ b/client/components/data/query-domain-dns/index.jsx @@ -1,10 +1,10 @@ -import React from 'react'; +import { useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { fetchDns } from 'calypso/state/domains/dns/actions'; export default function QueryDomainDns( { domain } ) { const dispatch = useDispatch(); - React.useEffect( () => { + useEffect( () => { dispatch( fetchDns( domain ) ); }, [ dispatch, domain ] ); diff --git a/client/components/data/query-domain-info/index.js b/client/components/data/query-domain-info/index.js index e18a496a0712c7..a0d6eea0d93e14 100644 --- a/client/components/data/query-domain-info/index.js +++ b/client/components/data/query-domain-info/index.js @@ -1,11 +1,11 @@ -import React from 'react'; +import { useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { fetchWapiDomainInfo } from 'calypso/state/domains/transfer/actions'; export default function QueryDomainInfo( { domainName } ) { const dispatch = useDispatch(); - React.useEffect( () => { + useEffect( () => { dispatch( fetchWapiDomainInfo( domainName ) ); }, [ dispatch, domainName ] ); diff --git a/client/components/data/query-jetpack-scan-history/test/index.js b/client/components/data/query-jetpack-scan-history/test/index.js index 6bf55b5ac99619..91f926ee66bb0f 100644 --- a/client/components/data/query-jetpack-scan-history/test/index.js +++ b/client/components/data/query-jetpack-scan-history/test/index.js @@ -3,7 +3,6 @@ */ import { render } from '@testing-library/react'; -import React from 'react'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import QueryJetpackScanHistory from 'calypso/components/data/query-jetpack-scan-history'; diff --git a/client/components/data/query-jetpack-scan/test/index.js b/client/components/data/query-jetpack-scan/test/index.js index 2c6d7ecffdce23..d2f8e2b24f916f 100644 --- a/client/components/data/query-jetpack-scan/test/index.js +++ b/client/components/data/query-jetpack-scan/test/index.js @@ -3,7 +3,6 @@ */ import { render } from '@testing-library/react'; -import React from 'react'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import QueryJetpackScan from 'calypso/components/data/query-jetpack-scan'; diff --git a/client/components/data/query-order-transaction/index.jsx b/client/components/data/query-order-transaction/index.jsx index 2227654039d687..61880568cac5fc 100644 --- a/client/components/data/query-order-transaction/index.jsx +++ b/client/components/data/query-order-transaction/index.jsx @@ -1,11 +1,11 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { fetchOrderTransaction } from 'calypso/state/order-transactions/actions'; import getOrderTransactionError from 'calypso/state/selectors/get-order-transaction-error'; import isFetchingOrderTransaction from 'calypso/state/selectors/is-fetching-order-transaction'; -class QueryOrderTransaction extends React.Component { +class QueryOrderTransaction extends Component { static propTypes = { orderId: PropTypes.number.isRequired, pollIntervalMs: PropTypes.number, diff --git a/client/components/data/query-post-likes/index.jsx b/client/components/data/query-post-likes/index.jsx index 72cdffdfed1ea6..b76918afa72624 100644 --- a/client/components/data/query-post-likes/index.jsx +++ b/client/components/data/query-post-likes/index.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { Interval } from 'calypso/lib/interval'; import { requestPostLikes } from 'calypso/state/posts/likes/actions'; diff --git a/client/components/data/query-reader-list-items/index.jsx b/client/components/data/query-reader-list-items/index.jsx index de840e72ef23fe..754e238f666f19 100644 --- a/client/components/data/query-reader-list-items/index.jsx +++ b/client/components/data/query-reader-list-items/index.jsx @@ -1,11 +1,11 @@ -import React from 'react'; +import { useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { requestReaderListItems } from 'calypso/state/reader/lists/actions'; export default function QueryReaderListItems( { owner, slug } ) { const dispatch = useDispatch(); - React.useEffect( () => { + useEffect( () => { dispatch( requestReaderListItems( owner, slug ) ); }, [ dispatch, owner, slug ] ); diff --git a/client/components/data/query-reader-organizations/index.jsx b/client/components/data/query-reader-organizations/index.jsx index d2faeb9a504dcb..b9f634bf67b718 100644 --- a/client/components/data/query-reader-organizations/index.jsx +++ b/client/components/data/query-reader-organizations/index.jsx @@ -1,10 +1,10 @@ -import React from 'react'; +import { useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { requestOrganizations } from 'calypso/state/reader/organizations/actions'; export default function QueryReaderOrganizations() { const dispatch = useDispatch(); - React.useEffect( () => { + useEffect( () => { dispatch( requestOrganizations() ); }, [ dispatch ] ); diff --git a/client/components/data/query-rewind-backup-status/index.js b/client/components/data/query-rewind-backup-status/index.js index c6d5697e63e256..a220126837d91b 100644 --- a/client/components/data/query-rewind-backup-status/index.js +++ b/client/components/data/query-rewind-backup-status/index.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { Interval, EVERY_SECOND } from 'calypso/lib/interval'; import { getRewindBackupProgress } from 'calypso/state/activity-log/actions'; diff --git a/client/components/data/query-rewind-restore-status/index.js b/client/components/data/query-rewind-restore-status/index.js index f02dfe98d21ff6..b611bc7c896ced 100644 --- a/client/components/data/query-rewind-restore-status/index.js +++ b/client/components/data/query-rewind-restore-status/index.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { Interval, EVERY_SECOND } from 'calypso/lib/interval'; import { getRewindRestoreProgress } from 'calypso/state/activity-log/actions'; diff --git a/client/components/data/query-site-php-version/index.jsx b/client/components/data/query-site-php-version/index.jsx index 82188e37ea9a37..6ac124541c7881 100644 --- a/client/components/data/query-site-php-version/index.jsx +++ b/client/components/data/query-site-php-version/index.jsx @@ -1,10 +1,10 @@ -import React from 'react'; +import { useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { getAtomicPhpVersion } from 'calypso/state/hosting/actions'; export default function QuerySitePhpVersion( { siteId } ) { const dispatch = useDispatch(); - React.useEffect( () => { + useEffect( () => { dispatch( getAtomicPhpVersion( siteId ) ); }, [ dispatch, siteId ] ); diff --git a/client/components/data/query-sites/index.jsx b/client/components/data/query-sites/index.jsx index e266f29654293c..212ffa6a487fe7 100644 --- a/client/components/data/query-sites/index.jsx +++ b/client/components/data/query-sites/index.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Fragment, useEffect } from 'react'; +import { Fragment, useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { getPreference } from 'calypso/state/preferences/selectors'; import getPrimarySiteId from 'calypso/state/selectors/get-primary-site-id'; diff --git a/client/components/data/query-support-history/index.js b/client/components/data/query-support-history/index.js index 3e976961db7db7..0e5ddc84d8fb5b 100644 --- a/client/components/data/query-support-history/index.js +++ b/client/components/data/query-support-history/index.js @@ -1,11 +1,11 @@ -import React from 'react'; +import { useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { requestSupportHistory } from 'calypso/state/help/actions'; export default function QuerySupportHistory( { email } ) { const dispatch = useDispatch(); - React.useEffect( () => { + useEffect( () => { dispatch( requestSupportHistory( email ) ); }, [ dispatch, email ] ); diff --git a/client/components/data/query-tld-validation-schemas/test/index.jsx b/client/components/data/query-tld-validation-schemas/test/index.jsx index e455e01fdbdde1..8929ccaeb6c5d2 100644 --- a/client/components/data/query-tld-validation-schemas/test/index.jsx +++ b/client/components/data/query-tld-validation-schemas/test/index.jsx @@ -1,5 +1,4 @@ import { shallow } from 'enzyme'; -import React from 'react'; import { QueryTldValidationSchemas } from '../'; describe( 'QueryTldValidationSchemas', () => { diff --git a/client/components/data/query-verticals/test/index.js b/client/components/data/query-verticals/test/index.js index 2270055b4ad2e7..defd16d3207b84 100644 --- a/client/components/data/query-verticals/test/index.js +++ b/client/components/data/query-verticals/test/index.js @@ -1,5 +1,4 @@ import { shallow } from 'enzyme'; -import React from 'react'; import { QueryVerticals } from '../'; describe( 'QueryVerticals', () => { diff --git a/client/components/data/query-wordads-settings/index.jsx b/client/components/data/query-wordads-settings/index.jsx index deb1ea784e4211..aa757554bfbc35 100644 --- a/client/components/data/query-wordads-settings/index.jsx +++ b/client/components/data/query-wordads-settings/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { requestJetpackSettings } from 'calypso/state/jetpack/settings/actions'; import isRequestingJetpackSettings from 'calypso/state/selectors/is-requesting-jetpack-settings'; @@ -12,7 +12,7 @@ export default function QueryWordadsSettings( { siteId } ) { isRequestingJetpackSettings( state, siteId, null ) ); - React.useEffect( + useEffect( () => { dispatch( requestWordadsSettings( siteId ) ); diff --git a/client/components/date-picker/day.jsx b/client/components/date-picker/day.jsx index bc725521b341bb..fe69a14123cec6 100644 --- a/client/components/date-picker/day.jsx +++ b/client/components/date-picker/day.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - const noop = () => {}; const handleDayMouseEnter = ( date, modifiers, onMouseEnter = noop ) => ( event ) => { diff --git a/client/components/date-picker/docs/example.jsx b/client/components/date-picker/docs/example.jsx index 9a0ab59f5d5b29..607fbfd3162099 100644 --- a/client/components/date-picker/docs/example.jsx +++ b/client/components/date-picker/docs/example.jsx @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import DatePicker from 'calypso/components/date-picker'; import EventsTooltip from 'calypso/components/date-picker/events-tooltip'; diff --git a/client/components/date-picker/event.jsx b/client/components/date-picker/event.jsx index c6037a3db3a4df..5259ac1093bfac 100644 --- a/client/components/date-picker/event.jsx +++ b/client/components/date-picker/event.jsx @@ -1,6 +1,5 @@ import { Gridicon } from '@automattic/components'; import classNames from 'classnames'; -import React from 'react'; import SocialLogo from 'calypso/components/social-logo'; const renderIcon = ( icon ) => diff --git a/client/components/date-picker/events-tooltip.jsx b/client/components/date-picker/events-tooltip.jsx index 16ceb8b3422d04..b03ee540f27b3a 100644 --- a/client/components/date-picker/events-tooltip.jsx +++ b/client/components/date-picker/events-tooltip.jsx @@ -1,7 +1,7 @@ import { localize } from 'i18n-calypso'; import { map } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import Tooltip from 'calypso/components/tooltip'; import { CalendarEvent } from './event'; diff --git a/client/components/date-picker/index.jsx b/client/components/date-picker/index.jsx index 39ab72f34e96f9..761e9f7ef3419d 100644 --- a/client/components/date-picker/index.jsx +++ b/client/components/date-picker/index.jsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { merge, map, filter, get, debounce } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import DayPicker from 'react-day-picker'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; import DayItem from './day'; diff --git a/client/components/date-picker/nav-bar.jsx b/client/components/date-picker/nav-bar.jsx index 818372a72b21bf..5881d4460c54cd 100644 --- a/client/components/date-picker/nav-bar.jsx +++ b/client/components/date-picker/nav-bar.jsx @@ -1,6 +1,5 @@ import classNames from 'classnames'; import { translate } from 'i18n-calypso'; -import React from 'react'; const noop = () => {}; diff --git a/client/components/date-range/docs/example.jsx b/client/components/date-range/docs/example.jsx index 4221ae9363fa29..b178d508d9f489 100644 --- a/client/components/date-range/docs/example.jsx +++ b/client/components/date-range/docs/example.jsx @@ -1,5 +1,5 @@ import { Card } from '@automattic/components'; -import React, { Fragment, Component } from 'react'; +import { Fragment, Component } from 'react'; import DateRange from '../index.js'; /* diff --git a/client/components/date-range/index.js b/client/components/date-range/index.js index be161fc66e54d7..7b7aecf582803d 100644 --- a/client/components/date-range/index.js +++ b/client/components/date-range/index.js @@ -4,7 +4,7 @@ import { localize } from 'i18n-calypso'; import { has } from 'lodash'; import moment from 'moment'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { createRef, Component } from 'react'; import { DateUtils } from 'react-day-picker'; import DatePicker from 'calypso/components/date-picker'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; @@ -110,7 +110,7 @@ export class DateRange extends Component { }; // Ref to the Trigger ; diff --git a/client/devdocs/docs-example/test/index.jsx b/client/devdocs/docs-example/test/index.jsx index 7c4d938bf7cd4f..124aa2cfbb919f 100644 --- a/client/devdocs/docs-example/test/index.jsx +++ b/client/devdocs/docs-example/test/index.jsx @@ -1,6 +1,5 @@ import { Button } from '@automattic/components'; import { shallow } from 'enzyme'; -import React from 'react'; import DocsExample, { DocsExampleToggle } from '../index'; const noop = () => {}; diff --git a/client/devdocs/docs-example/wrapper.jsx b/client/devdocs/docs-example/wrapper.jsx index 07d39393f3b30f..d64d302ab9ffa5 100644 --- a/client/devdocs/docs-example/wrapper.jsx +++ b/client/devdocs/docs-example/wrapper.jsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import DocsExampleError from 'calypso/devdocs/docs-example/error'; const renderTitle = ( unique, name, url, onTitleClick ) => diff --git a/client/devdocs/docs-selectors/index.jsx b/client/devdocs/docs-selectors/index.jsx index 7f98c99c0c337e..84ba4c9125e650 100644 --- a/client/devdocs/docs-selectors/index.jsx +++ b/client/devdocs/docs-selectors/index.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import DocumentHead from 'calypso/components/data/document-head'; import Main from 'calypso/components/main'; import ReadmeViewer from 'calypso/components/readme-viewer'; diff --git a/client/devdocs/docs-selectors/param-type.jsx b/client/devdocs/docs-selectors/param-type.jsx index 78563696ae81d6..212998976ab30c 100644 --- a/client/devdocs/docs-selectors/param-type.jsx +++ b/client/devdocs/docs-selectors/param-type.jsx @@ -1,6 +1,5 @@ import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; /** * Matches an expression type diff --git a/client/devdocs/docs-selectors/result.jsx b/client/devdocs/docs-selectors/result.jsx index 2e572d591f4f62..c25120c201009d 100644 --- a/client/devdocs/docs-selectors/result.jsx +++ b/client/devdocs/docs-selectors/result.jsx @@ -2,7 +2,6 @@ import { Card } from '@automattic/components'; import classnames from 'classnames'; import { filter, findLast } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import DocsSelectorsParamType from './param-type'; export default function DocsSelectorsResult( { url, name, description, tags, expanded } ) { diff --git a/client/devdocs/docs-selectors/search.jsx b/client/devdocs/docs-selectors/search.jsx index e0b2149c822d4c..fe579738ed18a0 100644 --- a/client/devdocs/docs-selectors/search.jsx +++ b/client/devdocs/docs-selectors/search.jsx @@ -2,7 +2,7 @@ import { map } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; import { stringify } from 'qs'; -import React, { Component } from 'react'; +import { Component } from 'react'; import EmptyContent from 'calypso/components/empty-content'; import SearchCard from 'calypso/components/search-card'; import { addQueryArgs } from 'calypso/lib/url'; diff --git a/client/devdocs/docs-selectors/single.jsx b/client/devdocs/docs-selectors/single.jsx index a803320f07b2bb..d9c42c07028eba 100644 --- a/client/devdocs/docs-selectors/single.jsx +++ b/client/devdocs/docs-selectors/single.jsx @@ -2,7 +2,7 @@ import { find } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; import { stringify } from 'qs'; -import React, { Component } from 'react'; +import { Component } from 'react'; import HeaderCake from 'calypso/components/header-cake'; import { addQueryArgs } from 'calypso/lib/url'; import DocsSelectorsResult from './result'; diff --git a/client/devdocs/error.jsx b/client/devdocs/error.jsx index 3cdb99561e62b6..a2f0d0e85d79fb 100644 --- a/client/devdocs/error.jsx +++ b/client/devdocs/error.jsx @@ -1,6 +1,6 @@ -import React from 'react'; +import { PureComponent } from 'react'; -export default class extends React.PureComponent { +export default class extends PureComponent { static displayName = 'Error'; render() { diff --git a/client/devdocs/main.jsx b/client/devdocs/main.jsx index 3c48cbd16542de..66f8dffbe9ff52 100644 --- a/client/devdocs/main.jsx +++ b/client/devdocs/main.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import debug from 'debug'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import DocumentHead from 'calypso/components/data/document-head'; import Main from 'calypso/components/main'; import SearchCard from 'calypso/components/search-card'; @@ -29,7 +29,7 @@ const DEFAULT_FILES = [ const log = debug( 'calypso:devdocs' ); -export default class Devdocs extends React.Component { +export default class Devdocs extends Component { static displayName = 'Devdocs'; static propTypes = { diff --git a/client/devdocs/sidebar.jsx b/client/devdocs/sidebar.jsx index 67c85d5fab643d..ff191b9f56701d 100644 --- a/client/devdocs/sidebar.jsx +++ b/client/devdocs/sidebar.jsx @@ -1,10 +1,10 @@ -import React from 'react'; +import { PureComponent } from 'react'; import Sidebar from 'calypso/layout/sidebar'; import SidebarHeading from 'calypso/layout/sidebar/heading'; import SidebarItem from 'calypso/layout/sidebar/item'; import SidebarMenu from 'calypso/layout/sidebar/menu'; -export default class DevdocsSidebar extends React.PureComponent { +export default class DevdocsSidebar extends PureComponent { static displayName = 'DevdocsSidebar'; isItemSelected( itemPath, isStrict = true ) { diff --git a/client/devdocs/test/doc.jsx b/client/devdocs/test/doc.jsx index 5e5a3f669c5c73..cc23e169818563 100644 --- a/client/devdocs/test/doc.jsx +++ b/client/devdocs/test/doc.jsx @@ -3,7 +3,6 @@ */ import { shallow } from 'enzyme'; -import React from 'react'; import SingleDocClass from '../doc'; jest.mock( 'calypso/devdocs/service', () => ( { diff --git a/client/devdocs/welcome.jsx b/client/devdocs/welcome.jsx index fe9346f0874a71..a37ded92b6b1ca 100644 --- a/client/devdocs/welcome.jsx +++ b/client/devdocs/welcome.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; -import React from 'react'; +import { PureComponent } from 'react'; -export default class extends React.PureComponent { +export default class extends PureComponent { static displayName = 'DevWelcome'; render() { diff --git a/client/devdocs/wizard-component/index.jsx b/client/devdocs/wizard-component/index.jsx index 871eb12f5d2fa1..3bccd6ab371c5f 100644 --- a/client/devdocs/wizard-component/index.jsx +++ b/client/devdocs/wizard-component/index.jsx @@ -1,5 +1,5 @@ import page from 'page'; -import React, { Component } from 'react'; +import { Component } from 'react'; import HeaderCake from 'calypso/components/header-cake'; import Main from 'calypso/components/main'; import ReadmeViewer from 'calypso/components/readme-viewer'; diff --git a/client/document/404.jsx b/client/document/404.jsx index 88a57a832b7a02..d1ad1cec151e3b 100644 --- a/client/document/404.jsx +++ b/client/document/404.jsx @@ -1,6 +1,5 @@ import config from '@automattic/calypso-config'; import classNames from 'classnames'; -import React from 'react'; import EmptyContent from 'calypso/components/empty-content'; import Head from 'calypso/components/head'; import { chunkCssLinks } from './utils'; diff --git a/client/document/500.jsx b/client/document/500.jsx index 43ec93f508ac96..96e49b2ee841d8 100644 --- a/client/document/500.jsx +++ b/client/document/500.jsx @@ -1,6 +1,5 @@ import config from '@automattic/calypso-config'; import classNames from 'classnames'; -import React from 'react'; import EmptyContent from 'calypso/components/empty-content'; import Head from 'calypso/components/head'; import { chunkCssLinks } from './utils'; diff --git a/client/document/browsehappy.jsx b/client/document/browsehappy.jsx index e9f4a7f32f9b3a..f06eca1050c4c2 100644 --- a/client/document/browsehappy.jsx +++ b/client/document/browsehappy.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import Head from 'calypso/components/head'; import BrowsehappyBody from 'calypso/landing/browsehappy'; import { chunkCssLinks } from './utils'; diff --git a/client/document/domains-landing.jsx b/client/document/domains-landing.jsx index 51d927b64eea03..4258fa3b4e1af4 100644 --- a/client/document/domains-landing.jsx +++ b/client/document/domains-landing.jsx @@ -1,5 +1,4 @@ import classnames from 'classnames'; -import React from 'react'; import Head from 'calypso/components/head'; import { jsonStringifyForHtml } from 'calypso/server/sanitize'; import { chunkCssLinks } from './utils'; diff --git a/client/document/index.jsx b/client/document/index.jsx index 0805c229347fc5..8202b82e113af1 100644 --- a/client/document/index.jsx +++ b/client/document/index.jsx @@ -1,7 +1,7 @@ import path from 'path'; import config from '@automattic/calypso-config'; import classNames from 'classnames'; -import React from 'react'; +import { Component } from 'react'; import EnvironmentBadge, { Branch, AuthHelper, @@ -16,7 +16,7 @@ import { jsonStringifyForHtml } from 'calypso/server/sanitize'; import { isBilmurEnabled, getBilmurUrl } from './utils/bilmur'; import { chunkCssLinks } from './utils/chunk'; -class Document extends React.Component { +class Document extends Component { render() { const { app, diff --git a/client/document/support-user.jsx b/client/document/support-user.jsx index e7c1bb40e260b0..1373f3016cb4d6 100644 --- a/client/document/support-user.jsx +++ b/client/document/support-user.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - function supportUserFn( { user, token, path, authorized } ) { const url = window.location.toString(); diff --git a/client/document/utils/chunk.jsx b/client/document/utils/chunk.jsx index 2b13cb4f8f785e..3db7cec815018d 100644 --- a/client/document/utils/chunk.jsx +++ b/client/document/utils/chunk.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - export function chunkCssLinks( chunkAssets, isRTL = false ) { const styleAssets = chunkAssets[ isRTL ? 'css.rtl' : 'css.ltr' ]; return styleAssets.map( ( asset ) => ( diff --git a/client/gutenberg/editor/controller.js b/client/gutenberg/editor/controller.js index a8042afd142f2b..064ed008ba0b13 100644 --- a/client/gutenberg/editor/controller.js +++ b/client/gutenberg/editor/controller.js @@ -1,6 +1,5 @@ import { isEnabled } from '@automattic/calypso-config'; import { get, has } from 'lodash'; -import React from 'react'; import { makeLayout, render } from 'calypso/controller'; import { addQueryArgs } from 'calypso/lib/route'; import { EDITOR_START, POST_EDIT } from 'calypso/state/action-types'; diff --git a/client/gutenberg/editor/placeholder.jsx b/client/gutenberg/editor/placeholder.jsx index c7eabbf045890a..a47545e4f067b5 100644 --- a/client/gutenberg/editor/placeholder.jsx +++ b/client/gutenberg/editor/placeholder.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - import './style.scss'; /* eslint-disable wpcalypso/jsx-classname-namespace */ diff --git a/client/incoming-redirect/controller.js b/client/incoming-redirect/controller.js index 43457048e519ca..0c8815cdc7a759 100644 --- a/client/incoming-redirect/controller.js +++ b/client/incoming-redirect/controller.js @@ -1,5 +1,4 @@ import { translate } from 'i18n-calypso'; -import React from 'react'; import EmptyContent from 'calypso/components/empty-content'; import TitanRedirector from 'calypso/my-sites/email/titan-redirector'; diff --git a/client/jetpack-cloud/index.js b/client/jetpack-cloud/index.js index dfcc5fd3a96d89..5e1d947b45f127 100644 --- a/client/jetpack-cloud/index.js +++ b/client/jetpack-cloud/index.js @@ -1,7 +1,6 @@ import Debug from 'debug'; import { translate } from 'i18n-calypso'; import page from 'page'; -import React from 'react'; import { makeLayout, render as clientRender } from 'calypso/controller'; import { sites, siteSelection } from 'calypso/my-sites/controller'; import { getCurrentUser } from 'calypso/state/current-user/selectors'; diff --git a/client/jetpack-cloud/sections/partner-portal/credit-card-fields/cvv-image.js b/client/jetpack-cloud/sections/partner-portal/credit-card-fields/cvv-image.js index 7a67e81f08408c..0039a1de3158ec 100644 --- a/client/jetpack-cloud/sections/partner-portal/credit-card-fields/cvv-image.js +++ b/client/jetpack-cloud/sections/partner-portal/credit-card-fields/cvv-image.js @@ -1,6 +1,5 @@ import styled from '@emotion/styled'; import { useI18n } from '@wordpress/react-i18n'; -import React from 'react'; function CVV( { className } ) { const { __ } = useI18n(); diff --git a/client/jetpack-cloud/sections/partner-portal/payment-methods/stored-credit-card-method.js b/client/jetpack-cloud/sections/partner-portal/payment-methods/stored-credit-card-method.js index e145d7a03a92f8..ffff1d200dc2e4 100644 --- a/client/jetpack-cloud/sections/partner-portal/payment-methods/stored-credit-card-method.js +++ b/client/jetpack-cloud/sections/partner-portal/payment-methods/stored-credit-card-method.js @@ -1,4 +1,3 @@ -import React from 'react'; import CreditCardFields from 'calypso/jetpack-cloud/sections/partner-portal/credit-card-fields'; import CreditCardPayButton from 'calypso/jetpack-cloud/sections/partner-portal/credit-card-fields/credit-card-pay-button'; diff --git a/client/jetpack-cloud/sections/settings/loading/test/index.jsx b/client/jetpack-cloud/sections/settings/loading/test/index.jsx index 3dc0fd32faac5a..b138fb30e22f1d 100644 --- a/client/jetpack-cloud/sections/settings/loading/test/index.jsx +++ b/client/jetpack-cloud/sections/settings/loading/test/index.jsx @@ -2,7 +2,6 @@ * @jest-environment jsdom */ -import React from 'react'; import { render } from 'calypso/test-helpers/config/testing-library'; import '@testing-library/jest-dom/extend-expect'; import AdvancedCredentialsLoadingPlaceholder from '../index'; diff --git a/client/jetpack-cloud/sections/settings/main.jsx b/client/jetpack-cloud/sections/settings/main.jsx index 0ec870c3353e96..db188dc304724b 100644 --- a/client/jetpack-cloud/sections/settings/main.jsx +++ b/client/jetpack-cloud/sections/settings/main.jsx @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { localize, useTranslate } from 'i18n-calypso'; -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import connectedIcon from 'calypso/assets/images/jetpack/connected.svg'; import disconnectedIcon from 'calypso/assets/images/jetpack/disconnected.svg'; diff --git a/client/jetpack-cloud/sections/settings/test/empty-content.jsx b/client/jetpack-cloud/sections/settings/test/empty-content.jsx index 9bd63aaddc3175..ec2b27853bb298 100644 --- a/client/jetpack-cloud/sections/settings/test/empty-content.jsx +++ b/client/jetpack-cloud/sections/settings/test/empty-content.jsx @@ -2,7 +2,6 @@ * @jest-environment jsdom */ -import React from 'react'; import '@testing-library/jest-dom/extend-expect'; import { JETPACK_PRICING_PAGE } from 'calypso/lib/url/support'; import { render } from 'calypso/test-helpers/config/testing-library'; diff --git a/client/jetpack-connect/auth-form-header.jsx b/client/jetpack-connect/auth-form-header.jsx index 4c18b7736ec9f9..dfe7ac4c4fac42 100644 --- a/client/jetpack-connect/auth-form-header.jsx +++ b/client/jetpack-connect/auth-form-header.jsx @@ -1,7 +1,7 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Site from 'calypso/blocks/site'; import FormattedHeader from 'calypso/components/formatted-header'; diff --git a/client/jetpack-connect/authorize.js b/client/jetpack-connect/authorize.js index 885a2951e1ee80..83e20a3a07f2a8 100644 --- a/client/jetpack-connect/authorize.js +++ b/client/jetpack-connect/authorize.js @@ -4,7 +4,7 @@ import debugModule from 'debug'; import { localize } from 'i18n-calypso'; import { flowRight, get, includes, startsWith } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QuerySitePurchases from 'calypso/components/data/query-site-purchases'; import QueryUserConnection from 'calypso/components/data/query-user-connection'; diff --git a/client/jetpack-connect/controller.js b/client/jetpack-connect/controller.js index d20a91f92f250b..f160265bd13630 100644 --- a/client/jetpack-connect/controller.js +++ b/client/jetpack-connect/controller.js @@ -24,7 +24,6 @@ import { import Debug from 'debug'; import { get, some } from 'lodash'; import page from 'page'; -import React from 'react'; import { recordPageView } from 'calypso/lib/analytics/page-view'; import { getLocaleFromPath, removeLocaleFromPath } from 'calypso/lib/i18n-utils'; import { navigate } from 'calypso/lib/navigate'; diff --git a/client/jetpack-connect/disclaimer.jsx b/client/jetpack-connect/disclaimer.jsx index b48cd4ed8409e3..c75b3d426a7db2 100644 --- a/client/jetpack-connect/disclaimer.jsx +++ b/client/jetpack-connect/disclaimer.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import { localizeUrl } from 'calypso/lib/i18n-utils'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; diff --git a/client/jetpack-connect/example-components/jetpack-activate.jsx b/client/jetpack-connect/example-components/jetpack-activate.jsx index 034a313b546934..bba855530a626a 100644 --- a/client/jetpack-connect/example-components/jetpack-activate.jsx +++ b/client/jetpack-connect/example-components/jetpack-activate.jsx @@ -1,7 +1,6 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import FormTextInput from 'calypso/components/forms/form-text-input'; const JetpackConnectExampleActivate = ( { isInstall, url, translate, onClick } ) => { diff --git a/client/jetpack-connect/example-components/jetpack-connect.jsx b/client/jetpack-connect/example-components/jetpack-connect.jsx index 574c85495e3cfe..4e646d1ccfce71 100644 --- a/client/jetpack-connect/example-components/jetpack-connect.jsx +++ b/client/jetpack-connect/example-components/jetpack-connect.jsx @@ -1,7 +1,6 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import FormTextInput from 'calypso/components/forms/form-text-input'; const JetpackConnectExampleConnect = ( { url, translate, onClick } ) => { diff --git a/client/jetpack-connect/example-components/jetpack-install.jsx b/client/jetpack-connect/example-components/jetpack-install.jsx index 9acb68f692d313..861d4d94024920 100644 --- a/client/jetpack-connect/example-components/jetpack-install.jsx +++ b/client/jetpack-connect/example-components/jetpack-install.jsx @@ -1,7 +1,6 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import FormTextInput from 'calypso/components/forms/form-text-input'; const JetpackConnectExampleInstall = ( { url, translate, onClick } ) => { diff --git a/client/jetpack-connect/happychat-button.jsx b/client/jetpack-connect/happychat-button.jsx index 3d3825a5f2be59..e764bd3040935c 100644 --- a/client/jetpack-connect/happychat-button.jsx +++ b/client/jetpack-connect/happychat-button.jsx @@ -2,7 +2,6 @@ import { isEnabled } from '@automattic/calypso-config'; import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import HappychatButton from 'calypso/components/happychat/button'; import HappychatConnection from 'calypso/components/happychat/connection-connected'; diff --git a/client/jetpack-connect/help-button.jsx b/client/jetpack-connect/help-button.jsx index ce50aa02e94b62..bad97c3ea6fbe6 100644 --- a/client/jetpack-connect/help-button.jsx +++ b/client/jetpack-connect/help-button.jsx @@ -1,7 +1,7 @@ import { Gridicon } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { useCallback } from 'react'; import { useDispatch } from 'react-redux'; import LoggedOutFormLinkItem from 'calypso/components/logged-out-form/link-item'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; @@ -10,7 +10,7 @@ export default function JetpackConnectHelpButton( { label, url } ) { const dispatch = useDispatch(); const translate = useTranslate(); - const recordClick = React.useCallback( () => { + const recordClick = useCallback( () => { dispatch( recordTracksEvent( 'calypso_jpc_help_link_click' ) ); }, [ dispatch ] ); diff --git a/client/jetpack-connect/install-instructions.jsx b/client/jetpack-connect/install-instructions.jsx index a9426ac0f7c544..052aceb8b7b18f 100644 --- a/client/jetpack-connect/install-instructions.jsx +++ b/client/jetpack-connect/install-instructions.jsx @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormattedHeader from 'calypso/components/formatted-header'; import LoggedOutFormLinks from 'calypso/components/logged-out-form/links'; diff --git a/client/jetpack-connect/install-step.jsx b/client/jetpack-connect/install-step.jsx index 368834596c3924..3017d3dfcf09a9 100644 --- a/client/jetpack-connect/install-step.jsx +++ b/client/jetpack-connect/install-step.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { preventWidows } from 'calypso/lib/formatting'; import JetpackExampleActivate from './example-components/jetpack-activate'; import JetpackExampleConnect from './example-components/jetpack-connect'; diff --git a/client/jetpack-connect/jetpack-connect-notices.jsx b/client/jetpack-connect/jetpack-connect-notices.jsx index 4751b0c8cace8a..51701aebe02af6 100644 --- a/client/jetpack-connect/jetpack-connect-notices.jsx +++ b/client/jetpack-connect/jetpack-connect-notices.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import Notice from 'calypso/components/notice'; import NoticeAction from 'calypso/components/notice/notice-action'; import { diff --git a/client/jetpack-connect/jetpack-connection.jsx b/client/jetpack-connect/jetpack-connection.jsx index f8b8a85bd17774..ca928fbe8d5320 100644 --- a/client/jetpack-connect/jetpack-connection.jsx +++ b/client/jetpack-connect/jetpack-connection.jsx @@ -3,7 +3,7 @@ import debugModule from 'debug'; import { localize } from 'i18n-calypso'; import { flowRight, get, omit } from 'lodash'; import page from 'page'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import LoggedOutFormLinkItem from 'calypso/components/logged-out-form/link-item'; import LoggedOutFormLinks from 'calypso/components/logged-out-form/links'; diff --git a/client/jetpack-connect/jetpack-remote-install-notices.jsx b/client/jetpack-connect/jetpack-remote-install-notices.jsx index 7d0385c50e0ab2..41d086c1203dc3 100644 --- a/client/jetpack-connect/jetpack-remote-install-notices.jsx +++ b/client/jetpack-connect/jetpack-remote-install-notices.jsx @@ -1,7 +1,7 @@ import { Button, Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import FormattedHeader from 'calypso/components/formatted-header'; import { addQueryArgs } from 'calypso/lib/route'; diff --git a/client/jetpack-connect/main-header.jsx b/client/jetpack-connect/main-header.jsx index 47b75208b3afd9..eb5dc3e38a4f78 100644 --- a/client/jetpack-connect/main-header.jsx +++ b/client/jetpack-connect/main-header.jsx @@ -9,7 +9,7 @@ import { import { localize } from 'i18n-calypso'; import { concat } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import FormattedHeader from 'calypso/components/formatted-header'; import { FLOW_TYPES } from 'calypso/jetpack-connect/flow-types'; diff --git a/client/jetpack-connect/main-wrapper.jsx b/client/jetpack-connect/main-wrapper.jsx index 3664c0c9ba9113..d797c16a935aaf 100644 --- a/client/jetpack-connect/main-wrapper.jsx +++ b/client/jetpack-connect/main-wrapper.jsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import JetpackHeader from 'calypso/components/jetpack-header'; diff --git a/client/jetpack-connect/main.jsx b/client/jetpack-connect/main.jsx index d0aeb64539789e..f816384e97d6da 100644 --- a/client/jetpack-connect/main.jsx +++ b/client/jetpack-connect/main.jsx @@ -2,7 +2,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { concat, flowRight, includes } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import LocaleSuggestions from 'calypso/components/locale-suggestions'; import { FLOW_TYPES } from 'calypso/jetpack-connect/flow-types'; diff --git a/client/jetpack-connect/no-direct-access-error.js b/client/jetpack-connect/no-direct-access-error.js index bb33f96ebc3665..90955a006461d0 100644 --- a/client/jetpack-connect/no-direct-access-error.js +++ b/client/jetpack-connect/no-direct-access-error.js @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import EmptyContent from 'calypso/components/empty-content'; import LoggedOutFormLinks from 'calypso/components/logged-out-form/links'; diff --git a/client/jetpack-connect/remote-credentials.js b/client/jetpack-connect/remote-credentials.js index 0d80348493b7f5..e82a1ff7a7bcbe 100644 --- a/client/jetpack-connect/remote-credentials.js +++ b/client/jetpack-connect/remote-credentials.js @@ -6,7 +6,7 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import { flowRight } from 'lodash'; import page from 'page'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import FormattedHeader from 'calypso/components/formatted-header'; import FormButton from 'calypso/components/forms/form-button'; diff --git a/client/jetpack-connect/search.jsx b/client/jetpack-connect/search.jsx index 0aea516ee08327..c315fa38389418 100644 --- a/client/jetpack-connect/search.jsx +++ b/client/jetpack-connect/search.jsx @@ -3,7 +3,7 @@ import { localize } from 'i18n-calypso'; import { concat, flowRight } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import LoggedOutFormLinkItem from 'calypso/components/logged-out-form/link-item'; import LoggedOutFormLinks from 'calypso/components/logged-out-form/links'; diff --git a/client/jetpack-connect/signup.js b/client/jetpack-connect/signup.js index a2aaee24dcecae..c070f4096cb62f 100644 --- a/client/jetpack-connect/signup.js +++ b/client/jetpack-connect/signup.js @@ -13,7 +13,7 @@ import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import { flowRight, get, includes } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import JetpackConnectSiteOnly from 'calypso/blocks/jetpack-connect-site-only'; import LoginBlock from 'calypso/blocks/login'; diff --git a/client/jetpack-connect/site-url-input.jsx b/client/jetpack-connect/site-url-input.jsx index 65998c9d3069fe..b2a4d7acb9edaa 100644 --- a/client/jetpack-connect/site-url-input.jsx +++ b/client/jetpack-connect/site-url-input.jsx @@ -1,7 +1,7 @@ import { Card, Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import FormLabel from 'calypso/components/forms/form-label'; import FormTextInput from 'calypso/components/forms/form-text-input'; import Spinner from 'calypso/components/spinner'; diff --git a/client/jetpack-connect/sso.jsx b/client/jetpack-connect/sso.jsx index 59f16587252d6d..134e13afc86c62 100644 --- a/client/jetpack-connect/sso.jsx +++ b/client/jetpack-connect/sso.jsx @@ -3,7 +3,7 @@ import { Button, Card, CompactCard, Dialog, Gridicon } from '@automattic/compone import debugModule from 'debug'; import { localize } from 'i18n-calypso'; import { flowRight, get, map } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Site from 'calypso/blocks/site'; import SitePlaceholder from 'calypso/blocks/site/placeholder'; diff --git a/client/jetpack-connect/test/auth-form-header.js b/client/jetpack-connect/test/auth-form-header.js index 874f9e1de09666..13c4eaebb8c835 100644 --- a/client/jetpack-connect/test/auth-form-header.js +++ b/client/jetpack-connect/test/auth-form-header.js @@ -3,7 +3,6 @@ */ import { shallow } from 'enzyme'; -import React from 'react'; import FormattedHeader from 'calypso/components/formatted-header'; import { AuthFormHeader } from '../auth-form-header'; import wooDnaConfig from '../woo-dna-config'; diff --git a/client/jetpack-connect/test/authorize.js b/client/jetpack-connect/test/authorize.js index 08c319c8b16abf..d389cf2e3a528e 100644 --- a/client/jetpack-connect/test/authorize.js +++ b/client/jetpack-connect/test/authorize.js @@ -4,7 +4,6 @@ import deepFreeze from 'deep-freeze'; import { shallow } from 'enzyme'; -import React from 'react'; import { JetpackAuthorize } from '../authorize'; const noop = () => {}; diff --git a/client/jetpack-connect/test/jetpack-connect-notices.js b/client/jetpack-connect/test/jetpack-connect-notices.js index 9bc8f945d17bdc..0b485794218d77 100644 --- a/client/jetpack-connect/test/jetpack-connect-notices.js +++ b/client/jetpack-connect/test/jetpack-connect-notices.js @@ -3,7 +3,6 @@ */ import { shallow } from 'enzyme'; -import React from 'react'; import { JetpackConnectNotices } from '../jetpack-connect-notices'; const terminalErrorNoticeType = 'siteBlocked'; diff --git a/client/jetpack-connect/test/main-wrapper.jsx b/client/jetpack-connect/test/main-wrapper.jsx index a4a095fa102b3f..710a2d03fe6385 100644 --- a/client/jetpack-connect/test/main-wrapper.jsx +++ b/client/jetpack-connect/test/main-wrapper.jsx @@ -5,7 +5,6 @@ jest.mock( 'calypso/components/data/document-head', () => 'DocumentHead' ); import { shallow } from 'enzyme'; -import React from 'react'; import Main from 'calypso/components/main'; import { JetpackConnectMainWrapper } from '../main-wrapper'; diff --git a/client/jetpack-connect/test/signup.js b/client/jetpack-connect/test/signup.js index 86566916a70835..aaed4d1b948934 100644 --- a/client/jetpack-connect/test/signup.js +++ b/client/jetpack-connect/test/signup.js @@ -4,7 +4,6 @@ import deepFreeze from 'deep-freeze'; import { shallow } from 'enzyme'; -import React from 'react'; import FormattedHeader from 'calypso/components/formatted-header'; import LocaleSuggestions from 'calypso/components/locale-suggestions'; import { JetpackSignup } from '../signup.js'; diff --git a/client/landing/browsehappy/circle.jsx b/client/landing/browsehappy/circle.jsx index 481a924511df40..f233d9d5b27c2d 100644 --- a/client/landing/browsehappy/circle.jsx +++ b/client/landing/browsehappy/circle.jsx @@ -1,5 +1,4 @@ import classNames from 'classnames'; -import React from 'react'; import './circle.scss'; diff --git a/client/landing/browsehappy/index.jsx b/client/landing/browsehappy/index.jsx index 5db4d19562e8d3..8ed328ab966a34 100644 --- a/client/landing/browsehappy/index.jsx +++ b/client/landing/browsehappy/index.jsx @@ -1,5 +1,4 @@ import { __ } from '@wordpress/i18n'; -import React from 'react'; import { addQueryArgs } from 'calypso/lib/url'; import Circle from './circle'; import illustrationURL from './illustration.svg'; diff --git a/client/landing/browsehappy/logo-wide.jsx b/client/landing/browsehappy/logo-wide.jsx index b37a3038da2997..b7f5bff3d80567 100644 --- a/client/landing/browsehappy/logo-wide.jsx +++ b/client/landing/browsehappy/logo-wide.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - export default function Logo() { return ( diff --git a/client/landing/domains/content-card/index.jsx b/client/landing/domains/content-card/index.jsx index eb5677874a64cb..9d1bfd3a941232 100644 --- a/client/landing/domains/content-card/index.jsx +++ b/client/landing/domains/content-card/index.jsx @@ -1,7 +1,7 @@ import { Button, CompactCard } from '@automattic/components'; import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import './style.scss'; diff --git a/client/landing/domains/header/index.jsx b/client/landing/domains/header/index.jsx index ce16a7daa87912..bd482279e832a3 100644 --- a/client/landing/domains/header/index.jsx +++ b/client/landing/domains/header/index.jsx @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import WordPressLogo from 'calypso/components/wordpress-logo'; import './style.scss'; diff --git a/client/landing/domains/index.jsx b/client/landing/domains/index.jsx index eb1e9ddf338b2f..ebce2d0063a03b 100644 --- a/client/landing/domains/index.jsx +++ b/client/landing/domains/index.jsx @@ -1,7 +1,7 @@ import '@automattic/calypso-polyfills'; import i18n from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import RenderDom from 'react-dom'; import Main from 'calypso/components/main'; import InvalidActionPage from './invalid-action'; diff --git a/client/landing/domains/invalid-action/index.jsx b/client/landing/domains/invalid-action/index.jsx index cb9f3384c41a0a..4d2983d02ec7f7 100644 --- a/client/landing/domains/invalid-action/index.jsx +++ b/client/landing/domains/invalid-action/index.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { CALYPSO_CONTACT } from 'calypso/lib/url/support'; import DomainsLandingContentCard from '../content-card'; import DomainsLandingHeader from '../header'; diff --git a/client/landing/domains/registrant-verification/index.jsx b/client/landing/domains/registrant-verification/index.jsx index 5d5709db8c79ea..74f226dcb3a9b4 100644 --- a/client/landing/domains/registrant-verification/index.jsx +++ b/client/landing/domains/registrant-verification/index.jsx @@ -1,7 +1,7 @@ import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { CALYPSO_CONTACT } from 'calypso/lib/url/support'; import wp from 'calypso/lib/wp'; import { domainManagementRoot } from 'calypso/my-sites/domains/paths'; diff --git a/client/landing/domains/transfer-away-confirmation/index.jsx b/client/landing/domains/transfer-away-confirmation/index.jsx index 26077edb28d357..efbd3d0586cd5a 100644 --- a/client/landing/domains/transfer-away-confirmation/index.jsx +++ b/client/landing/domains/transfer-away-confirmation/index.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { CALYPSO_CONTACT } from 'calypso/lib/url/support'; import wp from 'calypso/lib/wp'; import DomainsLandingContentCard from '../content-card'; diff --git a/client/layout/body-section-css-class.js b/client/layout/body-section-css-class.js index b51cb62bb00357..781284430453cb 100644 --- a/client/layout/body-section-css-class.js +++ b/client/layout/body-section-css-class.js @@ -1,4 +1,4 @@ -import React from 'react'; +import { useEffect } from 'react'; /* * React component that manages `is-section-*` and `is-group-*` class names on the @@ -11,7 +11,7 @@ import React from 'react'; * specified declaratively and the DOM diffing and patching is done by React itself. */ function useBodyClass( prefix, value ) { - React.useEffect( () => { + useEffect( () => { // if value is empty-ish, don't add or remove any CSS classes if ( ! value ) { return; @@ -41,7 +41,7 @@ function useBodyClass( prefix, value ) { export default function BodySectionCssClass( { group, section, bodyClass } ) { useBodyClass( 'is-group-', group ); useBodyClass( 'is-section-', section ); - React.useEffect( () => { + useEffect( () => { if ( ! Array.isArray( bodyClass ) || bodyClass.length === 0 ) { return; } diff --git a/client/layout/community-translator/launcher.jsx b/client/layout/community-translator/launcher.jsx index 3be5e9c3a6f8a9..ad8fa5d4439e18 100644 --- a/client/layout/community-translator/launcher.jsx +++ b/client/layout/community-translator/launcher.jsx @@ -4,7 +4,7 @@ import { addQueryArgs } from '@wordpress/url'; import classNames from 'classnames'; import i18n, { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { createRef, Component, Fragment } from 'react'; import ReactDOM from 'react-dom'; import { connect } from 'react-redux'; import localStorageHelper from 'store'; @@ -26,7 +26,7 @@ import getUserSettings from 'calypso/state/selectors/get-user-settings'; import { setLocale } from 'calypso/state/ui/language/actions'; import './style.scss'; -class TranslatorLauncher extends React.Component { +class TranslatorLauncher extends Component { static propTypes = { translate: PropTypes.func, }; @@ -56,7 +56,7 @@ class TranslatorLauncher extends React.Component { scrollTop: 0, }; - highlightRef = React.createRef(); + highlightRef = createRef(); componentDidMount() { i18n.on( 'change', this.onI18nChange ); diff --git a/client/layout/error.jsx b/client/layout/error.jsx index 97157d8404d70c..dc0451f7a72793 100644 --- a/client/layout/error.jsx +++ b/client/layout/error.jsx @@ -1,6 +1,5 @@ import debug from 'debug'; import { localize } from 'i18n-calypso'; -import React from 'react'; import EmptyContent from 'calypso/components/empty-content'; import { makeLayout, render as clientRender } from 'calypso/controller'; import { bumpStat } from 'calypso/lib/analytics/mc'; diff --git a/client/layout/guided-tours/button-labels.jsx b/client/layout/guided-tours/button-labels.jsx index 685ff975327b01..d28b993bd30038 100644 --- a/client/layout/guided-tours/button-labels.jsx +++ b/client/layout/guided-tours/button-labels.jsx @@ -1,6 +1,5 @@ import { Gridicon } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; // Returns React component with a localized label and optional icon function button( label, icon ) { diff --git a/client/layout/guided-tours/component.jsx b/client/layout/guided-tours/component.jsx index 12d3fbb912562d..8454a37fa2ef9e 100644 --- a/client/layout/guided-tours/component.jsx +++ b/client/layout/guided-tours/component.jsx @@ -1,6 +1,6 @@ import { RootChild } from '@automattic/components'; import { defer } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryPreferences from 'calypso/components/data/query-preferences'; import { recordTracksEvent } from 'calypso/lib/analytics/tracks'; diff --git a/client/layout/guided-tours/config-elements/button-row.js b/client/layout/guided-tours/config-elements/button-row.js index dde5e76b7393ce..6596d1e5bf641f 100644 --- a/client/layout/guided-tours/config-elements/button-row.js +++ b/client/layout/guided-tours/config-elements/button-row.js @@ -1,8 +1,8 @@ -import React from 'react'; +import { Children } from 'react'; const ButtonRow = ( { children } ) => { const className = - React.Children.count( children ) === 1 + Children.count( children ) === 1 ? 'guided-tours__single-button-row' : 'guided-tours__choice-button-row'; diff --git a/client/layout/guided-tours/config-elements/combine-tours.js b/client/layout/guided-tours/config-elements/combine-tours.js index a9fe7c15249aa8..a7a9581dac01c5 100644 --- a/client/layout/guided-tours/config-elements/combine-tours.js +++ b/client/layout/guided-tours/config-elements/combine-tours.js @@ -1,5 +1,3 @@ -import React from 'react'; - export default function combineTours( tours ) { return function AllTours( { tourName, ...props } ) { const MyTour = tours[ tourName ]; diff --git a/client/layout/guided-tours/config-elements/conditional-block.js b/client/layout/guided-tours/config-elements/conditional-block.js index 0ebfa91cf33fd9..5c5a707e3d5ce0 100644 --- a/client/layout/guided-tours/config-elements/conditional-block.js +++ b/client/layout/guided-tours/config-elements/conditional-block.js @@ -1,8 +1,8 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { contextTypes } from '../context-types'; -export default class ConditionalBlock extends React.PureComponent { +export default class ConditionalBlock extends PureComponent { static propTypes = { when: PropTypes.func.isRequired, }; diff --git a/client/layout/guided-tours/config-elements/continue.js b/client/layout/guided-tours/config-elements/continue.js index 2d4bf821340614..1e8be42573e278 100644 --- a/client/layout/guided-tours/config-elements/continue.js +++ b/client/layout/guided-tours/config-elements/continue.js @@ -1,7 +1,7 @@ import { Gridicon } from '@automattic/components'; import { translate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { contextTypes } from '../context-types'; import { targetForSlug } from '../positioning'; diff --git a/client/layout/guided-tours/config-elements/link-quit.js b/client/layout/guided-tours/config-elements/link-quit.js index fb98b0aadfcd7d..4d73f1d5764423 100644 --- a/client/layout/guided-tours/config-elements/link-quit.js +++ b/client/layout/guided-tours/config-elements/link-quit.js @@ -2,7 +2,7 @@ import { Button } from '@automattic/components'; import classNames from 'classnames'; import { translate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { contextTypes } from '../context-types'; export default class LinkQuit extends Component { diff --git a/client/layout/guided-tours/config-elements/link.js b/client/layout/guided-tours/config-elements/link.js index f5659c41920dca..b4d4088345048b 100644 --- a/client/layout/guided-tours/config-elements/link.js +++ b/client/layout/guided-tours/config-elements/link.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import ExternalLink from 'calypso/components/external-link'; import InlineSupportLink from 'calypso/components/inline-support-link'; diff --git a/client/layout/guided-tours/config-elements/next.js b/client/layout/guided-tours/config-elements/next.js index 6079e3c1b50519..d91e1fda23e37d 100644 --- a/client/layout/guided-tours/config-elements/next.js +++ b/client/layout/guided-tours/config-elements/next.js @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { translate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { contextTypes } from '../context-types'; export default class Next extends Component { diff --git a/client/layout/guided-tours/config-elements/quit.js b/client/layout/guided-tours/config-elements/quit.js index d57faf7db87587..6cf688b692aa6e 100644 --- a/client/layout/guided-tours/config-elements/quit.js +++ b/client/layout/guided-tours/config-elements/quit.js @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { translate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { contextTypes } from '../context-types'; import { targetForSlug } from '../positioning'; diff --git a/client/layout/guided-tours/config-elements/site-link.js b/client/layout/guided-tours/config-elements/site-link.js index 8c963ab7ff4b6d..547140196a9aee 100644 --- a/client/layout/guided-tours/config-elements/site-link.js +++ b/client/layout/guided-tours/config-elements/site-link.js @@ -1,6 +1,6 @@ import { Button } from '@automattic/components'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { getSiteSlug } from 'calypso/state/sites/selectors'; import { getSelectedSiteId } from 'calypso/state/ui/selectors'; diff --git a/client/layout/guided-tours/docs/examples/tours/simple-payments-end-of-year-guide.js b/client/layout/guided-tours/docs/examples/tours/simple-payments-end-of-year-guide.js index bd85acf740a0bc..39f6e6573999f0 100644 --- a/client/layout/guided-tours/docs/examples/tours/simple-payments-end-of-year-guide.js +++ b/client/layout/guided-tours/docs/examples/tours/simple-payments-end-of-year-guide.js @@ -1,6 +1,6 @@ import { Gridicon } from '@automattic/components'; import { isDesktop } from '@automattic/viewport'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { makeTour, Continue, diff --git a/client/layout/guided-tours/index.js b/client/layout/guided-tours/index.js index da3da62bc0744f..1ef37811562e61 100644 --- a/client/layout/guided-tours/index.js +++ b/client/layout/guided-tours/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import { connect } from 'react-redux'; import AsyncLoad from 'calypso/components/async-load'; import { getGuidedTourState } from 'calypso/state/guided-tours/selectors'; diff --git a/client/layout/guided-tours/test/tour-branching.js b/client/layout/guided-tours/test/tour-branching.js index 0cc3dda27fc90e..f7a4762b583f35 100644 --- a/client/layout/guided-tours/test/tour-branching.js +++ b/client/layout/guided-tours/test/tour-branching.js @@ -1,4 +1,3 @@ -import React from 'react'; import { tourBranching } from '../tour-branching'; describe( 'Guided Tours Branching', () => { diff --git a/client/layout/guided-tours/tours/checklist-site-title-tour/index.js b/client/layout/guided-tours/tours/checklist-site-title-tour/index.js index 77eac6c0886a9a..3f42f5aead9597 100644 --- a/client/layout/guided-tours/tours/checklist-site-title-tour/index.js +++ b/client/layout/guided-tours/tours/checklist-site-title-tour/index.js @@ -1,5 +1,5 @@ import { Gridicon } from '@automattic/components'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { SiteTitleButton } from 'calypso/layout/guided-tours/button-labels'; import { ButtonRow, diff --git a/client/layout/guided-tours/tours/jetpack-checklist-tour/index.js b/client/layout/guided-tours/tours/jetpack-checklist-tour/index.js index 60dc6d9579ccbd..4204c789743bc2 100644 --- a/client/layout/guided-tours/tours/jetpack-checklist-tour/index.js +++ b/client/layout/guided-tours/tours/jetpack-checklist-tour/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import { ButtonRow, makeTour, diff --git a/client/layout/guided-tours/tours/jetpack-lazy-images-tour/index.js b/client/layout/guided-tours/tours/jetpack-lazy-images-tour/index.js index 5dc6755b82182a..ce552628b7f256 100644 --- a/client/layout/guided-tours/tours/jetpack-lazy-images-tour/index.js +++ b/client/layout/guided-tours/tours/jetpack-lazy-images-tour/index.js @@ -1,5 +1,5 @@ import { Gridicon } from '@automattic/components'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { ButtonRow, Continue, diff --git a/client/layout/guided-tours/tours/jetpack-monitoring-tour/index.js b/client/layout/guided-tours/tours/jetpack-monitoring-tour/index.js index 02eed266ae67da..efecbe82e6b4e7 100644 --- a/client/layout/guided-tours/tours/jetpack-monitoring-tour/index.js +++ b/client/layout/guided-tours/tours/jetpack-monitoring-tour/index.js @@ -1,5 +1,5 @@ import { Gridicon } from '@automattic/components'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { ButtonRow, Continue, diff --git a/client/layout/guided-tours/tours/jetpack-search-tour/index.js b/client/layout/guided-tours/tours/jetpack-search-tour/index.js index 74a11bf68ce0de..4d08a9ae2d9363 100644 --- a/client/layout/guided-tours/tours/jetpack-search-tour/index.js +++ b/client/layout/guided-tours/tours/jetpack-search-tour/index.js @@ -1,5 +1,5 @@ import { Gridicon } from '@automattic/components'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { ButtonRow, Continue, diff --git a/client/layout/guided-tours/tours/jetpack-sign-in-tour/index.js b/client/layout/guided-tours/tours/jetpack-sign-in-tour/index.js index 7ae72a6129baa2..b15b8517fb734f 100644 --- a/client/layout/guided-tours/tours/jetpack-sign-in-tour/index.js +++ b/client/layout/guided-tours/tours/jetpack-sign-in-tour/index.js @@ -1,5 +1,5 @@ import { Gridicon } from '@automattic/components'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { ButtonRow, Continue, diff --git a/client/layout/guided-tours/tours/jetpack-site-accelerator-tour/index.js b/client/layout/guided-tours/tours/jetpack-site-accelerator-tour/index.js index 318b2ef5e256c2..76c18417591e51 100644 --- a/client/layout/guided-tours/tours/jetpack-site-accelerator-tour/index.js +++ b/client/layout/guided-tours/tours/jetpack-site-accelerator-tour/index.js @@ -1,5 +1,5 @@ import { Gridicon } from '@automattic/components'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { ButtonRow, Continue, diff --git a/client/layout/guided-tours/tours/jetpack-video-hosting-tour/index.js b/client/layout/guided-tours/tours/jetpack-video-hosting-tour/index.js index 193046160ae7dd..a395b5a52d97f8 100644 --- a/client/layout/guided-tours/tours/jetpack-video-hosting-tour/index.js +++ b/client/layout/guided-tours/tours/jetpack-video-hosting-tour/index.js @@ -1,5 +1,5 @@ import { Gridicon } from '@automattic/components'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { ButtonRow, Continue, diff --git a/client/layout/guided-tours/tours/marketing-connections-tour/index.js b/client/layout/guided-tours/tours/marketing-connections-tour/index.js index 2433e22b56f9a1..f5042e7780c5ee 100644 --- a/client/layout/guided-tours/tours/marketing-connections-tour/index.js +++ b/client/layout/guided-tours/tours/marketing-connections-tour/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import { ButtonRow, makeTour, diff --git a/client/layout/guided-tours/tours/media-basics-tour/index.js b/client/layout/guided-tours/tours/media-basics-tour/index.js index 53970c783f081a..3384434c7f0aa4 100644 --- a/client/layout/guided-tours/tours/media-basics-tour/index.js +++ b/client/layout/guided-tours/tours/media-basics-tour/index.js @@ -1,4 +1,4 @@ -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { AddNewButton, EditButton, diff --git a/client/layout/index.jsx b/client/layout/index.jsx index 72100ca9da7825..9dce1ecabe0ea7 100644 --- a/client/layout/index.jsx +++ b/client/layout/index.jsx @@ -3,7 +3,7 @@ import { isWithinBreakpoint } from '@automattic/viewport'; import { useBreakpoint } from '@automattic/viewport-react'; import classnames from 'classnames'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { useEffect, Component } from 'react'; import { connect } from 'react-redux'; import AsyncLoad from 'calypso/components/async-load'; import DocumentHead from 'calypso/components/data/document-head'; @@ -54,7 +54,7 @@ function SidebarScrollSynchronizer( { enabled } ) { const isNarrow = useBreakpoint( '<660px' ); const active = enabled && ! isNarrow && ! config.isEnabled( 'jetpack-cloud' ); // Jetpack cloud hasn't yet aligned with WPCOM. - React.useEffect( () => { + useEffect( () => { if ( active ) { window.addEventListener( 'scroll', handleScroll ); window.addEventListener( 'resize', handleScroll ); @@ -85,7 +85,7 @@ function SidebarOverflowDelay( { layoutFocus } ) { } }; - React.useEffect( () => { + useEffect( () => { if ( layoutFocus !== 'sites' ) { // The sidebar menu uses a flyout design that requires the overflowing content // to be visible. However, `overflow` isn't an animatable CSS property, so we diff --git a/client/layout/loader.jsx b/client/layout/loader.jsx index a4b15d9471a486..ca41d6a8baeb40 100644 --- a/client/layout/loader.jsx +++ b/client/layout/loader.jsx @@ -1,5 +1,4 @@ import classnames from 'classnames'; -import React from 'react'; import { useSelector } from 'react-redux'; import PulsingDot from 'calypso/components/pulsing-dot'; import { isSectionLoading } from 'calypso/state/ui/selectors'; diff --git a/client/layout/logged-out.jsx b/client/layout/logged-out.jsx index 2e24c34eec68da..aa9f31fad7db8c 100644 --- a/client/layout/logged-out.jsx +++ b/client/layout/logged-out.jsx @@ -1,7 +1,6 @@ import config from '@automattic/calypso-config'; import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import GdprBanner from 'calypso/blocks/gdpr-banner'; import AsyncLoad from 'calypso/components/async-load'; diff --git a/client/layout/masterbar/crowdsignal.jsx b/client/layout/masterbar/crowdsignal.jsx index 8f798de81c8915..0cd2e548099f48 100644 --- a/client/layout/masterbar/crowdsignal.jsx +++ b/client/layout/masterbar/crowdsignal.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import WordPressLogo from 'calypso/components/wordpress-logo'; import './crowdsignal.scss'; diff --git a/client/layout/masterbar/drafts-popover.jsx b/client/layout/masterbar/drafts-popover.jsx index d9ad09ddc5631c..be601f92d701a1 100644 --- a/client/layout/masterbar/drafts-popover.jsx +++ b/client/layout/masterbar/drafts-popover.jsx @@ -1,7 +1,7 @@ import { Button, Popover } from '@automattic/components'; import { createSelector } from '@automattic/state-utils'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Count from 'calypso/components/count'; import QueryPosts from 'calypso/components/data/query-posts'; diff --git a/client/layout/masterbar/drafts.jsx b/client/layout/masterbar/drafts.jsx index 35971a9c161d29..90866cfc5143b8 100644 --- a/client/layout/masterbar/drafts.jsx +++ b/client/layout/masterbar/drafts.jsx @@ -1,7 +1,7 @@ import { Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import AsyncLoad from 'calypso/components/async-load'; import QueryPostCounts from 'calypso/components/data/query-post-counts'; diff --git a/client/layout/masterbar/empty.jsx b/client/layout/masterbar/empty.jsx index fc4f89a9142e05..ee6de5bcb1652e 100644 --- a/client/layout/masterbar/empty.jsx +++ b/client/layout/masterbar/empty.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - const EmptyMasterbar = () =>
); } - }; + }); diff --git a/client/login/controller.js b/client/login/controller.js index 6f4024bd84c09a..9027441b85b3b2 100644 --- a/client/login/controller.js +++ b/client/login/controller.js @@ -2,7 +2,6 @@ import config from '@automattic/calypso-config'; import { getUrlParts } from '@automattic/calypso-url'; import { includes } from 'lodash'; import page from 'page'; -import React from 'react'; import { isUserLoggedIn, getCurrentUserLocale } from 'calypso/state/current-user/selectors'; import { fetchOAuth2ClientData } from 'calypso/state/oauth2-clients/actions'; import MagicLogin from './magic-login'; diff --git a/client/login/index.web.js b/client/login/index.web.js index c7179fddb72029..8e974415030402 100644 --- a/client/login/index.web.js +++ b/client/login/index.web.js @@ -1,5 +1,4 @@ import config from '@automattic/calypso-config'; -import React from 'react'; import { Provider as ReduxProvider } from 'react-redux'; import { RouteProvider } from 'calypso/components/route'; import { diff --git a/client/login/magic-login/emailed-login-link-expired.jsx b/client/login/magic-login/emailed-login-link-expired.jsx index 01d0ddf8dd9aad..34f13a090d5c6c 100644 --- a/client/login/magic-login/emailed-login-link-expired.jsx +++ b/client/login/magic-login/emailed-login-link-expired.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import EmptyContent from 'calypso/components/empty-content'; import RedirectWhenLoggedIn from 'calypso/components/redirect-when-logged-in'; @@ -12,7 +12,7 @@ import { import { hideMagicLoginRequestForm } from 'calypso/state/login/magic-login/actions'; import { withEnhancers } from 'calypso/state/utils'; -class EmailedLoginLinkExpired extends React.Component { +class EmailedLoginLinkExpired extends Component { static propTypes = { hideMagicLoginRequestForm: PropTypes.func.isRequired, recordPageView: PropTypes.func.isRequired, diff --git a/client/login/magic-login/emailed-login-link-successfully.jsx b/client/login/magic-login/emailed-login-link-successfully.jsx index 8ccb83bb8c8b18..5af8225e97874b 100644 --- a/client/login/magic-login/emailed-login-link-successfully.jsx +++ b/client/login/magic-login/emailed-login-link-successfully.jsx @@ -2,7 +2,7 @@ import { Card, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import checkEmailImage from 'calypso/assets/images/illustrations/check-email.svg'; import RedirectWhenLoggedIn from 'calypso/components/redirect-when-logged-in'; @@ -16,7 +16,7 @@ import getCurrentLocaleSlug from 'calypso/state/selectors/get-current-locale-slu import { getCurrentRoute } from 'calypso/state/selectors/get-current-route'; import { withEnhancers } from 'calypso/state/utils'; -class EmailedLoginLinkSuccessfully extends React.Component { +class EmailedLoginLinkSuccessfully extends Component { static propTypes = { hideMagicLoginRequestForm: PropTypes.func.isRequired, locale: PropTypes.string.isRequired, diff --git a/client/login/magic-login/handle-emailed-link-form.jsx b/client/login/magic-login/handle-emailed-link-form.jsx index 7cd54d2a71ba25..5e1390703d2cde 100644 --- a/client/login/magic-login/handle-emailed-link-form.jsx +++ b/client/login/magic-login/handle-emailed-link-form.jsx @@ -5,7 +5,7 @@ import { localize } from 'i18n-calypso'; import { isEmpty } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import EmptyContent from 'calypso/components/empty-content'; import wooDnaConfig from 'calypso/jetpack-connect/woo-dna-config'; @@ -35,7 +35,7 @@ import getMagicLoginRequestedAuthSuccessfully from 'calypso/state/selectors/get- import isFetchingMagicLoginAuth from 'calypso/state/selectors/is-fetching-magic-login-auth'; import EmailedLoginLinkExpired from './emailed-login-link-expired'; -class HandleEmailedLinkForm extends React.Component { +class HandleEmailedLinkForm extends Component { static propTypes = { // Passed props clientId: PropTypes.string, diff --git a/client/login/magic-login/index.jsx b/client/login/magic-login/index.jsx index 0bce1f6b0ce0e8..b6fe9ad36dff8e 100644 --- a/client/login/magic-login/index.jsx +++ b/client/login/magic-login/index.jsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import GlobalNotices from 'calypso/components/global-notices'; import JetpackHeader from 'calypso/components/jetpack-header'; @@ -27,7 +27,7 @@ import RequestLoginEmailForm from './request-login-email-form'; import './style.scss'; -class MagicLogin extends React.Component { +class MagicLogin extends Component { static propTypes = { path: PropTypes.string.isRequired, diff --git a/client/login/magic-login/request-login-email-form.jsx b/client/login/magic-login/request-login-email-form.jsx index aa9b4a716e3648..5a712fe0984d11 100644 --- a/client/login/magic-login/request-login-email-form.jsx +++ b/client/login/magic-login/request-login-email-form.jsx @@ -1,7 +1,7 @@ import { localize } from 'i18n-calypso'; import { defer, get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import FormFieldset from 'calypso/components/forms/form-fieldset'; @@ -27,7 +27,7 @@ import isFetchingMagicLoginEmail from 'calypso/state/selectors/is-fetching-magic import EmailedLoginLinkSuccessfully from './emailed-login-link-successfully'; import EmailedLoginLinkSuccessfullyJetpackConnect from './emailed-login-link-successfully-jetpack-connect'; -class RequestLoginEmailForm extends React.Component { +class RequestLoginEmailForm extends Component { static propTypes = { // mapped to state currentUser: PropTypes.object, diff --git a/client/login/wp-login/index.jsx b/client/login/wp-login/index.jsx index e589197c1754d9..77b6219945d223 100644 --- a/client/login/wp-login/index.jsx +++ b/client/login/wp-login/index.jsx @@ -3,7 +3,7 @@ import { Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import LoginBlock from 'calypso/blocks/login'; import AutomatticLogo from 'calypso/components/automattic-logo'; @@ -30,7 +30,7 @@ import PrivateSite from './private-site'; import './style.scss'; -export class Login extends React.Component { +export class Login extends Component { static propTypes = { clientId: PropTypes.string, isLoggedIn: PropTypes.bool.isRequired, diff --git a/client/login/wp-login/login-links.jsx b/client/login/wp-login/login-links.jsx index 181d8f13aec6f3..6be64985993d7f 100644 --- a/client/login/wp-login/login-links.jsx +++ b/client/login/wp-login/login-links.jsx @@ -5,7 +5,7 @@ import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createRef, Component } from 'react'; import { connect } from 'react-redux'; import ExternalLink from 'calypso/components/external-link'; import LoggedOutFormBackLink from 'calypso/components/logged-out-form/back-link'; @@ -25,7 +25,7 @@ import { getCurrentOAuth2Client } from 'calypso/state/oauth2-clients/ui/selector import getCurrentQueryArguments from 'calypso/state/selectors/get-current-query-arguments'; import getCurrentRoute from 'calypso/state/selectors/get-current-route'; -export class LoginLinks extends React.Component { +export class LoginLinks extends Component { static propTypes = { isLoggedIn: PropTypes.bool.isRequired, locale: PropTypes.string.isRequired, @@ -43,7 +43,7 @@ export class LoginLinks extends React.Component { constructor( props ) { super( props ); - this.loginLinkRef = React.createRef(); + this.loginLinkRef = createRef(); } componentDidMount() { diff --git a/client/login/wp-login/private-site.jsx b/client/login/wp-login/private-site.jsx index 1050f4bca09aed..401cc3cef7ecf9 100644 --- a/client/login/wp-login/private-site.jsx +++ b/client/login/wp-login/private-site.jsx @@ -1,6 +1,5 @@ import { Button, Card } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import privateImage from 'calypso/assets/images/illustrations/private.svg'; export default function PrivateSite() { diff --git a/client/mailing-lists/controller.js b/client/mailing-lists/controller.js index 88756c1688b5bf..c784a3f4b8ac3f 100644 --- a/client/mailing-lists/controller.js +++ b/client/mailing-lists/controller.js @@ -1,10 +1,10 @@ -import React from 'react'; +import { createElement } from 'react'; import MainComponent from './main'; export default { unsubscribe( context, next ) { const { email, category, hmac, ...rest } = context.query; - context.primary = React.createElement( MainComponent, { + context.primary = createElement( MainComponent, { email, category, hmac, diff --git a/client/mailing-lists/main.jsx b/client/mailing-lists/main.jsx index 8a56b9876a2481..0aa13cf2aa83a4 100644 --- a/client/mailing-lists/main.jsx +++ b/client/mailing-lists/main.jsx @@ -1,13 +1,13 @@ import { Card, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import page from 'page'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { preventWidows } from 'calypso/lib/formatting'; import { errorNotice, successNotice } from 'calypso/state/notices/actions'; import { addSubscriber, deleteSubscriber } from './utils'; -class MainComponent extends React.Component { +class MainComponent extends Component { static displayName = 'MainComponent'; state = { diff --git a/client/me/account-close/closed.jsx b/client/me/account-close/closed.jsx index 32367ce0c78286..2129a9aa94adec 100644 --- a/client/me/account-close/closed.jsx +++ b/client/me/account-close/closed.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import page from 'page'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import EmptyContent from 'calypso/components/empty-content'; import Spinner from 'calypso/components/spinner'; diff --git a/client/me/account-close/confirm-dialog.jsx b/client/me/account-close/confirm-dialog.jsx index 75223d96dc8970..e9647419c1a850 100644 --- a/client/me/account-close/confirm-dialog.jsx +++ b/client/me/account-close/confirm-dialog.jsx @@ -2,7 +2,7 @@ import { recordTracksEvent } from '@automattic/calypso-analytics'; import { Dialog, Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import page from 'page'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormLabel from 'calypso/components/forms/form-label'; import FormTextInput from 'calypso/components/forms/form-text-input'; @@ -15,7 +15,7 @@ import './confirm-dialog.scss'; const noop = () => {}; -class AccountCloseConfirmDialog extends React.Component { +class AccountCloseConfirmDialog extends Component { state = { displayAlternativeOptions: true, inputValue: '', diff --git a/client/me/account-close/controller.js b/client/me/account-close/controller.js index 90a99bf1129a38..30443844ea9e9b 100644 --- a/client/me/account-close/controller.js +++ b/client/me/account-close/controller.js @@ -1,13 +1,13 @@ -import React from 'react'; +import { createElement } from 'react'; import AccountSettingsClosedComponent from 'calypso/me/account-close/closed'; import AccountSettingsCloseComponent from 'calypso/me/account-close/main'; export function accountClose( context, next ) { - context.primary = React.createElement( AccountSettingsCloseComponent ); + context.primary = createElement( AccountSettingsCloseComponent ); next(); } export function accountClosed( context, next ) { - context.primary = React.createElement( AccountSettingsClosedComponent ); + context.primary = createElement( AccountSettingsClosedComponent ); next(); } diff --git a/client/me/account-close/main.jsx b/client/me/account-close/main.jsx index 775c2feadea0c4..1d7716d7343c4e 100644 --- a/client/me/account-close/main.jsx +++ b/client/me/account-close/main.jsx @@ -3,7 +3,7 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import { map } from 'lodash'; import page from 'page'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import ActionPanel from 'calypso/components/action-panel'; import ActionPanelBody from 'calypso/components/action-panel/body'; diff --git a/client/me/account-password/index.jsx b/client/me/account-password/index.jsx index 98fa32bca78a15..1cb07d24c40b33 100644 --- a/client/me/account-password/index.jsx +++ b/client/me/account-password/index.jsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { debounce, flowRight as compose, isEmpty } from 'lodash'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import FormButtonsBar from 'calypso/components/forms/form-buttons-bar'; @@ -23,7 +23,7 @@ import { import './style.scss'; -class AccountPassword extends React.Component { +class AccountPassword extends Component { state = { password: '', validation: null, diff --git a/client/me/account/close-link.jsx b/client/me/account/close-link.jsx index 6c33b2765bdade..cddb21aec75bd1 100644 --- a/client/me/account/close-link.jsx +++ b/client/me/account/close-link.jsx @@ -1,12 +1,12 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import './close-link.scss'; const noop = () => {}; -class AccountSettingsCloseLink extends React.Component { +class AccountSettingsCloseLink extends Component { render() { const { translate } = this.props; const href = '/me/account/close'; diff --git a/client/me/account/controller.js b/client/me/account/controller.js index 8c1caeff078cb7..99f20be943cc42 100644 --- a/client/me/account/controller.js +++ b/client/me/account/controller.js @@ -1,6 +1,6 @@ import { translate } from 'i18n-calypso'; import page from 'page'; -import React from 'react'; +import { createElement } from 'react'; import AccountComponent, { noticeId as meSettingsNoticeId } from 'calypso/me/account/main'; import { setDocumentHeadTitle as setTitle } from 'calypso/state/document-head/actions'; import { successNotice } from 'calypso/state/notices/actions'; @@ -20,7 +20,7 @@ export function account( context, next ) { page.replace( context.pathname ); } - context.primary = React.createElement( AccountComponent, { + context.primary = createElement( AccountComponent, { path: context.path, } ); next(); diff --git a/client/me/account/main.jsx b/client/me/account/main.jsx index 90e69608e3dedf..de61b001ef3673 100644 --- a/client/me/account/main.jsx +++ b/client/me/account/main.jsx @@ -5,7 +5,7 @@ import debugFactory from 'debug'; import emailValidator from 'email-validator'; import { localize } from 'i18n-calypso'; import { debounce, flowRight as compose, get, has, map, size } from 'lodash'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import CSSTransition from 'react-transition-group/CSSTransition'; import TransitionGroup from 'react-transition-group/TransitionGroup'; @@ -98,7 +98,7 @@ const INTERFACE_FIELDS = [ 'calypso_preferences', ]; -class Account extends React.Component { +class Account extends Component { constructor( props ) { super( props ); diff --git a/client/me/application-password-item/index.jsx b/client/me/application-password-item/index.jsx index 6d3a5ead6180ef..b3b5be644127d0 100644 --- a/client/me/application-password-item/index.jsx +++ b/client/me/application-password-item/index.jsx @@ -1,6 +1,6 @@ import { Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; import { recordGoogleEvent } from 'calypso/state/analytics/actions'; @@ -9,7 +9,7 @@ import { errorNotice } from 'calypso/state/notices/actions'; import './style.scss'; -class ApplicationPasswordsItem extends React.Component { +class ApplicationPasswordsItem extends Component { handleRemovePasswordButtonClick = () => { const { password } = this.props; diff --git a/client/me/application-passwords/index.jsx b/client/me/application-passwords/index.jsx index f9483b81b7ba2c..39531bc552dee5 100644 --- a/client/me/application-passwords/index.jsx +++ b/client/me/application-passwords/index.jsx @@ -1,7 +1,7 @@ import { Button, Card, Gridicon } from '@automattic/components'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryApplicationPasswords from 'calypso/components/data/query-application-passwords'; import FormButton from 'calypso/components/forms/form-button'; diff --git a/client/me/concierge/book/calendar-step.js b/client/me/concierge/book/calendar-step.js index 5047674d5b0bf0..9c537d01bddeb6 100644 --- a/client/me/concierge/book/calendar-step.js +++ b/client/me/concierge/book/calendar-step.js @@ -1,7 +1,7 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ExternalLinkWithTracking from 'calypso/components/external-link/with-tracking'; import FormattedHeader from 'calypso/components/formatted-header'; diff --git a/client/me/concierge/book/confirmation-step.js b/client/me/concierge/book/confirmation-step.js index 80291eb9e794f6..d809f0ea1ed524 100644 --- a/client/me/concierge/book/confirmation-step.js +++ b/client/me/concierge/book/confirmation-step.js @@ -1,6 +1,6 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; import Confirmation from '../shared/confirmation'; diff --git a/client/me/concierge/book/info-step.js b/client/me/concierge/book/info-step.js index 92ec9e924b3c01..a908eedc542849 100644 --- a/client/me/concierge/book/info-step.js +++ b/client/me/concierge/book/info-step.js @@ -3,7 +3,7 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { includes } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Site from 'calypso/blocks/site'; import QuerySmsCountries from 'calypso/components/data/query-countries/sms'; diff --git a/client/me/concierge/book/is-rebrand-cities-site.js b/client/me/concierge/book/is-rebrand-cities-site.js index 38e5fa8f8cd98c..28cc1b39221945 100644 --- a/client/me/concierge/book/is-rebrand-cities-site.js +++ b/client/me/concierge/book/is-rebrand-cities-site.js @@ -15,7 +15,7 @@ */ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import useUsersQuery from 'calypso/data/users/use-users-query'; const REBRAND_CITIES_ACCOUNT_USERNAME = 'rebrandcities'; diff --git a/client/me/concierge/book/skeleton.js b/client/me/concierge/book/skeleton.js index aaad993325ef56..813254b0a36863 100644 --- a/client/me/concierge/book/skeleton.js +++ b/client/me/concierge/book/skeleton.js @@ -1,5 +1,5 @@ import { CompactCard } from '@automattic/components'; -import React, { Component } from 'react'; +import { Component } from 'react'; import SitePlaceholder from 'calypso/blocks/site/placeholder'; import PrimaryHeader from '../shared/primary-header'; diff --git a/client/me/concierge/cancel/index.js b/client/me/concierge/cancel/index.js index eadacabe65afa7..af3cbbc4408bb4 100644 --- a/client/me/concierge/cancel/index.js +++ b/client/me/concierge/cancel/index.js @@ -2,7 +2,7 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { includes } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryConciergeAppointmentDetails from 'calypso/components/data/query-concierge-appointment-details'; import QueryConciergeInitial from 'calypso/components/data/query-concierge-initial'; diff --git a/client/me/concierge/cancel/skeleton.js b/client/me/concierge/cancel/skeleton.js index eb9f8c4060bb18..0445210dc4efae 100644 --- a/client/me/concierge/cancel/skeleton.js +++ b/client/me/concierge/cancel/skeleton.js @@ -1,6 +1,6 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; class Skeleton extends Component { render() { diff --git a/client/me/concierge/controller.js b/client/me/concierge/controller.js index e7d92b283e449e..e6207d633a68b0 100644 --- a/client/me/concierge/controller.js +++ b/client/me/concierge/controller.js @@ -1,6 +1,5 @@ import i18n from 'i18n-calypso'; import page from 'page'; -import React from 'react'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; import BookCalendarStep from './book/calendar-step'; import BookConfirmationStep from './book/confirmation-step'; diff --git a/client/me/concierge/main.js b/client/me/concierge/main.js index 93c5edb612c6e9..9a23f639a8631d 100644 --- a/client/me/concierge/main.js +++ b/client/me/concierge/main.js @@ -10,7 +10,7 @@ */ import { isEmpty } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryConciergeInitial from 'calypso/components/data/query-concierge-initial'; import QuerySitePlans from 'calypso/components/data/query-site-plans'; diff --git a/client/me/concierge/reschedule/calendar-step.js b/client/me/concierge/reschedule/calendar-step.js index 8de794401865ba..3d82a5b1dbbdcc 100644 --- a/client/me/concierge/reschedule/calendar-step.js +++ b/client/me/concierge/reschedule/calendar-step.js @@ -2,7 +2,7 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { without } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryConciergeAppointmentDetails from 'calypso/components/data/query-concierge-appointment-details'; import FormFieldset from 'calypso/components/forms/form-fieldset'; diff --git a/client/me/concierge/reschedule/confirmation-step.js b/client/me/concierge/reschedule/confirmation-step.js index 6bc48c7917bde2..f7be5a59c93278 100644 --- a/client/me/concierge/reschedule/confirmation-step.js +++ b/client/me/concierge/reschedule/confirmation-step.js @@ -1,6 +1,6 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; import Confirmation from '../shared/confirmation'; diff --git a/client/me/concierge/reschedule/skeleton.js b/client/me/concierge/reschedule/skeleton.js index 615ce7fd7784f1..4ce66160438a6e 100644 --- a/client/me/concierge/reschedule/skeleton.js +++ b/client/me/concierge/reschedule/skeleton.js @@ -1,6 +1,6 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; class Skeleton extends Component { render() { diff --git a/client/me/concierge/shared/appointment-info.js b/client/me/concierge/shared/appointment-info.js index 43404a5ac3acaa..c32263d3b6b85b 100644 --- a/client/me/concierge/shared/appointment-info.js +++ b/client/me/concierge/shared/appointment-info.js @@ -2,7 +2,7 @@ import 'moment-timezone'; import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import Site from 'calypso/blocks/site'; import FormattedHeader from 'calypso/components/formatted-header'; import FormButton from 'calypso/components/forms/form-button'; diff --git a/client/me/concierge/shared/available-time-card.js b/client/me/concierge/shared/available-time-card.js index 2cb7af23b90d90..d423315e0c95d9 100644 --- a/client/me/concierge/shared/available-time-card.js +++ b/client/me/concierge/shared/available-time-card.js @@ -11,7 +11,7 @@ import { Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { isEmpty } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import day from 'calypso/assets/images/quick-start/day.svg'; import night from 'calypso/assets/images/quick-start/night.svg'; import FoldableCard from 'calypso/components/foldable-card'; diff --git a/client/me/concierge/shared/available-time-picker.js b/client/me/concierge/shared/available-time-picker.js index 383e2b2450b62f..b60c2968c6d60d 100644 --- a/client/me/concierge/shared/available-time-picker.js +++ b/client/me/concierge/shared/available-time-picker.js @@ -1,6 +1,6 @@ import moment from 'moment-timezone'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { isDefaultLocale } from 'calypso/lib/i18n-utils'; import AvailableTimeCard from './available-time-card'; diff --git a/client/me/concierge/shared/closure-notice.js b/client/me/concierge/shared/closure-notice.js index bceb74ee98962e..2f68425e60bb39 100644 --- a/client/me/concierge/shared/closure-notice.js +++ b/client/me/concierge/shared/closure-notice.js @@ -1,7 +1,6 @@ import 'moment-timezone'; // monkey patches the existing moment.js import { CompactCard as Card } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; const DATE_FORMAT = 'LLL'; diff --git a/client/me/concierge/shared/confirmation.js b/client/me/concierge/shared/confirmation.js index 8a0e1af849b6eb..585b324c8b7421 100644 --- a/client/me/concierge/shared/confirmation.js +++ b/client/me/concierge/shared/confirmation.js @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import supportIllustration from 'calypso/assets/images/illustrations/happiness-support.svg'; import FormattedHeader from 'calypso/components/formatted-header'; diff --git a/client/me/concierge/shared/gm-closure-notice.js b/client/me/concierge/shared/gm-closure-notice.js index e63d22c11ce1b4..c901bbaf1ec4f7 100644 --- a/client/me/concierge/shared/gm-closure-notice.js +++ b/client/me/concierge/shared/gm-closure-notice.js @@ -1,7 +1,6 @@ import 'moment-timezone'; // monkey patches the existing moment.js import { CompactCard as Card } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; const DATE_FORMAT = 'dddd, MMMM Do LT'; diff --git a/client/me/concierge/shared/no-available-times.js b/client/me/concierge/shared/no-available-times.js index 4974fcd3ac5d84..fb4e376a095c1e 100644 --- a/client/me/concierge/shared/no-available-times.js +++ b/client/me/concierge/shared/no-available-times.js @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ExternalLinkWithTracking from 'calypso/components/external-link/with-tracking'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; diff --git a/client/me/concierge/shared/primary-header.js b/client/me/concierge/shared/primary-header.js index 5f879a275b873c..d1822b067522cf 100644 --- a/client/me/concierge/shared/primary-header.js +++ b/client/me/concierge/shared/primary-header.js @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import ExternalLink from 'calypso/components/external-link'; import FormattedHeader from 'calypso/components/formatted-header'; import { CONCIERGE_SUPPORT } from 'calypso/lib/url/support'; diff --git a/client/me/concierge/shared/upsell.js b/client/me/concierge/shared/upsell.js index 8ce277a81578c0..9c4b4e14fb5de5 100644 --- a/client/me/concierge/shared/upsell.js +++ b/client/me/concierge/shared/upsell.js @@ -1,7 +1,7 @@ import { Button, CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Site from 'calypso/blocks/site'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; diff --git a/client/me/concierge/shared/utils.js b/client/me/concierge/shared/utils.js index bf8f4b623f99e0..6e43115ff9c17b 100644 --- a/client/me/concierge/shared/utils.js +++ b/client/me/concierge/shared/utils.js @@ -1,5 +1,4 @@ import { CompactCard } from '@automattic/components'; -import React from 'react'; import HeaderCake from 'calypso/components/header-cake'; export const renderDisallowed = ( translate, siteSlug ) => { diff --git a/client/me/concierge/test/main.js b/client/me/concierge/test/main.js index 6a7dcf36d060d1..60ca2ae7822ff8 100644 --- a/client/me/concierge/test/main.js +++ b/client/me/concierge/test/main.js @@ -2,7 +2,6 @@ jest.mock( '../shared/upsell', () => 'Upsell' ); jest.mock( '../shared/no-available-times', () => 'NoAvailableTimes' ); import { shallow } from 'enzyme'; -import React from 'react'; import { ConciergeMain } from '../main'; const props = { diff --git a/client/me/connected-application-icon/index.jsx b/client/me/connected-application-icon/index.jsx index 3acf52f04e27a3..861458c7ce905a 100644 --- a/client/me/connected-application-icon/index.jsx +++ b/client/me/connected-application-icon/index.jsx @@ -1,9 +1,9 @@ -import React from 'react'; +import { Component } from 'react'; import PluginIcon from 'calypso/my-sites/plugins/plugin-icon/plugin-icon'; import './style.scss'; -export default class extends React.Component { +export default class extends Component { static displayName = 'ConnectedApplicationIcon'; static defaultProps = { diff --git a/client/me/connected-application-item/index.jsx b/client/me/connected-application-item/index.jsx index b0308cc5b4b488..55a936b945e086 100644 --- a/client/me/connected-application-item/index.jsx +++ b/client/me/connected-application-item/index.jsx @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FoldableCard from 'calypso/components/foldable-card'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; @@ -12,7 +12,7 @@ import { deleteConnectedApplication } from 'calypso/state/connected-applications import './style.scss'; -class ConnectedApplicationItem extends React.Component { +class ConnectedApplicationItem extends Component { static defaultProps = { isPlaceholder: false, }; diff --git a/client/me/connected-applications/index.jsx b/client/me/connected-applications/index.jsx index 6dc5ba3751688e..ce998e978b36a8 100644 --- a/client/me/connected-applications/index.jsx +++ b/client/me/connected-applications/index.jsx @@ -2,7 +2,7 @@ import config from '@automattic/calypso-config'; import { localize } from 'i18n-calypso'; import { times } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Fragment, PureComponent } from 'react'; +import { Fragment, PureComponent } from 'react'; import { connect } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import QueryConnectedApplications from 'calypso/components/data/query-connected-applications'; diff --git a/client/me/controller.js b/client/me/controller.js index 4ba1c8a75dc822..4753c1e2f62c2c 100644 --- a/client/me/controller.js +++ b/client/me/controller.js @@ -1,12 +1,12 @@ import i18n from 'i18n-calypso'; import page from 'page'; -import React from 'react'; +import { createElement } from 'react'; import AppsComponent from 'calypso/me/get-apps'; import SidebarComponent from 'calypso/me/sidebar'; import { setDocumentHeadTitle as setTitle } from 'calypso/state/document-head/actions'; export function sidebar( context, next ) { - context.secondary = React.createElement( SidebarComponent, { + context.secondary = createElement( SidebarComponent, { context: context, } ); @@ -19,7 +19,7 @@ export function profile( context, next ) { const ProfileComponent = require( 'calypso/me/profile' ).default; - context.primary = React.createElement( ProfileComponent, { + context.primary = createElement( ProfileComponent, { path: context.path, } ); next(); @@ -29,7 +29,7 @@ export function apps( context, next ) { // FIXME: Auto-converted from the setTitle action. Please use instead. context.store.dispatch( setTitle( i18n.translate( 'Get Apps', { textOnly: true } ) ) ); - context.primary = React.createElement( AppsComponent, { + context.primary = createElement( AppsComponent, { path: context.path, } ); next(); diff --git a/client/me/form-base/with-form-base.jsx b/client/me/form-base/with-form-base.jsx index 562ce1f177a0f9..1ac7e84155a05c 100644 --- a/client/me/form-base/with-form-base.jsx +++ b/client/me/form-base/with-form-base.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryUserSettings from 'calypso/components/data/query-user-settings'; import { errorNotice, successNotice } from 'calypso/state/notices/actions'; @@ -14,7 +14,7 @@ import { import { isUpdatingUserSettings } from 'calypso/state/user-settings/selectors'; const withFormBase = ( WrappedComponent ) => { - class EnhancedComponent extends React.Component { + class EnhancedComponent extends Component { static displayName = `withFormBase(${ WrappedComponent.displayName || WrappedComponent.name })`; componentDidUpdate( prevProps ) { diff --git a/client/me/get-apps/index.jsx b/client/me/get-apps/index.jsx index a4917081e86ba4..b0e9e3b9664401 100644 --- a/client/me/get-apps/index.jsx +++ b/client/me/get-apps/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import GetAppsBlock from 'calypso/blocks/get-apps'; import Main from 'calypso/components/main'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; diff --git a/client/me/happychat/index.jsx b/client/me/happychat/index.jsx index 3ca8e67d6bb4e2..e956131b358311 100644 --- a/client/me/happychat/index.jsx +++ b/client/me/happychat/index.jsx @@ -1,7 +1,6 @@ import config from '@automattic/calypso-config'; import { translate } from 'i18n-calypso'; import page from 'page'; -import React from 'react'; import { makeLayout, render as clientRender } from 'calypso/controller'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; import { sidebar } from 'calypso/me/controller'; diff --git a/client/me/happychat/main.jsx b/client/me/happychat/main.jsx index 175e5617f6b11f..0eaebd40dc026a 100644 --- a/client/me/happychat/main.jsx +++ b/client/me/happychat/main.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Composer from 'calypso/components/happychat/composer'; import HappychatConnection from 'calypso/components/happychat/connection-connected'; diff --git a/client/me/help/active-tickets-notice/index.jsx b/client/me/help/active-tickets-notice/index.jsx index 14845e10861f3f..0667239e03d160 100644 --- a/client/me/help/active-tickets-notice/index.jsx +++ b/client/me/help/active-tickets-notice/index.jsx @@ -1,11 +1,11 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import Notice from 'calypso/components/notice'; import { recordTracksEvent } from 'calypso/lib/analytics/tracks'; import './style.scss'; -class ActiveTicketsNotice extends React.Component { +class ActiveTicketsNotice extends Component { componentDidMount() { recordTracksEvent( 'calypso_help_active_requests_notice_shown', { active_ticket_count: this.props.count, diff --git a/client/me/help/contact-form-notice/chat-covid-limited-availability.jsx b/client/me/help/contact-form-notice/chat-covid-limited-availability.jsx index 499b886d69eab8..cc0cd59877af82 100644 --- a/client/me/help/contact-form-notice/chat-covid-limited-availability.jsx +++ b/client/me/help/contact-form-notice/chat-covid-limited-availability.jsx @@ -7,7 +7,6 @@ import 'moment-timezone'; // monkey patches the existing moment.js import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import ContactFormNotice from 'calypso/me/help/contact-form-notice/index'; const ChatCovidLimitedAvailabilityNotice = ( { showAt, hideAt, compact } ) => { diff --git a/client/me/help/contact-form-notice/chat-generic-closure.jsx b/client/me/help/contact-form-notice/chat-generic-closure.jsx index e7479526e1b6de..4347ed822f053c 100644 --- a/client/me/help/contact-form-notice/chat-generic-closure.jsx +++ b/client/me/help/contact-form-notice/chat-generic-closure.jsx @@ -1,6 +1,5 @@ import 'moment-timezone'; // monkey patches the existing moment.js import { translate } from 'i18n-calypso'; -import React from 'react'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; import ContactFormNotice from 'calypso/me/help/contact-form-notice/index'; diff --git a/client/me/help/contact-form-notice/chat-holiday-closure.jsx b/client/me/help/contact-form-notice/chat-holiday-closure.jsx index 1e7419bd32290e..c4850edca9c00f 100644 --- a/client/me/help/contact-form-notice/chat-holiday-closure.jsx +++ b/client/me/help/contact-form-notice/chat-holiday-closure.jsx @@ -1,6 +1,5 @@ import 'moment-timezone'; // monkey patches the existing moment.js import { translate } from 'i18n-calypso'; -import React from 'react'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; import ContactFormNotice from 'calypso/me/help/contact-form-notice/index'; diff --git a/client/me/help/contact-form-notice/chat-reduced-availability.jsx b/client/me/help/contact-form-notice/chat-reduced-availability.jsx index 940bd86672eec9..98465704a028b8 100644 --- a/client/me/help/contact-form-notice/chat-reduced-availability.jsx +++ b/client/me/help/contact-form-notice/chat-reduced-availability.jsx @@ -1,6 +1,5 @@ import 'moment-timezone'; // monkey patches the existing moment.js import { translate } from 'i18n-calypso'; -import React from 'react'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; import ContactFormNotice from 'calypso/me/help/contact-form-notice/index'; diff --git a/client/me/help/contact-form-notice/index.jsx b/client/me/help/contact-form-notice/index.jsx index 686e1ea426a2a1..d4103a47f907e0 100644 --- a/client/me/help/contact-form-notice/index.jsx +++ b/client/me/help/contact-form-notice/index.jsx @@ -1,5 +1,4 @@ import 'moment-timezone'; // monkey patches the existing moment.js -import React from 'react'; import FoldableCard from 'calypso/components/foldable-card'; import FormSectionHeading from 'calypso/components/forms/form-section-heading'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; diff --git a/client/me/help/controller.js b/client/me/help/controller.js index 7900902dcc74a4..78d7d84696fbd6 100644 --- a/client/me/help/controller.js +++ b/client/me/help/controller.js @@ -1,5 +1,4 @@ import i18n from 'i18n-calypso'; -import React from 'react'; import { login } from 'calypso/lib/paths'; import { CONTACT, SUPPORT_ROOT } from 'calypso/lib/url/support'; import { isUserLoggedIn } from 'calypso/state/current-user/selectors'; diff --git a/client/me/help/gm-closure-notice/index.jsx b/client/me/help/gm-closure-notice/index.jsx index a6cc8836018d9d..068c946db82b28 100644 --- a/client/me/help/gm-closure-notice/index.jsx +++ b/client/me/help/gm-closure-notice/index.jsx @@ -7,7 +7,6 @@ import { } from '@automattic/calypso-products'; import { useTranslate } from 'i18n-calypso'; import { some } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import FoldableCard from 'calypso/components/foldable-card'; import FormSectionHeading from 'calypso/components/forms/form-section-heading'; diff --git a/client/me/help/help-contact-confirmation/index.jsx b/client/me/help/help-contact-confirmation/index.jsx index 19362ac46635fb..0a4204e82b6dea 100644 --- a/client/me/help/help-contact-confirmation/index.jsx +++ b/client/me/help/help-contact-confirmation/index.jsx @@ -1,11 +1,11 @@ import { Gridicon } from '@automattic/components'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import FormSectionHeading from 'calypso/components/forms/form-section-heading'; import './style.scss'; -export default class extends React.PureComponent { +export default class extends PureComponent { static displayName = 'HelpContactConfirmation'; static propTypes = { diff --git a/client/me/help/help-contact-form/index.jsx b/client/me/help/help-contact-form/index.jsx index bbab9353a6d2d6..e7a647e46baf84 100644 --- a/client/me/help/help-contact-form/index.jsx +++ b/client/me/help/help-contact-form/index.jsx @@ -3,7 +3,7 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { debounce, isEqual, find } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import InlineHelpCompactResults from 'calypso/blocks/inline-help/inline-help-compact-results'; import FormButton from 'calypso/components/forms/form-button'; @@ -69,7 +69,7 @@ const trackSupportWithoutSibylSuggestions = ( query ) => recordTracksEventAction( 'calypso_sibyl_support_without_suggestions_showing', { query } ) ); -export class HelpContactForm extends React.PureComponent { +export class HelpContactForm extends PureComponent { static propTypes = { additionalSupportOption: PropTypes.object, formDescription: PropTypes.node, diff --git a/client/me/help/help-contact/index.jsx b/client/me/help/help-contact/index.jsx index d91b4c625635b1..80df0ba98d6c4a 100644 --- a/client/me/help/help-contact/index.jsx +++ b/client/me/help/help-contact/index.jsx @@ -5,7 +5,7 @@ import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryLanguageNames from 'calypso/components/data/query-language-names'; import QuerySupportHistory from 'calypso/components/data/query-support-history'; @@ -77,7 +77,7 @@ const debug = debugFactory( 'calypso:help-contact' ); const defaultLanguageSlug = config( 'i18n_default_locale_slug' ); let savedContactForm = null; -class HelpContact extends React.Component { +class HelpContact extends Component { static propTypes = { compact: PropTypes.bool, }; diff --git a/client/me/help/help-courses/course-list.jsx b/client/me/help/help-courses/course-list.jsx index 8487d9ff1583cf..f8a10ac247e308 100644 --- a/client/me/help/help-courses/course-list.jsx +++ b/client/me/help/help-courses/course-list.jsx @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import Course from './course'; class CourseList extends Component { diff --git a/client/me/help/help-courses/course-schedule-item.jsx b/client/me/help/help-courses/course-schedule-item.jsx index f326384f0ddfab..bb302a3b76a733 100644 --- a/client/me/help/help-courses/course-schedule-item.jsx +++ b/client/me/help/help-courses/course-schedule-item.jsx @@ -1,6 +1,5 @@ import { Card, Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; import { recordTracksEvent } from 'calypso/lib/analytics/tracks'; export default localize( ( props ) => { diff --git a/client/me/help/help-courses/course-video.jsx b/client/me/help/help-courses/course-video.jsx index 92ac6ed24d37a6..3d765b53e855ff 100644 --- a/client/me/help/help-courses/course-video.jsx +++ b/client/me/help/help-courses/course-video.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; export default localize( ( props ) => { const { youtubeId } = props; diff --git a/client/me/help/help-courses/course-videos.jsx b/client/me/help/help-courses/course-videos.jsx index 18543d58875135..ae6bfc34ef027a 100644 --- a/client/me/help/help-courses/course-videos.jsx +++ b/client/me/help/help-courses/course-videos.jsx @@ -1,6 +1,5 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; import CourseVideo from './course-video'; export default localize( ( props ) => { diff --git a/client/me/help/help-courses/course.jsx b/client/me/help/help-courses/course.jsx index adea06cfae417f..0655aa4b003b82 100644 --- a/client/me/help/help-courses/course.jsx +++ b/client/me/help/help-courses/course.jsx @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { recordTracksEvent } from 'calypso/lib/analytics/tracks'; import getPrimarySiteId from 'calypso/state/selectors/get-primary-site-id'; diff --git a/client/me/help/help-courses/index.jsx b/client/me/help/help-courses/index.jsx index 2cc058a528dbdf..8cb4315378e3bc 100644 --- a/client/me/help/help-courses/index.jsx +++ b/client/me/help/help-courses/index.jsx @@ -1,7 +1,7 @@ import { planHasFeature, FEATURE_BUSINESS_ONBOARDING } from '@automattic/calypso-products'; import { localize } from 'i18n-calypso'; import { find } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryUserPurchases from 'calypso/components/data/query-user-purchases'; import HeaderCake from 'calypso/components/header-cake'; diff --git a/client/me/help/help-courses/test/index.jsx b/client/me/help/help-courses/test/index.jsx index 12da1527255873..4e1fb37e199041 100644 --- a/client/me/help/help-courses/test/index.jsx +++ b/client/me/help/help-courses/test/index.jsx @@ -19,7 +19,6 @@ import { PLAN_JETPACK_BUSINESS, PLAN_JETPACK_BUSINESS_MONTHLY, } from '@automattic/calypso-products'; -import React from 'react'; import { getUserPurchases } from 'calypso/state/purchases/selectors'; import { mapStateToProps } from '../index'; diff --git a/client/me/help/help-happiness-engineers/index.jsx b/client/me/help/help-happiness-engineers/index.jsx index 69a02a1a218d13..66a4f0a04b477f 100644 --- a/client/me/help/help-happiness-engineers/index.jsx +++ b/client/me/help/help-happiness-engineers/index.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import FormSectionHeading from 'calypso/components/forms/form-section-heading'; import HappinessEngineersTray from 'calypso/components/happiness-engineers-tray'; diff --git a/client/me/help/help-results/index.jsx b/client/me/help/help-results/index.jsx index cd934bec2e2ce3..30e64d2bf0b33a 100644 --- a/client/me/help/help-results/index.jsx +++ b/client/me/help/help-results/index.jsx @@ -1,10 +1,10 @@ import { CompactCard } from '@automattic/components'; -import React from 'react'; +import { PureComponent } from 'react'; import HelpResult from './item'; import './style.scss'; -export default class extends React.PureComponent { +export default class extends PureComponent { static displayName = 'HelpResults'; render() { diff --git a/client/me/help/help-results/item.jsx b/client/me/help/help-results/item.jsx index 4971c696bdea6d..93c9de1c57b3bc 100644 --- a/client/me/help/help-results/item.jsx +++ b/client/me/help/help-results/item.jsx @@ -1,11 +1,11 @@ /* eslint-disable wpcalypso/jsx-classname-namespace */ import { CompactCard, Gridicon } from '@automattic/components'; -import React from 'react'; +import { PureComponent } from 'react'; import { decodeEntities } from 'calypso/lib/formatting'; import { localizeUrl } from 'calypso/lib/i18n-utils'; -export default class extends React.PureComponent { +export default class extends PureComponent { static displayName = 'HelpResult'; onClick = ( event ) => { diff --git a/client/me/help/help-search/index.jsx b/client/me/help/help-search/index.jsx index 07cc80680ecf2d..d37c98e6ed8745 100644 --- a/client/me/help/help-search/index.jsx +++ b/client/me/help/help-search/index.jsx @@ -1,7 +1,7 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { isEmpty } from 'lodash'; -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import QueryHelpLinks from 'calypso/components/data/query-help-links'; import SearchCard from 'calypso/components/search-card'; @@ -13,7 +13,7 @@ import getHelpLinks from 'calypso/state/selectors/get-help-links'; import './style.scss'; -export class HelpSearch extends React.PureComponent { +export class HelpSearch extends PureComponent { state = { searchQuery: '', }; diff --git a/client/me/help/help-search/test/index.js b/client/me/help/help-search/test/index.js index 6d44be03d1320d..9e1dc36519d47a 100644 --- a/client/me/help/help-search/test/index.js +++ b/client/me/help/help-search/test/index.js @@ -3,7 +3,6 @@ */ import { shallow } from 'enzyme'; -import React from 'react'; import { HelpSearch } from '../'; const defaultProps = { diff --git a/client/me/help/help-teaser-button.jsx b/client/me/help/help-teaser-button.jsx index 52d965e38eebfa..0c1cc0f0d3309f 100644 --- a/client/me/help/help-teaser-button.jsx +++ b/client/me/help/help-teaser-button.jsx @@ -1,6 +1,5 @@ import { Card, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; import './help-teaser-button.scss'; diff --git a/client/me/help/help-unverified-warning/index.jsx b/client/me/help/help-unverified-warning/index.jsx index d50ef1cc36b5ed..6dac88899a114c 100644 --- a/client/me/help/help-unverified-warning/index.jsx +++ b/client/me/help/help-unverified-warning/index.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Notice from 'calypso/components/notice'; import NoticeAction from 'calypso/components/notice/notice-action'; diff --git a/client/me/help/main.jsx b/client/me/help/main.jsx index cf49b1f32a4a58..6a36f4408336ce 100644 --- a/client/me/help/main.jsx +++ b/client/me/help/main.jsx @@ -3,7 +3,7 @@ import { Button, CompactCard, Card, Gridicon } from '@automattic/components'; import debugModule from 'debug'; import { localize } from 'i18n-calypso'; import { some } from 'lodash'; -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import helpPurchases from 'calypso/assets/images/customer-home/illustration--secondary-earn.svg'; import helpSupportSession from 'calypso/assets/images/customer-home/illustration-webinars.svg'; @@ -38,7 +38,7 @@ import './style.scss'; */ const debug = debugModule( 'calypso:help-search' ); -class Help extends React.PureComponent { +class Help extends PureComponent { static displayName = 'Help'; state = { diff --git a/client/me/help/test/main.jsx b/client/me/help/test/main.jsx index 3a11138580411e..b32e4ef54dca8b 100644 --- a/client/me/help/test/main.jsx +++ b/client/me/help/test/main.jsx @@ -19,7 +19,6 @@ import { PLAN_JETPACK_BUSINESS, PLAN_JETPACK_BUSINESS_MONTHLY, } from '@automattic/calypso-products'; -import React from 'react'; import { getUserPurchases } from 'calypso/state/purchases/selectors'; import { mapStateToProps } from '../main'; diff --git a/client/me/memberships/controller.js b/client/me/memberships/controller.js index 39969ef610909f..ff64490cccbb45 100644 --- a/client/me/memberships/controller.js +++ b/client/me/memberships/controller.js @@ -1,11 +1,11 @@ -import React from 'react'; +import { createElement } from 'react'; import Subscription from './subscription'; export function subscription( context, next ) { const subscriptionId = context.params.subscriptionId; if ( subscriptionId ) { - context.primary = React.createElement( Subscription, { subscriptionId: subscriptionId } ); + context.primary = createElement( Subscription, { subscriptionId: subscriptionId } ); } next(); } diff --git a/client/me/memberships/main.jsx b/client/me/memberships/main.jsx index 469a8b1bae21b9..e277a8b80559f1 100644 --- a/client/me/memberships/main.jsx +++ b/client/me/memberships/main.jsx @@ -2,7 +2,6 @@ import { CompactCard } from '@automattic/components'; import formatCurrency from '@automattic/format-currency'; import PurchasesNavigation from 'calyspo/me/purchases/purchases-navigation'; import { localize } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import noMembershipsImage from 'calypso/assets/images/illustrations/no-memberships.svg'; import DocumentHead from 'calypso/components/data/document-head'; diff --git a/client/me/memberships/subscription.jsx b/client/me/memberships/subscription.jsx index 8c84c9c9a046bc..cc04931692d077 100644 --- a/client/me/memberships/subscription.jsx +++ b/client/me/memberships/subscription.jsx @@ -2,7 +2,7 @@ import { Card, CompactCard, Gridicon } from '@automattic/components'; import formatCurrency from '@automattic/format-currency'; import { localize } from 'i18n-calypso'; import page from 'page'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { connect, useDispatch } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import QueryMembershipsSubscriptions from 'calypso/components/data/query-memberships-subscriptions'; diff --git a/client/me/notification-settings/blogs-settings/blog.jsx b/client/me/notification-settings/blogs-settings/blog.jsx index c924450a7dc2a3..63070d7a72f84e 100644 --- a/client/me/notification-settings/blogs-settings/blog.jsx +++ b/client/me/notification-settings/blogs-settings/blog.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import SettingsForm from 'calypso/me/notification-settings/settings-form'; import { getSite } from 'calypso/state/sites/selectors'; diff --git a/client/me/notification-settings/blogs-settings/header.jsx b/client/me/notification-settings/blogs-settings/header.jsx index aef8794ae4de30..5ed07b72243927 100644 --- a/client/me/notification-settings/blogs-settings/header.jsx +++ b/client/me/notification-settings/blogs-settings/header.jsx @@ -2,7 +2,7 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { countBy, map, omit, values, flatten } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import SiteInfo from 'calypso/blocks/site'; import { gaRecordEvent } from 'calypso/lib/analytics/ga'; diff --git a/client/me/notification-settings/blogs-settings/index.jsx b/client/me/notification-settings/blogs-settings/index.jsx index 3c577364a110c5..457c9f8654c84f 100644 --- a/client/me/notification-settings/blogs-settings/index.jsx +++ b/client/me/notification-settings/blogs-settings/index.jsx @@ -1,6 +1,6 @@ import { find } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import NoSitesMessage from 'calypso/components/empty-content/no-sites-message'; import InfiniteList from 'calypso/components/infinite-list'; diff --git a/client/me/notification-settings/blogs-settings/placeholder.jsx b/client/me/notification-settings/blogs-settings/placeholder.jsx index 0532a6db97fb87..17fa97c786c149 100644 --- a/client/me/notification-settings/blogs-settings/placeholder.jsx +++ b/client/me/notification-settings/blogs-settings/placeholder.jsx @@ -1,9 +1,9 @@ /* eslint-disable wpcalypso/jsx-classname-namespace */ import { CompactCard, Gridicon } from '@automattic/components'; -import React from 'react'; +import { Component } from 'react'; -export default class extends React.Component { +export default class extends Component { static displayName = 'NotificationsBlogSettingsPlaceholder'; shouldComponentUpdate() { diff --git a/client/me/notification-settings/comment-settings/index.jsx b/client/me/notification-settings/comment-settings/index.jsx index 660e271cfb196a..7b90a9de81a9b8 100644 --- a/client/me/notification-settings/comment-settings/index.jsx +++ b/client/me/notification-settings/comment-settings/index.jsx @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryUserDevices from 'calypso/components/data/query-user-devices'; import FormattedHeader from 'calypso/components/formatted-header'; diff --git a/client/me/notification-settings/controller.js b/client/me/notification-settings/controller.js index 8037c685bfaddf..a7a2d4fb10babd 100644 --- a/client/me/notification-settings/controller.js +++ b/client/me/notification-settings/controller.js @@ -1,5 +1,5 @@ import i18n from 'i18n-calypso'; -import React from 'react'; +import { createElement } from 'react'; import CommentSettingsComponent from 'calypso/me/notification-settings/comment-settings'; import NotificationsComponent from 'calypso/me/notification-settings/main'; import NotificationSubscriptions from 'calypso/me/notification-settings/reader-subscriptions'; @@ -10,7 +10,7 @@ export function notifications( context, next ) { // FIXME: Auto-converted from the setTitle action. Please use instead. context.store.dispatch( setTitle( i18n.translate( 'Notifications', { textOnly: true } ) ) ); - context.primary = React.createElement( NotificationsComponent, { + context.primary = createElement( NotificationsComponent, { path: context.path, } ); next(); @@ -22,7 +22,7 @@ export function comments( context, next ) { setTitle( i18n.translate( 'Comments on other sites', { textOnly: true } ) ) ); - context.primary = React.createElement( CommentSettingsComponent, { + context.primary = createElement( CommentSettingsComponent, { path: context.path, } ); next(); @@ -34,7 +34,7 @@ export function updates( context, next ) { setTitle( i18n.translate( 'Updates from WordPress.com', { textOnly: true } ) ) ); - context.primary = React.createElement( WPcomSettingsComponent, { + context.primary = createElement( WPcomSettingsComponent, { path: context.path, } ); next(); @@ -44,7 +44,7 @@ export function subscriptions( context, next ) { // FIXME: Auto-converted from the setTitle action. Please use instead. context.store.dispatch( setTitle( i18n.translate( 'Notifications', { textOnly: true } ) ) ); - context.primary = React.createElement( NotificationSubscriptions, { + context.primary = createElement( NotificationSubscriptions, { path: context.path, } ); next(); diff --git a/client/me/notification-settings/main.jsx b/client/me/notification-settings/main.jsx index cf846c86584c65..679326fb2fedfb 100644 --- a/client/me/notification-settings/main.jsx +++ b/client/me/notification-settings/main.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import { find } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryUserDevices from 'calypso/components/data/query-user-devices'; import FormattedHeader from 'calypso/components/formatted-header'; diff --git a/client/me/notification-settings/navigation.jsx b/client/me/notification-settings/navigation.jsx index 1d1a90a253c383..c6e16af3e76030 100644 --- a/client/me/notification-settings/navigation.jsx +++ b/client/me/notification-settings/navigation.jsx @@ -1,10 +1,10 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import SectionNav from 'calypso/components/section-nav'; import NavItem from 'calypso/components/section-nav/item'; import NavTabs from 'calypso/components/section-nav/tabs'; -class NotificationSettingsNavigation extends React.Component { +class NotificationSettingsNavigation extends Component { static displayName = 'NotificationSettingsNavigation'; render() { diff --git a/client/me/notification-settings/push-notification-settings/index.jsx b/client/me/notification-settings/push-notification-settings/index.jsx index 62c09933102044..04ae30b2f62f1e 100644 --- a/client/me/notification-settings/push-notification-settings/index.jsx +++ b/client/me/notification-settings/push-notification-settings/index.jsx @@ -2,7 +2,7 @@ import { Card, Button, Dialog, ScreenReaderText, Gridicon } from '@automattic/co import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Notice from 'calypso/components/notice'; import { toggleEnabled, toggleUnblockInstructions } from 'calypso/state/push-notifications/actions'; @@ -15,7 +15,7 @@ import { import './style.scss'; -class PushNotificationSettings extends React.Component { +class PushNotificationSettings extends Component { static propTypes = { toggleEnabled: PropTypes.func.isRequired, toggleUnblockInstructions: PropTypes.func.isRequired, diff --git a/client/me/notification-settings/reader-subscriptions/index.jsx b/client/me/notification-settings/reader-subscriptions/index.jsx index 7c6f4e3929b68c..07e23f527ac831 100644 --- a/client/me/notification-settings/reader-subscriptions/index.jsx +++ b/client/me/notification-settings/reader-subscriptions/index.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { flowRight as compose } from 'lodash'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormattedHeader from 'calypso/components/formatted-header'; import FormButton from 'calypso/components/forms/form-button'; @@ -23,7 +23,7 @@ import ReauthRequired from 'calypso/me/reauth-required'; import MeSidebarNavigation from 'calypso/me/sidebar-navigation'; import { recordGoogleEvent } from 'calypso/state/analytics/actions'; -class NotificationSubscriptions extends React.Component { +class NotificationSubscriptions extends Component { handleClickEvent( action ) { return () => this.props.recordGoogleEvent( 'Me', 'Clicked on ' + action ); } diff --git a/client/me/notification-settings/settings-form/actions.jsx b/client/me/notification-settings/settings-form/actions.jsx index 7098f3dd5dbd84..6f35720c0f2127 100644 --- a/client/me/notification-settings/settings-form/actions.jsx +++ b/client/me/notification-settings/settings-form/actions.jsx @@ -1,11 +1,11 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import FormButton from 'calypso/components/forms/form-button'; import './actions.scss'; -class NotificationSettingsFormActions extends React.PureComponent { +class NotificationSettingsFormActions extends PureComponent { static propTypes = { onSave: PropTypes.func.isRequired, onSaveToAll: PropTypes.func, diff --git a/client/me/notification-settings/settings-form/device-selector.jsx b/client/me/notification-settings/settings-form/device-selector.jsx index 5900a6daae1fe2..92865843b0eb15 100644 --- a/client/me/notification-settings/settings-form/device-selector.jsx +++ b/client/me/notification-settings/settings-form/device-selector.jsx @@ -1,6 +1,6 @@ import { size, map } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import FormSelect from 'calypso/components/forms/form-select'; import getUserDevices from 'calypso/state/selectors/get-user-devices'; diff --git a/client/me/notification-settings/settings-form/index.jsx b/client/me/notification-settings/settings-form/index.jsx index b22304e1c5ad99..c95543ed3ee38b 100644 --- a/client/me/notification-settings/settings-form/index.jsx +++ b/client/me/notification-settings/settings-form/index.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import Actions from './actions'; import Settings from './settings'; diff --git a/client/me/notification-settings/settings-form/labels-list.jsx b/client/me/notification-settings/settings-form/labels-list.jsx index 19f33cb8b72df3..f2de6245e66f8d 100644 --- a/client/me/notification-settings/settings-form/labels-list.jsx +++ b/client/me/notification-settings/settings-form/labels-list.jsx @@ -1,8 +1,8 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { getLabelForSetting } from './locales'; -export default class extends React.Component { +export default class extends Component { static displayName = 'NotificationSettingsFormLabelList'; static propTypes = { diff --git a/client/me/notification-settings/settings-form/labels.jsx b/client/me/notification-settings/settings-form/labels.jsx index e64f308147c066..cbf8ce548308be 100644 --- a/client/me/notification-settings/settings-form/labels.jsx +++ b/client/me/notification-settings/settings-form/labels.jsx @@ -1,10 +1,10 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import LabelsList from './labels-list'; import StreamHeader from './stream-header'; -class NotificationSettingsFormLabels extends React.Component { +class NotificationSettingsFormLabels extends Component { static displayName = 'NotificationSettingsFormLabels'; static propTypes = { diff --git a/client/me/notification-settings/settings-form/settings.jsx b/client/me/notification-settings/settings-form/settings.jsx index f93d698d93ae94..fb648962b4508d 100644 --- a/client/me/notification-settings/settings-form/settings.jsx +++ b/client/me/notification-settings/settings-form/settings.jsx @@ -1,6 +1,6 @@ import { find, get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import getUserDevices from 'calypso/state/selectors/get-user-devices'; import Labels from './labels'; diff --git a/client/me/notification-settings/settings-form/stream-header.jsx b/client/me/notification-settings/settings-form/stream-header.jsx index 988245ff722e36..30124ddd60bcda 100644 --- a/client/me/notification-settings/settings-form/stream-header.jsx +++ b/client/me/notification-settings/settings-form/stream-header.jsx @@ -1,9 +1,9 @@ import { Gridicon } from '@automattic/components'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { getLabelForStream } from './locales'; -export default class extends React.PureComponent { +export default class extends PureComponent { static displayName = 'NotificationSettingsFormHeader'; static propTypes = { diff --git a/client/me/notification-settings/settings-form/stream-options.jsx b/client/me/notification-settings/settings-form/stream-options.jsx index cdbf5c0a40d8e6..8f8918d6d138c2 100644 --- a/client/me/notification-settings/settings-form/stream-options.jsx +++ b/client/me/notification-settings/settings-form/stream-options.jsx @@ -1,10 +1,10 @@ import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import FormCheckbox from 'calypso/components/forms/form-checkbox'; import { NOTIFICATIONS_EXCEPTIONS } from './constants'; -export default class extends React.PureComponent { +export default class extends PureComponent { static displayName = 'NotificationSettingsFormStreamOptions'; static propTypes = { diff --git a/client/me/notification-settings/settings-form/stream-selector.jsx b/client/me/notification-settings/settings-form/stream-selector.jsx index 50d7ff967f7234..9b6ad3047e9ddf 100644 --- a/client/me/notification-settings/settings-form/stream-selector.jsx +++ b/client/me/notification-settings/settings-form/stream-selector.jsx @@ -1,6 +1,6 @@ import { map } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import FormSelect from 'calypso/components/forms/form-select'; import getUserDevices from 'calypso/state/selectors/get-user-devices'; diff --git a/client/me/notification-settings/settings-form/stream.jsx b/client/me/notification-settings/settings-form/stream.jsx index 1bf5d8db90b019..d80867a9702fcc 100644 --- a/client/me/notification-settings/settings-form/stream.jsx +++ b/client/me/notification-settings/settings-form/stream.jsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import { find, size } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import DeviceSelector from './device-selector'; import StreamHeader from './stream-header'; diff --git a/client/me/notification-settings/wpcom-settings/email-category.jsx b/client/me/notification-settings/wpcom-settings/email-category.jsx index 78a3b68498fe39..6778a74f99e3bf 100644 --- a/client/me/notification-settings/wpcom-settings/email-category.jsx +++ b/client/me/notification-settings/wpcom-settings/email-category.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormCheckbox from 'calypso/components/forms/form-checkbox'; import FormFieldset from 'calypso/components/forms/form-fieldset'; @@ -7,7 +7,7 @@ import FormLabel from 'calypso/components/forms/form-label'; import FormLegend from 'calypso/components/forms/form-legend'; import { toggleWPcomEmailSetting } from 'calypso/state/notification-settings/actions'; -class EmailCategory extends React.Component { +class EmailCategory extends Component { static propTypes = { name: PropTypes.string, isEnabled: PropTypes.bool, diff --git a/client/me/notification-settings/wpcom-settings/index.jsx b/client/me/notification-settings/wpcom-settings/index.jsx index b4cd52673a9364..61adc36ea96317 100644 --- a/client/me/notification-settings/wpcom-settings/index.jsx +++ b/client/me/notification-settings/wpcom-settings/index.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormattedHeader from 'calypso/components/formatted-header'; import FormSectionHeading from 'calypso/components/forms/form-section-heading'; @@ -43,7 +43,7 @@ const options = { jetpack_reports: 'jetpack_reports', }; -class WPCOMNotifications extends React.Component { +class WPCOMNotifications extends Component { static displayName = 'WPCOMNotifications'; // TODO: Add propTypes diff --git a/client/me/pending-payments/controller.js b/client/me/pending-payments/controller.js index b113140274b6b0..5d3baed9cc1371 100644 --- a/client/me/pending-payments/controller.js +++ b/client/me/pending-payments/controller.js @@ -1,7 +1,7 @@ -import React from 'react'; +import { createElement } from 'react'; import PendingPaymentsComponent from './index'; export function pendingPayments( context, next ) { - context.primary = React.createElement( PendingPaymentsComponent ); + context.primary = createElement( PendingPaymentsComponent ); next(); } diff --git a/client/me/pending-payments/index.jsx b/client/me/pending-payments/index.jsx index 3d97952b6f0e7c..4edcdc3f6307f7 100644 --- a/client/me/pending-payments/index.jsx +++ b/client/me/pending-payments/index.jsx @@ -1,7 +1,7 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Fragment, Component } from 'react'; import { connect } from 'react-redux'; import Banner from 'calypso/components/banner'; import EmptyContent from 'calypso/components/empty-content'; @@ -80,7 +80,7 @@ export class PendingPayments extends Component { ); } else if ( pendingPayments.length > 0 ) { content = ( - + ) ) }
- + ); } diff --git a/client/me/pending-payments/pending-list-item.jsx b/client/me/pending-payments/pending-list-item.jsx index cee114a5acd997..8c4f9f4e39e0b2 100644 --- a/client/me/pending-payments/pending-list-item.jsx +++ b/client/me/pending-payments/pending-list-item.jsx @@ -3,7 +3,7 @@ import formatCurrency from '@automattic/format-currency'; import { useTranslate } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Fragment } from 'react'; import { connect } from 'react-redux'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; import { paymentMethodName } from 'calypso/lib/cart-values'; @@ -36,7 +36,7 @@ export function PendingListItem( { } return ( - + @@ -64,8 +64,8 @@ export function PendingListItem( {
- - ); + + ); } PendingListItem.propTypes = { diff --git a/client/me/pending-payments/test/index.js b/client/me/pending-payments/test/index.js index 5622eed7899c5e..6218ab112d62ca 100644 --- a/client/me/pending-payments/test/index.js +++ b/client/me/pending-payments/test/index.js @@ -1,5 +1,4 @@ import { shallow } from 'enzyme'; -import React from 'react'; import { PendingPayments, requestId } from '../index'; jest.mock( 'calypso/state/data-layer/http-data', () => ( { diff --git a/client/me/pending-payments/test/pending-list-item.js b/client/me/pending-payments/test/pending-list-item.js index 0504ffe054af43..5cab3e03b4f469 100644 --- a/client/me/pending-payments/test/pending-list-item.js +++ b/client/me/pending-payments/test/pending-list-item.js @@ -1,7 +1,6 @@ import { PLAN_BUSINESS } from '@automattic/calypso-products'; import { shallow } from 'enzyme'; import moment from 'moment'; -import React from 'react'; import * as localizedMoment from 'calypso/components/localized-moment'; import { PendingListItem } from '../pending-list-item'; diff --git a/client/me/privacy/controller.js b/client/me/privacy/controller.js index 5f06d9e407b82a..05b12a2f862be2 100644 --- a/client/me/privacy/controller.js +++ b/client/me/privacy/controller.js @@ -1,7 +1,7 @@ -import React from 'react'; +import { createElement } from 'react'; import PrivacyComponent from 'calypso/me/privacy/main'; export function privacy( context, next ) { - context.primary = React.createElement( PrivacyComponent ); + context.primary = createElement( PrivacyComponent ); next(); } diff --git a/client/me/privacy/dpa.jsx b/client/me/privacy/dpa.jsx index 466a60177d66e8..e48e4f1edfffb6 100644 --- a/client/me/privacy/dpa.jsx +++ b/client/me/privacy/dpa.jsx @@ -1,6 +1,6 @@ import { Button, Card } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; +import { useState } from 'react'; import { useDispatch } from 'react-redux'; import SectionHeader from 'calypso/components/section-header'; import wp from 'calypso/lib/wp'; @@ -9,7 +9,7 @@ import { errorNotice, successNotice } from 'calypso/state/notices/actions'; const NOTICE_ID = 'request-dpa-notice'; const DPA = () => { - const [ isLoading, setLoading ] = React.useState( false ); + const [ isLoading, setLoading ] = useState( false ); const translate = useTranslate(); const dispatch = useDispatch(); diff --git a/client/me/privacy/main.jsx b/client/me/privacy/main.jsx index e182ae6e180242..6cc3e4be84ed20 100644 --- a/client/me/privacy/main.jsx +++ b/client/me/privacy/main.jsx @@ -3,7 +3,7 @@ import { withLocalizeUrl } from '@automattic/i18n-utils'; import { ToggleControl } from '@wordpress/components'; import { localize } from 'i18n-calypso'; import { flowRight as compose } from 'lodash'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import QueryUserSettings from 'calypso/components/data/query-user-settings'; @@ -26,7 +26,7 @@ import DPA from './dpa'; const TRACKS_OPT_OUT_USER_SETTINGS_KEY = 'tracks_opt_out'; -class Privacy extends React.Component { +class Privacy extends Component { componentDidUpdate( oldProps ) { if ( oldProps.hasUnsavedUserSettings && ! this.props.hasUnsavedUserSettings ) { this.props.markSaved(); diff --git a/client/me/profile-gravatar/index.jsx b/client/me/profile-gravatar/index.jsx index 17bfa290d0e99f..c8111e6fc4db25 100644 --- a/client/me/profile-gravatar/index.jsx +++ b/client/me/profile-gravatar/index.jsx @@ -1,5 +1,4 @@ import classNames from 'classnames'; -import React from 'react'; import { useDispatch } from 'react-redux'; import Animate from 'calypso/components/animate'; import Gravatar from 'calypso/components/gravatar'; diff --git a/client/me/profile-link/index.jsx b/client/me/profile-link/index.jsx index 746e82aad8358b..6531ba785e32bf 100644 --- a/client/me/profile-link/index.jsx +++ b/client/me/profile-link/index.jsx @@ -1,7 +1,7 @@ import { Button, Gridicon } from '@automattic/components'; import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import safeProtocolUrl from 'calypso/lib/safe-protocol-url'; import { withoutHttp } from 'calypso/lib/url'; @@ -9,7 +9,7 @@ import { recordGoogleEvent } from 'calypso/state/analytics/actions'; import './style.scss'; -class ProfileLink extends React.Component { +class ProfileLink extends Component { static defaultProps = { imageSize: 100, title: '', diff --git a/client/me/profile-links-add-other/index.jsx b/client/me/profile-links-add-other/index.jsx index 12b6f4118ac55f..0e1f68a06e8e77 100644 --- a/client/me/profile-links-add-other/index.jsx +++ b/client/me/profile-links-add-other/index.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import FormFieldset from 'calypso/components/forms/form-fieldset'; @@ -9,7 +9,7 @@ import { addUserProfileLinks } from 'calypso/state/profile-links/actions'; import './style.scss'; -class ProfileLinksAddOther extends React.Component { +class ProfileLinksAddOther extends Component { state = { title: '', value: '', diff --git a/client/me/profile-links-add-wordpress/index.jsx b/client/me/profile-links-add-wordpress/index.jsx index eaf64bed8bd35f..1abcef7d44f44f 100644 --- a/client/me/profile-links-add-wordpress/index.jsx +++ b/client/me/profile-links-add-wordpress/index.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import { find, map, pickBy } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import { recordGoogleEvent } from 'calypso/state/analytics/actions'; diff --git a/client/me/profile-links-add-wordpress/site.jsx b/client/me/profile-links-add-wordpress/site.jsx index 3697ab1fb29d03..34a140cd702d12 100644 --- a/client/me/profile-links-add-wordpress/site.jsx +++ b/client/me/profile-links-add-wordpress/site.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Site from 'calypso/blocks/site'; import FormInputCheckbox from 'calypso/components/forms/form-checkbox'; diff --git a/client/me/profile-links/add-buttons.jsx b/client/me/profile-links/add-buttons.jsx index d51f5a740b0dc2..30d80c57a83a94 100644 --- a/client/me/profile-links/add-buttons.jsx +++ b/client/me/profile-links/add-buttons.jsx @@ -1,13 +1,13 @@ import { Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { createRef, Component, Fragment } from 'react'; import { connect } from 'react-redux'; import PopoverMenu from 'calypso/components/popover-menu'; import PopoverMenuItem from 'calypso/components/popover-menu/item'; import { recordGoogleEvent } from 'calypso/state/analytics/actions'; -class AddProfileLinksButtons extends React.Component { +class AddProfileLinksButtons extends Component { static propTypes = { showingForm: PropTypes.string, showPopoverMenu: PropTypes.bool, @@ -15,7 +15,7 @@ class AddProfileLinksButtons extends React.Component { onShowAddOther: PropTypes.func.isRequired, }; - popoverContext = React.createRef(); + popoverContext = createRef(); recordClickEvent = ( action ) => { this.props.recordGoogleEvent( 'Me', 'Clicked on ' + action ); diff --git a/client/me/profile-links/index.jsx b/client/me/profile-links/index.jsx index 5f6e38f166def4..3698b2580aa290 100644 --- a/client/me/profile-links/index.jsx +++ b/client/me/profile-links/index.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { times } from 'lodash'; -import React, { Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryProfileLinks from 'calypso/components/data/query-profile-links'; import Notice from 'calypso/components/notice'; @@ -19,7 +19,7 @@ import getProfileLinksErrorType from 'calypso/state/selectors/get-profile-links- import './style.scss'; -class ProfileLinks extends React.Component { +class ProfileLinks extends Component { state = { showingForm: null, showPopoverMenu: false, diff --git a/client/me/profile/index.jsx b/client/me/profile/index.jsx index b5e48484783f64..b005558028d10b 100644 --- a/client/me/profile/index.jsx +++ b/client/me/profile/index.jsx @@ -2,7 +2,7 @@ import { Card } from '@automattic/components'; import { ToggleControl } from '@wordpress/components'; import { localize } from 'i18n-calypso'; import { flowRight as compose } from 'lodash'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import EditGravatar from 'calypso/blocks/edit-gravatar'; import FormattedHeader from 'calypso/components/formatted-header'; @@ -24,7 +24,7 @@ import { recordGoogleEvent } from 'calypso/state/analytics/actions'; import './style.scss'; -class Profile extends React.Component { +class Profile extends Component { getClickHandler( action ) { return () => this.props.recordGoogleEvent( 'Me', 'Clicked on ' + action ); } diff --git a/client/me/purchases/add-new-payment-method/index.jsx b/client/me/purchases/add-new-payment-method/index.jsx index c4891fb4a2b88f..31a2b666be987b 100644 --- a/client/me/purchases/add-new-payment-method/index.jsx +++ b/client/me/purchases/add-new-payment-method/index.jsx @@ -1,7 +1,7 @@ import { StripeHookProvider, useStripe } from '@automattic/calypso-stripe'; import { useTranslate } from 'i18n-calypso'; import page from 'page'; -import React, { useMemo, useEffect } from 'react'; +import { useMemo, useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import FormattedHeader from 'calypso/components/formatted-header'; diff --git a/client/me/purchases/billing-history/billing-history-filters.jsx b/client/me/purchases/billing-history/billing-history-filters.jsx index 962c38d8d0eeaf..08d36cf66bb77a 100644 --- a/client/me/purchases/billing-history/billing-history-filters.jsx +++ b/client/me/purchases/billing-history/billing-history-filters.jsx @@ -2,7 +2,7 @@ import closest from 'component-closest'; import { localize } from 'i18n-calypso'; import { find, isEqual } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; import SelectDropdown from 'calypso/components/select-dropdown'; @@ -12,7 +12,7 @@ import getBillingTransactionAppFilterValues from 'calypso/state/selectors/get-bi import getBillingTransactionDateFilterValues from 'calypso/state/selectors/get-billing-transaction-date-filter-values'; import getBillingTransactionFilters from 'calypso/state/selectors/get-billing-transaction-filters'; -class BillingHistoryFilters extends React.Component { +class BillingHistoryFilters extends Component { state = { activePopover: '', }; diff --git a/client/me/purchases/billing-history/billing-history-list.jsx b/client/me/purchases/billing-history/billing-history-list.jsx index 21bbc49c8ff5b2..cf2906afb9981e 100644 --- a/client/me/purchases/billing-history/billing-history-list.jsx +++ b/client/me/purchases/billing-history/billing-history-list.jsx @@ -2,7 +2,7 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { isEmpty } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import titleCase from 'to-title-case'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; @@ -22,7 +22,7 @@ import { renderTransactionQuantitySummary, } from './utils'; -class BillingHistoryList extends React.Component { +class BillingHistoryList extends Component { static displayName = 'BillingHistoryList'; static defaultProps = { diff --git a/client/me/purchases/billing-history/controller.js b/client/me/purchases/billing-history/controller.js index 804bd44c871206..f9248fe67c6ff8 100644 --- a/client/me/purchases/billing-history/controller.js +++ b/client/me/purchases/billing-history/controller.js @@ -1,9 +1,9 @@ -import React from 'react'; +import { createElement } from 'react'; import BillingHistoryComponent from 'calypso/me/purchases/billing-history/main'; import Receipt from './receipt'; export function billingHistory( context, next ) { - context.primary = React.createElement( BillingHistoryComponent ); + context.primary = createElement( BillingHistoryComponent ); next(); } @@ -11,7 +11,7 @@ export function transaction( context, next ) { const receiptId = context.params.receiptId; if ( receiptId ) { - context.primary = React.createElement( Receipt, { transactionId: receiptId } ); + context.primary = createElement( Receipt, { transactionId: receiptId } ); } next(); } diff --git a/client/me/purchases/billing-history/receipt.jsx b/client/me/purchases/billing-history/receipt.jsx index 3c2ef775c538bb..2d54dc694ebdc9 100644 --- a/client/me/purchases/billing-history/receipt.jsx +++ b/client/me/purchases/billing-history/receipt.jsx @@ -3,7 +3,7 @@ import { Button, Card } from '@automattic/components'; import classNames from 'classnames'; import { localize, useTranslate } from 'i18n-calypso'; import page from 'page'; -import React, { useState, useCallback } from 'react'; +import { Component, useState, useCallback } from 'react'; import { connect, useDispatch } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import QueryBillingTransaction from 'calypso/components/data/query-billing-transaction'; @@ -35,7 +35,7 @@ import { import './style.scss'; -class BillingReceipt extends React.Component { +class BillingReceipt extends Component { componentDidMount() { this.redirectIfInvalidTransaction(); } diff --git a/client/me/purchases/billing-history/utils.jsx b/client/me/purchases/billing-history/utils.jsx index 4de81221356be7..ff113f03f3973a 100644 --- a/client/me/purchases/billing-history/utils.jsx +++ b/client/me/purchases/billing-history/utils.jsx @@ -1,7 +1,7 @@ import { getPlanTermLabel, isGoogleWorkspace, isTitanMail } from '@automattic/calypso-products'; import formatCurrency from '@automattic/format-currency'; import { find, map, partition, reduce, some } from 'lodash'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; export const groupDomainProducts = ( originalItems, translate ) => { const transactionItems = Object.keys( originalItems ).map( ( key ) => { diff --git a/client/me/purchases/cancel-purchase/button.jsx b/client/me/purchases/cancel-purchase/button.jsx index 4d1013a019d8b0..a5a4f2862e9f21 100644 --- a/client/me/purchases/cancel-purchase/button.jsx +++ b/client/me/purchases/cancel-purchase/button.jsx @@ -4,7 +4,7 @@ import { getCurrencyDefaults } from '@automattic/format-currency'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import CancelPurchaseForm from 'calypso/components/marketing-survey/cancel-purchase-form'; import { CANCEL_FLOW_TYPE } from 'calypso/components/marketing-survey/cancel-purchase-form/constants'; diff --git a/client/me/purchases/cancel-purchase/cancellation-effect.jsx b/client/me/purchases/cancel-purchase/cancellation-effect.jsx index 3c4a9e81953628..47d74f83ed2a89 100644 --- a/client/me/purchases/cancel-purchase/cancellation-effect.jsx +++ b/client/me/purchases/cancel-purchase/cancellation-effect.jsx @@ -6,7 +6,6 @@ import { isPlan, isTheme, } from '@automattic/calypso-products'; -import React from 'react'; import { getGoogleMailServiceFamily } from 'calypso/lib/gsuite'; import { getName, getSubscriptionEndDate, isRefundable } from 'calypso/lib/purchases'; import { isJetpackTemporarySitePurchase } from '../utils'; diff --git a/client/me/purchases/cancel-purchase/index.jsx b/client/me/purchases/cancel-purchase/index.jsx index ad33ab42c109d8..0fb2f678918607 100644 --- a/client/me/purchases/cancel-purchase/index.jsx +++ b/client/me/purchases/cancel-purchase/index.jsx @@ -3,7 +3,7 @@ import { Card, CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryUserPurchases from 'calypso/components/data/query-user-purchases'; import HeaderCake from 'calypso/components/header-cake'; @@ -36,7 +36,7 @@ import CancelPurchaseRefundInformation from './refund-information'; import './style.scss'; -class CancelPurchase extends React.Component { +class CancelPurchase extends Component { static propTypes = { purchaseListUrl: PropTypes.string, getManagePurchaseUrlFor: PropTypes.func, diff --git a/client/me/purchases/cancel-purchase/loading-placeholder.jsx b/client/me/purchases/cancel-purchase/loading-placeholder.jsx index dc9646ebca664f..c56a053d6d8556 100644 --- a/client/me/purchases/cancel-purchase/loading-placeholder.jsx +++ b/client/me/purchases/cancel-purchase/loading-placeholder.jsx @@ -1,7 +1,6 @@ import { Button, Card, CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import LoadingPlaceholder from 'calypso/me/purchases/components/loading-placeholder'; import titles from 'calypso/me/purchases/titles'; diff --git a/client/me/purchases/cancel-purchase/refund-information.jsx b/client/me/purchases/cancel-purchase/refund-information.jsx index 63f2bd88ebf445..d01c6c27694c72 100644 --- a/client/me/purchases/cancel-purchase/refund-information.jsx +++ b/client/me/purchases/cancel-purchase/refund-information.jsx @@ -1,7 +1,6 @@ import { isDomainRegistration, isDomainMapping } from '@automattic/calypso-products'; import i18n from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import FormCheckbox from 'calypso/components/forms/form-checkbox'; import FormLabel from 'calypso/components/forms/form-label'; diff --git a/client/me/purchases/components/loading-placeholder/index.jsx b/client/me/purchases/components/loading-placeholder/index.jsx index 13af325cb046e6..20aa9e5352d083 100644 --- a/client/me/purchases/components/loading-placeholder/index.jsx +++ b/client/me/purchases/components/loading-placeholder/index.jsx @@ -1,12 +1,12 @@ import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import HeaderCake from 'calypso/components/header-cake'; import Main from 'calypso/components/main'; import './style.scss'; -class LoadingPlaceholder extends React.Component { +class LoadingPlaceholder extends Component { static propTypes = { path: PropTypes.string, title: PropTypes.string.isRequired, diff --git a/client/me/purchases/components/payment-method-loader/index.jsx b/client/me/purchases/components/payment-method-loader/index.jsx index 90dc3f74e6584b..8f8cf16c09f701 100644 --- a/client/me/purchases/components/payment-method-loader/index.jsx +++ b/client/me/purchases/components/payment-method-loader/index.jsx @@ -1,6 +1,5 @@ import { Card } from '@automattic/components'; import PropTypes from 'prop-types'; -import React from 'react'; import CreditCardFormFieldsLoadingPlaceholder from 'calypso/components/credit-card-form-fields/loading-placeholder'; import FormButton from 'calypso/components/forms/form-button'; import Layout from 'calypso/components/layout'; diff --git a/client/me/purchases/components/payment-method-sidebar/index.jsx b/client/me/purchases/components/payment-method-sidebar/index.jsx index 9bcc861e5347a9..980e360e265542 100644 --- a/client/me/purchases/components/payment-method-sidebar/index.jsx +++ b/client/me/purchases/components/payment-method-sidebar/index.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Fragment } from 'react'; import CardHeading from 'calypso/components/card-heading'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; @@ -11,7 +11,7 @@ export default function PaymentMethodSidebar( { purchase } ) { const translate = useTranslate(); return ( - + @@ -29,8 +29,8 @@ export default function PaymentMethodSidebar( { purchase } ) { ) }

-
- ); + + ); } function MainCard( { purchase } ) { diff --git a/client/me/purchases/concierge-banner/index.jsx b/client/me/purchases/concierge-banner/index.jsx index ba34792336b18b..1b69c10c06a3ff 100644 --- a/client/me/purchases/concierge-banner/index.jsx +++ b/client/me/purchases/concierge-banner/index.jsx @@ -2,7 +2,7 @@ import { Card } from '@automattic/components'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import conciergeImage from 'calypso/assets/images/illustrations/jetpack-concierge.svg'; import ActionCard from 'calypso/components/action-card'; import TrackComponentView from 'calypso/lib/analytics/track-component-view'; diff --git a/client/me/purchases/confirm-cancel-domain/cancellation-reasons.js b/client/me/purchases/confirm-cancel-domain/cancellation-reasons.js index a47b711234c293..f1086671f16507 100644 --- a/client/me/purchases/confirm-cancel-domain/cancellation-reasons.js +++ b/client/me/purchases/confirm-cancel-domain/cancellation-reasons.js @@ -1,5 +1,4 @@ import i18n from 'i18n-calypso'; -import React from 'react'; import { TRANSFER_DOMAIN_REGISTRATION, UPDATE_NAMESERVERS } from 'calypso/lib/url/support'; export default [ diff --git a/client/me/purchases/confirm-cancel-domain/index.jsx b/client/me/purchases/confirm-cancel-domain/index.jsx index d2f62981a5178d..d4c9e282a131de 100644 --- a/client/me/purchases/confirm-cancel-domain/index.jsx +++ b/client/me/purchases/confirm-cancel-domain/index.jsx @@ -4,7 +4,7 @@ import { localize } from 'i18n-calypso'; import { map, find } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryUserPurchases from 'calypso/components/data/query-user-purchases'; import FormButton from 'calypso/components/forms/form-button'; @@ -40,7 +40,7 @@ import ConfirmCancelDomainLoadingPlaceholder from './loading-placeholder'; import './style.scss'; -class ConfirmCancelDomain extends React.Component { +class ConfirmCancelDomain extends Component { static propTypes = { purchaseListUrl: PropTypes.string, getCancelPurchaseUrlFor: PropTypes.func, @@ -270,7 +270,7 @@ class ConfirmCancelDomain extends React.Component { const domain = getDomainName( purchase ); return ( - + - - ); + + ); } } diff --git a/client/me/purchases/confirm-cancel-domain/loading-placeholder.jsx b/client/me/purchases/confirm-cancel-domain/loading-placeholder.jsx index 44829edf70a4ee..5964fba830d801 100644 --- a/client/me/purchases/confirm-cancel-domain/loading-placeholder.jsx +++ b/client/me/purchases/confirm-cancel-domain/loading-placeholder.jsx @@ -1,7 +1,6 @@ import { Button, Card, CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import LoadingPlaceholder from 'calypso/me/purchases/components/loading-placeholder'; import { cancelPurchase } from 'calypso/me/purchases/paths'; import titles from 'calypso/me/purchases/titles'; diff --git a/client/me/purchases/controller.jsx b/client/me/purchases/controller.jsx index d3f6499f82ccfa..b652dd2fa1de15 100644 --- a/client/me/purchases/controller.jsx +++ b/client/me/purchases/controller.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import page from 'page'; -import React from 'react'; +import { Fragment } from 'react'; import DocumentHead from 'calypso/components/data/document-head'; import NoSitesMessage from 'calypso/components/empty-content/no-sites-message'; import FormattedHeader from 'calypso/components/formatted-header'; @@ -27,11 +27,11 @@ import VatInfoPage from './vat-info'; const PurchasesWrapper = ( { title = null, children } ) => { return ( - + { children } - - ); + + ); }; const noop = () => {}; const userHasNoSites = ( state ) => getCurrentUserSiteCount( state ) <= 0; diff --git a/client/me/purchases/manage-purchase/auto-renew-toggle/auto-renew-disabling-dialog/index.jsx b/client/me/purchases/manage-purchase/auto-renew-toggle/auto-renew-disabling-dialog/index.jsx index 324007cf1c973a..354dcd03aa9e06 100644 --- a/client/me/purchases/manage-purchase/auto-renew-toggle/auto-renew-disabling-dialog/index.jsx +++ b/client/me/purchases/manage-purchase/auto-renew-toggle/auto-renew-disabling-dialog/index.jsx @@ -7,7 +7,7 @@ import { import { Button, Dialog } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; import CancelAutoRenewalForm from 'calypso/components/marketing-survey/cancel-auto-renewal-form'; diff --git a/client/me/purchases/manage-purchase/auto-renew-toggle/auto-renew-payment-method-dialog/index.jsx b/client/me/purchases/manage-purchase/auto-renew-toggle/auto-renew-payment-method-dialog/index.jsx index f24f4e3dcdba74..ba69f742a91eb7 100644 --- a/client/me/purchases/manage-purchase/auto-renew-toggle/auto-renew-payment-method-dialog/index.jsx +++ b/client/me/purchases/manage-purchase/auto-renew-toggle/auto-renew-payment-method-dialog/index.jsx @@ -1,7 +1,7 @@ import { Dialog } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import './style.scss'; diff --git a/client/me/purchases/manage-purchase/auto-renew-toggle/index.jsx b/client/me/purchases/manage-purchase/auto-renew-toggle/index.jsx index db8a801165005c..60ec2aed27e65f 100644 --- a/client/me/purchases/manage-purchase/auto-renew-toggle/index.jsx +++ b/client/me/purchases/manage-purchase/auto-renew-toggle/index.jsx @@ -2,7 +2,7 @@ import { ToggleControl } from '@wordpress/components'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { isExpiring } from 'calypso/lib/purchases'; import { disableAutoRenew, enableAutoRenew } from 'calypso/lib/purchases/actions'; diff --git a/client/me/purchases/manage-purchase/change-payment-method/index.jsx b/client/me/purchases/manage-purchase/change-payment-method/index.jsx index 73071322bce397..c910a52c65e2ce 100644 --- a/client/me/purchases/manage-purchase/change-payment-method/index.jsx +++ b/client/me/purchases/manage-purchase/change-payment-method/index.jsx @@ -2,7 +2,7 @@ import { StripeHookProvider, useStripe } from '@automattic/calypso-stripe'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { connect } from 'react-redux'; import QueryStoredCards from 'calypso/components/data/query-stored-cards'; import QueryUserPurchases from 'calypso/components/data/query-user-purchases'; diff --git a/client/me/purchases/manage-purchase/index.jsx b/client/me/purchases/manage-purchase/index.jsx index 05f2494b9d059e..22631da63f5236 100644 --- a/client/me/purchases/manage-purchase/index.jsx +++ b/client/me/purchases/manage-purchase/index.jsx @@ -29,7 +29,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import googleWorkspaceIcon from 'calypso/assets/images/email-providers/google-workspace/icon.svg'; import AsyncLoad from 'calypso/components/async-load'; diff --git a/client/me/purchases/manage-purchase/notices.jsx b/client/me/purchases/manage-purchase/notices.jsx index bc03ec21d388f4..757dc55b6ee62d 100644 --- a/client/me/purchases/manage-purchase/notices.jsx +++ b/client/me/purchases/manage-purchase/notices.jsx @@ -9,7 +9,7 @@ import { import { localize } from 'i18n-calypso'; import { isEmpty, merge, minBy } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; import Notice from 'calypso/components/notice'; diff --git a/client/me/purchases/manage-purchase/plan-details/billing-period.jsx b/client/me/purchases/manage-purchase/plan-details/billing-period.jsx index 9fc5d84a25b5d4..9c3b33e191c0cf 100644 --- a/client/me/purchases/manage-purchase/plan-details/billing-period.jsx +++ b/client/me/purchases/manage-purchase/plan-details/billing-period.jsx @@ -3,7 +3,7 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Fragment, Component } from 'react'; import { connect } from 'react-redux'; import FormFieldset from 'calypso/components/forms/form-fieldset'; import FormLabel from 'calypso/components/forms/form-label'; @@ -91,7 +91,7 @@ export class PlanBillingPeriod extends Component { const isJetpackTemporarySite = isJetpackTemporarySitePurchase( purchase.domain ); return ( - + { translate( 'Billed monthly' ) } { site && isProductOwner && ( @@ -118,8 +118,8 @@ export class PlanBillingPeriod extends Component { ) } ) } - - ); + + ); } render() { diff --git a/client/me/purchases/manage-purchase/plan-details/index.jsx b/client/me/purchases/manage-purchase/plan-details/index.jsx index eb83bea89f053f..fcb6a2482fc05a 100644 --- a/client/me/purchases/manage-purchase/plan-details/index.jsx +++ b/client/me/purchases/manage-purchase/plan-details/index.jsx @@ -2,7 +2,7 @@ import { isJetpackPlan, isFreeJetpackPlan } from '@automattic/calypso-products'; import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ClipboardButtonInput from 'calypso/components/clipboard-button-input'; import QueryPluginKeys from 'calypso/components/data/query-plugin-keys'; diff --git a/client/me/purchases/manage-purchase/plan-details/test/billing-period.jsx b/client/me/purchases/manage-purchase/plan-details/test/billing-period.jsx index 157717fda63933..09a9544239b080 100644 --- a/client/me/purchases/manage-purchase/plan-details/test/billing-period.jsx +++ b/client/me/purchases/manage-purchase/plan-details/test/billing-period.jsx @@ -2,7 +2,6 @@ import { shallow } from 'enzyme'; import { translate } from 'i18n-calypso'; import moment from 'moment'; import page from 'page'; -import React from 'react'; import { PlanBillingPeriod } from '../billing-period'; const props = { diff --git a/client/me/purchases/manage-purchase/plan-details/test/index.jsx b/client/me/purchases/manage-purchase/plan-details/test/index.jsx index 553be32e65b874..5cde78052f98cc 100644 --- a/client/me/purchases/manage-purchase/plan-details/test/index.jsx +++ b/client/me/purchases/manage-purchase/plan-details/test/index.jsx @@ -1,6 +1,5 @@ import { shallow } from 'enzyme'; import { translate } from 'i18n-calypso'; -import React from 'react'; import PlanBillingPeriod from '../billing-period'; import { PurchasePlanDetails } from '../index'; diff --git a/client/me/purchases/manage-purchase/purchase-meta.jsx b/client/me/purchases/manage-purchase/purchase-meta.jsx index 1141c1ad39a177..8687a4b50f3767 100644 --- a/client/me/purchases/manage-purchase/purchase-meta.jsx +++ b/client/me/purchases/manage-purchase/purchase-meta.jsx @@ -15,7 +15,6 @@ import classNames from 'classnames'; import { useTranslate } from 'i18n-calypso'; import { times } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import { useSelector } from 'react-redux'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; import UserItem from 'calypso/components/user'; diff --git a/client/me/purchases/manage-purchase/test/notices.js b/client/me/purchases/manage-purchase/test/notices.js index 3addaf0f94f0c9..298ae042840eeb 100644 --- a/client/me/purchases/manage-purchase/test/notices.js +++ b/client/me/purchases/manage-purchase/test/notices.js @@ -3,7 +3,6 @@ */ import { render, screen } from '@testing-library/react'; -import React from 'react'; import { Provider as ReduxProvider } from 'react-redux'; import { createReduxStore } from 'calypso/state'; import PurchaseNotice from '../notices'; diff --git a/client/me/purchases/manage-purchase/test/payment-info-block.js b/client/me/purchases/manage-purchase/test/payment-info-block.js index 95dbebb7150e18..34fd9b9d62a819 100644 --- a/client/me/purchases/manage-purchase/test/payment-info-block.js +++ b/client/me/purchases/manage-purchase/test/payment-info-block.js @@ -6,7 +6,6 @@ /* eslint-disable jest/valid-title */ import { render, screen } from '@testing-library/react'; -import React from 'react'; import PaymentInfoBlock from '../payment-info-block'; import '@testing-library/jest-dom/extend-expect'; diff --git a/client/me/purchases/non-primary-domain-dialog/index.jsx b/client/me/purchases/non-primary-domain-dialog/index.jsx index 31f9f31010a7b0..63405720335501 100644 --- a/client/me/purchases/non-primary-domain-dialog/index.jsx +++ b/client/me/purchases/non-primary-domain-dialog/index.jsx @@ -1,7 +1,7 @@ import { Dialog } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import FormSectionHeading from 'calypso/components/forms/form-section-heading'; import './style.scss'; diff --git a/client/me/purchases/payment-methods/controller.js b/client/me/purchases/payment-methods/controller.js index 6c4135f945be23..ff502008462915 100644 --- a/client/me/purchases/payment-methods/controller.js +++ b/client/me/purchases/payment-methods/controller.js @@ -1,7 +1,7 @@ -import React from 'react'; +import { createElement } from 'react'; import PaymentMethodsComponent from 'calypso/me/purchases/payment-methods/main'; export function paymentMethods( context, next ) { - context.primary = React.createElement( PaymentMethodsComponent ); + context.primary = createElement( PaymentMethodsComponent ); next(); } diff --git a/client/me/purchases/payment-methods/payment-method-list.jsx b/client/me/purchases/payment-methods/payment-method-list.jsx index 77bdd4ddf21c3a..ceadaefe0c22da 100644 --- a/client/me/purchases/payment-methods/payment-method-list.jsx +++ b/client/me/purchases/payment-methods/payment-method-list.jsx @@ -2,7 +2,7 @@ import { Button, CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryStoredCards from 'calypso/components/data/query-stored-cards'; import SectionHeader from 'calypso/components/section-header'; diff --git a/client/me/purchases/product-link/index.jsx b/client/me/purchases/product-link/index.jsx index 5aed985c83a8fc..349e94fd1115e8 100644 --- a/client/me/purchases/product-link/index.jsx +++ b/client/me/purchases/product-link/index.jsx @@ -8,7 +8,6 @@ import { } from '@automattic/calypso-products'; import i18n from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import { domainManagementEdit } from 'calypso/my-sites/domains/paths'; import { emailManagement } from 'calypso/my-sites/email/paths'; diff --git a/client/me/purchases/purchase-item/index.jsx b/client/me/purchases/purchase-item/index.jsx index c5eed38d8f4cd4..03d2473880cee4 100644 --- a/client/me/purchases/purchase-item/index.jsx +++ b/client/me/purchases/purchase-item/index.jsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import i18nCalypso, { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import payPalImage from 'calypso/assets/images/upgrades/paypal-full.svg'; import SiteIcon from 'calypso/blocks/site-icon'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; diff --git a/client/me/purchases/purchase-item/test/index.js b/client/me/purchases/purchase-item/test/index.js index fdba2235dab6d2..60f02c8f74d7f0 100644 --- a/client/me/purchases/purchase-item/test/index.js +++ b/client/me/purchases/purchase-item/test/index.js @@ -1,7 +1,6 @@ import { shallow } from 'enzyme'; import i18n from 'i18n-calypso'; import moment from 'moment'; -import React from 'react'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import PurchaseItem from '../'; diff --git a/client/me/purchases/purchases-list/index.jsx b/client/me/purchases/purchases-list/index.jsx index aa24519514236b..e995122dd690ac 100644 --- a/client/me/purchases/purchases-list/index.jsx +++ b/client/me/purchases/purchases-list/index.jsx @@ -1,7 +1,7 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryConciergeInitial from 'calypso/components/data/query-concierge-initial'; import QueryMembershipsSubscriptions from 'calypso/components/data/query-memberships-subscriptions'; diff --git a/client/me/purchases/purchases-list/purchases-list-header.jsx b/client/me/purchases/purchases-list/purchases-list-header.jsx index 5ac78bd3b85a48..dbd20374e40034 100644 --- a/client/me/purchases/purchases-list/purchases-list-header.jsx +++ b/client/me/purchases/purchases-list/purchases-list-header.jsx @@ -1,6 +1,5 @@ import { CompactCard } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import 'calypso/me/purchases/style.scss'; diff --git a/client/me/purchases/purchases-navigation/index.jsx b/client/me/purchases/purchases-navigation/index.jsx index 381be4661fbf18..b082194458980e 100644 --- a/client/me/purchases/purchases-navigation/index.jsx +++ b/client/me/purchases/purchases-navigation/index.jsx @@ -1,7 +1,6 @@ import { isEnabled } from '@automattic/calypso-config'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { useDispatch } from 'react-redux'; import Search from 'calypso/components/search'; import SectionNav from 'calypso/components/section-nav'; diff --git a/client/me/purchases/purchases-site/header.jsx b/client/me/purchases/purchases-site/header.jsx index 14f6b1789572ac..b66c8642930f45 100644 --- a/client/me/purchases/purchases-site/header.jsx +++ b/client/me/purchases/purchases-site/header.jsx @@ -1,6 +1,6 @@ import { CompactCard, Gridicon } from '@automattic/components'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Site from 'calypso/blocks/site'; import SitePlaceholder from 'calypso/blocks/site/placeholder'; diff --git a/client/me/purchases/purchases-site/index.jsx b/client/me/purchases/purchases-site/index.jsx index a8b97a0e057f01..d4dd822a0b3942 100644 --- a/client/me/purchases/purchases-site/index.jsx +++ b/client/me/purchases/purchases-site/index.jsx @@ -7,7 +7,6 @@ import { } from '@automattic/calypso-products'; import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import AsyncLoad from 'calypso/components/async-load'; import QuerySites from 'calypso/components/data/query-sites'; diff --git a/client/me/purchases/remove-purchase/index.jsx b/client/me/purchases/remove-purchase/index.jsx index b9cf2e97f3650a..5f48aa67e93277 100644 --- a/client/me/purchases/remove-purchase/index.jsx +++ b/client/me/purchases/remove-purchase/index.jsx @@ -14,7 +14,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormSectionHeading from 'calypso/components/forms/form-section-heading'; import CancelJetpackForm from 'calypso/components/marketing-survey/cancel-jetpack-form'; diff --git a/client/me/purchases/remove-purchase/remove-domain-dialog/index.jsx b/client/me/purchases/remove-purchase/remove-domain-dialog/index.jsx index d1bc3db7064a0c..a8b45eac105e87 100644 --- a/client/me/purchases/remove-purchase/remove-domain-dialog/index.jsx +++ b/client/me/purchases/remove-purchase/remove-domain-dialog/index.jsx @@ -1,7 +1,7 @@ import { Dialog } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import FormFieldset from 'calypso/components/forms/form-fieldset'; import FormInputValidation from 'calypso/components/forms/form-input-validation'; diff --git a/client/me/purchases/track-purchase-page-view/test/index.js b/client/me/purchases/track-purchase-page-view/test/index.js index c50e80a03f9188..b3f19ee0c9394e 100644 --- a/client/me/purchases/track-purchase-page-view/test/index.js +++ b/client/me/purchases/track-purchase-page-view/test/index.js @@ -1,6 +1,5 @@ import deepFreeze from 'deep-freeze'; import { shallow } from 'enzyme'; -import React from 'react'; import { TrackPurchasePageView } from '..'; const baseProps = deepFreeze( { diff --git a/client/me/reauth-required/index.jsx b/client/me/reauth-required/index.jsx index 285c33a718f1d8..d6c3afa18c9985 100644 --- a/client/me/reauth-required/index.jsx +++ b/client/me/reauth-required/index.jsx @@ -3,7 +3,7 @@ import { supported } from '@github/webauthn-json'; import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import FormCheckbox from 'calypso/components/forms/form-checkbox'; @@ -24,7 +24,7 @@ const debug = debugFactory( 'calypso:me:reauth-required' ); // autofocus is used for tracking purposes, not an a11y issue /* eslint-disable jsx-a11y/no-autofocus, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, jsx-a11y/anchor-is-valid */ -class ReauthRequired extends React.Component { +class ReauthRequired extends Component { state = { remember2fa: false, // Should the 2fa be remembered for 30 days? code: '', // User's generated 2fa code diff --git a/client/me/reauth-required/security-key-form.jsx b/client/me/reauth-required/security-key-form.jsx index 9c051532758fae..c90e6ca37103bf 100644 --- a/client/me/reauth-required/security-key-form.jsx +++ b/client/me/reauth-required/security-key-form.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import FormInputValidation from 'calypso/components/forms/form-input-validation'; diff --git a/client/me/reauth-required/two-factor-actions.jsx b/client/me/reauth-required/two-factor-actions.jsx index dc538e59cfdc65..ae0e6e93a8b4f7 100644 --- a/client/me/reauth-required/two-factor-actions.jsx +++ b/client/me/reauth-required/two-factor-actions.jsx @@ -1,7 +1,7 @@ import { Button, Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { recordTracksEventWithClientId } from 'calypso/state/analytics/actions'; diff --git a/client/me/security-2fa-backup-codes-list/index.jsx b/client/me/security-2fa-backup-codes-list/index.jsx index 0afd90d3513271..0589f15d17bb44 100644 --- a/client/me/security-2fa-backup-codes-list/index.jsx +++ b/client/me/security-2fa-backup-codes-list/index.jsx @@ -4,7 +4,7 @@ import Clipboard from 'clipboard'; import { localize } from 'i18n-calypso'; import { flowRight as compose } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createRef, Component } from 'react'; import ReactDom from 'react-dom'; import { connect } from 'react-redux'; import ButtonGroup from 'calypso/components/button-group'; @@ -19,7 +19,7 @@ import { getCurrentUserName } from 'calypso/state/current-user/selectors'; import './style.scss'; -class Security2faBackupCodesList extends React.Component { +class Security2faBackupCodesList extends Component { static displayName = 'Security2faBackupCodesList'; static defaultProps = { @@ -39,9 +39,9 @@ class Security2faBackupCodesList extends React.Component { popup = false; - copyCodesButtonRef = React.createRef(); - printCodesButtonRef = React.createRef(); - downloadCodesButtonRef = React.createRef(); + copyCodesButtonRef = createRef(); + printCodesButtonRef = createRef(); + downloadCodesButtonRef = createRef(); componentDidMount() { // Configure clipboard to be triggered on clipboard button press diff --git a/client/me/security-2fa-backup-codes-prompt/index.jsx b/client/me/security-2fa-backup-codes-prompt/index.jsx index 07aaf3ba3dcbe8..bee9f82149b97b 100644 --- a/client/me/security-2fa-backup-codes-prompt/index.jsx +++ b/client/me/security-2fa-backup-codes-prompt/index.jsx @@ -1,7 +1,7 @@ import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import FormButton from 'calypso/components/forms/form-button'; import FormFieldset from 'calypso/components/forms/form-fieldset'; import FormLabel from 'calypso/components/forms/form-label'; @@ -14,7 +14,7 @@ import './style.scss'; const debug = debugFactory( 'calypso:me:security:2fa-backup-codes-prompt' ); -class Security2faBackupCodesPrompt extends React.Component { +class Security2faBackupCodesPrompt extends Component { static displayName = 'Security2faBackupCodesPrompt'; static propTypes = { diff --git a/client/me/security-2fa-backup-codes/index.jsx b/client/me/security-2fa-backup-codes/index.jsx index 998f90956d6641..6ca872c99cfe9e 100644 --- a/client/me/security-2fa-backup-codes/index.jsx +++ b/client/me/security-2fa-backup-codes/index.jsx @@ -1,6 +1,6 @@ import { Button, Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Notice from 'calypso/components/notice'; import SectionHeader from 'calypso/components/section-header'; @@ -12,7 +12,7 @@ import getUserSetting from 'calypso/state/selectors/get-user-setting'; import './style.scss'; -class Security2faBackupCodes extends React.Component { +class Security2faBackupCodes extends Component { constructor( props ) { super( props ); diff --git a/client/me/security-2fa-code-prompt/index.jsx b/client/me/security-2fa-code-prompt/index.jsx index 3cff903dd69891..ef0f707576545b 100644 --- a/client/me/security-2fa-code-prompt/index.jsx +++ b/client/me/security-2fa-code-prompt/index.jsx @@ -1,7 +1,7 @@ import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import FormButton from 'calypso/components/forms/form-button'; import FormButtonsBar from 'calypso/components/forms/form-buttons-bar'; import FormFieldset from 'calypso/components/forms/form-fieldset'; @@ -16,7 +16,7 @@ import './style.scss'; const debug = debugFactory( 'calypso:me:security:2fa-code-prompt' ); -class Security2faCodePrompt extends React.Component { +class Security2faCodePrompt extends Component { static displayName = 'Security2faCodePrompt'; static defaultProps = { diff --git a/client/me/security-2fa-disable/index.jsx b/client/me/security-2fa-disable/index.jsx index ad66a0f2a51737..513d6ed838cb7d 100644 --- a/client/me/security-2fa-disable/index.jsx +++ b/client/me/security-2fa-disable/index.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import FormSectionHeading from 'calypso/components/forms/form-section-heading'; diff --git a/client/me/security-2fa-enable/index.jsx b/client/me/security-2fa-enable/index.jsx index 8c33b7cf729f1f..2a7228570c2e37 100644 --- a/client/me/security-2fa-enable/index.jsx +++ b/client/me/security-2fa-enable/index.jsx @@ -3,7 +3,7 @@ import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; import QRCode from 'qrcode.react'; -import React from 'react'; +import { Component } from 'react'; import FormButton from 'calypso/components/forms/form-button'; import FormLabel from 'calypso/components/forms/form-label'; import FormSettingExplanation from 'calypso/components/forms/form-setting-explanation'; @@ -17,7 +17,7 @@ import './style.scss'; const debug = debugFactory( 'calypso:me:security:2fa-enable' ); -class Security2faEnable extends React.Component { +class Security2faEnable extends Component { static displayName = 'Security2faEnable'; static defaultProps = { diff --git a/client/me/security-2fa-initial-setup/index.jsx b/client/me/security-2fa-initial-setup/index.jsx index 0984506e7fd759..56add98a4afb38 100644 --- a/client/me/security-2fa-initial-setup/index.jsx +++ b/client/me/security-2fa-initial-setup/index.jsx @@ -1,13 +1,13 @@ import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import FormButton from 'calypso/components/forms/form-button'; import { gaRecordEvent } from 'calypso/lib/analytics/ga'; const debug = debugFactory( 'calypso:me:security:2fa-initial-setup' ); -class Security2faInitialSetup extends React.Component { +class Security2faInitialSetup extends Component { static displayName = 'Security2faInitialSetup'; static propTypes = { diff --git a/client/me/security-2fa-key/add.jsx b/client/me/security-2fa-key/add.jsx index 3f680f65c14e84..2556e2c8b02967 100644 --- a/client/me/security-2fa-key/add.jsx +++ b/client/me/security-2fa-key/add.jsx @@ -2,7 +2,7 @@ import { Card } from '@automattic/components'; import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { registerSecurityKey } from 'calypso/lib/webauthn'; import { errorNotice, warningNotice, successNotice } from 'calypso/state/notices/actions'; @@ -11,7 +11,7 @@ import WaitForKey from './wait-for-key'; const debug = debugFactory( 'calypso:me:security-2fa-key' ); -class Security2faKeyAdd extends React.Component { +class Security2faKeyAdd extends Component { static propTypes = { onRegister: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, diff --git a/client/me/security-2fa-key/delete-item-button.jsx b/client/me/security-2fa-key/delete-item-button.jsx index 97e796ca8b33e9..21d1cfc48af00b 100644 --- a/client/me/security-2fa-key/delete-item-button.jsx +++ b/client/me/security-2fa-key/delete-item-button.jsx @@ -1,7 +1,7 @@ import { Button, Dialog, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import { recordGoogleEvent } from '../../state/analytics/actions'; import { successNotice } from '../../state/notices/actions'; diff --git a/client/me/security-2fa-key/index.jsx b/client/me/security-2fa-key/index.jsx index bcb2ca0a59c740..029b85fc36d819 100644 --- a/client/me/security-2fa-key/index.jsx +++ b/client/me/security-2fa-key/index.jsx @@ -1,7 +1,7 @@ import { Button, Card, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Notice from 'calypso/components/notice'; import SectionHeader from 'calypso/components/section-header'; @@ -11,7 +11,7 @@ import { recordGoogleEvent } from 'calypso/state/analytics/actions'; import Security2faKeyAdd from './add'; import Security2faKeyList from './list'; -class Security2faKey extends React.Component { +class Security2faKey extends Component { state = { isEnabled: false, addingKey: false, diff --git a/client/me/security-2fa-key/item.jsx b/client/me/security-2fa-key/item.jsx index a3385a93cef54c..4748640da06657 100644 --- a/client/me/security-2fa-key/item.jsx +++ b/client/me/security-2fa-key/item.jsx @@ -1,7 +1,6 @@ import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import { recordGoogleEvent } from '../../state/analytics/actions'; import Security2faDeleteButton from './delete-item-button'; diff --git a/client/me/security-2fa-key/list.jsx b/client/me/security-2fa-key/list.jsx index 0ac1f7661f74c5..597a704995f86a 100644 --- a/client/me/security-2fa-key/list.jsx +++ b/client/me/security-2fa-key/list.jsx @@ -1,6 +1,5 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import { recordGoogleEvent } from '../../state/analytics/actions'; import Security2faKeyItem from './item'; diff --git a/client/me/security-2fa-key/name.jsx b/client/me/security-2fa-key/name.jsx index c273e127ae41cc..9b57aef3e50d65 100644 --- a/client/me/security-2fa-key/name.jsx +++ b/client/me/security-2fa-key/name.jsx @@ -1,13 +1,13 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import FormButton from 'calypso/components/forms/form-button'; import FormFieldset from 'calypso/components/forms/form-fieldset'; import FormLabel from 'calypso/components/forms/form-label'; import FormTextInput from 'calypso/components/forms/form-text-input'; -class Security2faKeyAddName extends React.Component { +class Security2faKeyAddName extends Component { static propTypes = { onNameSubmit: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, diff --git a/client/me/security-2fa-key/wait-for-key.jsx b/client/me/security-2fa-key/wait-for-key.jsx index b147285ef4ebab..eadf7f6757785a 100644 --- a/client/me/security-2fa-key/wait-for-key.jsx +++ b/client/me/security-2fa-key/wait-for-key.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import Spinner from 'calypso/components/spinner'; export default function WaitForKey() { diff --git a/client/me/security-2fa-progress/index.jsx b/client/me/security-2fa-progress/index.jsx index a9ed1d777a3791..da303aadc9a41a 100644 --- a/client/me/security-2fa-progress/index.jsx +++ b/client/me/security-2fa-progress/index.jsx @@ -1,12 +1,12 @@ import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; const debug = debugFactory( 'calypso:me:security:2fa-progress' ); import ProgressItem from './progress-item'; import './style.scss'; -class Security2faProgress extends React.Component { +class Security2faProgress extends Component { static displayName = 'Security2faProgress'; componentDidMount() { diff --git a/client/me/security-2fa-progress/progress-item.jsx b/client/me/security-2fa-progress/progress-item.jsx index b3bda484ffe5dc..20fa6620c640d5 100644 --- a/client/me/security-2fa-progress/progress-item.jsx +++ b/client/me/security-2fa-progress/progress-item.jsx @@ -1,6 +1,5 @@ import { Gridicon } from '@automattic/components'; import classNames from 'classnames'; -import React from 'react'; import FormLabel from 'calypso/components/forms/form-label'; const Security2faProgressItem = ( { icon, label, step } ) => ( diff --git a/client/me/security-2fa-setup-backup-codes/index.jsx b/client/me/security-2fa-setup-backup-codes/index.jsx index b8a5c699af4b84..4b5a0f225fdbd1 100644 --- a/client/me/security-2fa-setup-backup-codes/index.jsx +++ b/client/me/security-2fa-setup-backup-codes/index.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Notice from 'calypso/components/notice'; import twoStepAuthorization from 'calypso/lib/two-step-authorization'; @@ -9,7 +9,7 @@ import Security2faBackupCodesList from 'calypso/me/security-2fa-backup-codes-lis import Security2faProgress from 'calypso/me/security-2fa-progress'; import { recordGoogleEvent } from 'calypso/state/analytics/actions'; -class Security2faSetupBackupCodes extends React.Component { +class Security2faSetupBackupCodes extends Component { state = { backupCodes: [], lastError: false, diff --git a/client/me/security-2fa-setup/index.jsx b/client/me/security-2fa-setup/index.jsx index 479c5c70a7fc9d..e22fb292007779 100644 --- a/client/me/security-2fa-setup/index.jsx +++ b/client/me/security-2fa-setup/index.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Security2faEnable from 'calypso/me/security-2fa-enable'; import Security2faInitialSetup from 'calypso/me/security-2fa-initial-setup'; diff --git a/client/me/security-2fa-sms-settings/index.jsx b/client/me/security-2fa-sms-settings/index.jsx index 4dfb931d7bea01..b8024e3ecc7bc9 100644 --- a/client/me/security-2fa-sms-settings/index.jsx +++ b/client/me/security-2fa-sms-settings/index.jsx @@ -1,7 +1,7 @@ import { localize } from 'i18n-calypso'; import { flowRight as compose } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QuerySmsCountries from 'calypso/components/data/query-countries/sms'; import FormButton from 'calypso/components/forms/form-button'; @@ -19,7 +19,7 @@ import { saveTwoStepSMSSettings } from 'calypso/state/user-settings/thunks'; import './style.scss'; import { isUpdatingUserSettings } from 'calypso/state/user-settings/selectors'; -class Security2faSMSSettings extends React.Component { +class Security2faSMSSettings extends Component { static propTypes = { countriesList: PropTypes.array.isRequired, onCancel: PropTypes.func.isRequired, diff --git a/client/me/security-2fa-status/index.jsx b/client/me/security-2fa-status/index.jsx index 4e8833c1b5d8ba..f7a94771f07316 100644 --- a/client/me/security-2fa-status/index.jsx +++ b/client/me/security-2fa-status/index.jsx @@ -1,12 +1,12 @@ import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import './style.scss'; const debug = debugFactory( 'calypso:me:security:2fa-status' ); -class Security2faStatus extends React.Component { +class Security2faStatus extends Component { static displayName = 'Security2faStatus'; componentDidMount() { diff --git a/client/me/security-account-recovery/buttons.jsx b/client/me/security-account-recovery/buttons.jsx index aae684e1e87998..228d8811c692d0 100644 --- a/client/me/security-account-recovery/buttons.jsx +++ b/client/me/security-account-recovery/buttons.jsx @@ -1,10 +1,10 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import FormButton from 'calypso/components/forms/form-button'; -class SecurityAccountRecoveryManageContactButtons extends React.Component { +class SecurityAccountRecoveryManageContactButtons extends Component { static displayName = 'SecurityAccountRecoveryManageContactButtons'; static propTypes = { diff --git a/client/me/security-account-recovery/edit-email.jsx b/client/me/security-account-recovery/edit-email.jsx index 471324cb032c90..9830bd4b1ad45d 100644 --- a/client/me/security-account-recovery/edit-email.jsx +++ b/client/me/security-account-recovery/edit-email.jsx @@ -1,7 +1,7 @@ import emailValidator from 'email-validator'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import ReactDom from 'react-dom'; import FormFieldset from 'calypso/components/forms/form-fieldset'; import FormInputValidation from 'calypso/components/forms/form-input-validation'; @@ -9,7 +9,7 @@ import FormSettingExplanation from 'calypso/components/forms/form-setting-explan import FormTextInput from 'calypso/components/forms/form-text-input'; import Buttons from './buttons'; -class SecurityAccountRecoveryRecoveryEmailEdit extends React.Component { +class SecurityAccountRecoveryRecoveryEmailEdit extends Component { static displayName = 'SecurityAccountRecoveryRecoveryEmailEdit'; static propTypes = { diff --git a/client/me/security-account-recovery/edit-phone.jsx b/client/me/security-account-recovery/edit-phone.jsx index a7bf0f2401536d..39efb55fa32b1e 100644 --- a/client/me/security-account-recovery/edit-phone.jsx +++ b/client/me/security-account-recovery/edit-phone.jsx @@ -1,7 +1,7 @@ import { localize } from 'i18n-calypso'; import { isEmpty } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QuerySmsCountries from 'calypso/components/data/query-countries/sms'; import FormFieldset from 'calypso/components/forms/form-fieldset'; @@ -10,7 +10,7 @@ import FormPhoneInput from 'calypso/components/forms/form-phone-input'; import getCountries from 'calypso/state/selectors/get-countries'; import Buttons from './buttons'; -class SecurityAccountRecoveryRecoveryPhoneEdit extends React.Component { +class SecurityAccountRecoveryRecoveryPhoneEdit extends Component { static displayName = 'SecurityAccountRecoveryRecoveryPhoneEdit'; static propTypes = { diff --git a/client/me/security-account-recovery/index.jsx b/client/me/security-account-recovery/index.jsx index 8fe2599a44840e..cf0668fe117be3 100644 --- a/client/me/security-account-recovery/index.jsx +++ b/client/me/security-account-recovery/index.jsx @@ -1,7 +1,6 @@ import config from '@automattic/calypso-config'; import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import QueryAccountRecoverySettings from 'calypso/components/data/query-account-recovery-settings'; diff --git a/client/me/security-account-recovery/manage-contact.jsx b/client/me/security-account-recovery/manage-contact.jsx index 937cbc44ce253a..ed7ef71850be93 100644 --- a/client/me/security-account-recovery/manage-contact.jsx +++ b/client/me/security-account-recovery/manage-contact.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { cloneElement, Component } from 'react'; import FormButton from 'calypso/components/forms/form-button'; import { recordTracksEvent } from 'calypso/lib/analytics/tracks'; @@ -56,7 +56,7 @@ class ManageContact extends Component { if ( views.EDITING === this.state.currentView ) { view = (
- { React.cloneElement( this.props.children, { + { cloneElement( this.props.children, { onCancel: this.onCancel, onSave: this.onSave, onDelete: this.onDelete, diff --git a/client/me/security-account-recovery/recovery-email-validation-notice.jsx b/client/me/security-account-recovery/recovery-email-validation-notice.jsx index d5d206500dfdad..39aa3eba8043c0 100644 --- a/client/me/security-account-recovery/recovery-email-validation-notice.jsx +++ b/client/me/security-account-recovery/recovery-email-validation-notice.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import Notice from 'calypso/components/notice'; import NoticeAction from 'calypso/components/notice/notice-action'; diff --git a/client/me/security-account-recovery/recovery-email.jsx b/client/me/security-account-recovery/recovery-email.jsx index 8cdb09c70c0e70..6540dfd6139c56 100644 --- a/client/me/security-account-recovery/recovery-email.jsx +++ b/client/me/security-account-recovery/recovery-email.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import accept from 'calypso/lib/accept'; import EditEmail from './edit-email'; import ManageContact from './manage-contact'; diff --git a/client/me/security-account-recovery/recovery-phone-validation-notice.jsx b/client/me/security-account-recovery/recovery-phone-validation-notice.jsx index 0f0ca65d3e99dc..f8a8141f955235 100644 --- a/client/me/security-account-recovery/recovery-phone-validation-notice.jsx +++ b/client/me/security-account-recovery/recovery-phone-validation-notice.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import FormButton from 'calypso/components/forms/form-button'; import FormButtonsBar from 'calypso/components/forms/form-buttons-bar'; import FormLabel from 'calypso/components/forms/form-label'; diff --git a/client/me/security-account-recovery/recovery-phone.jsx b/client/me/security-account-recovery/recovery-phone.jsx index c37f95b2cc41bd..7e7de4328ba241 100644 --- a/client/me/security-account-recovery/recovery-phone.jsx +++ b/client/me/security-account-recovery/recovery-phone.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import accept from 'calypso/lib/accept'; import EditPhone from './edit-phone'; import ManageContact from './manage-contact'; diff --git a/client/me/security-checkup/account-email.jsx b/client/me/security-checkup/account-email.jsx index 24687f9f77ee15..63ea1cb0b39bc3 100644 --- a/client/me/security-checkup/account-email.jsx +++ b/client/me/security-checkup/account-email.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { getCurrentUserEmail, @@ -9,7 +9,7 @@ import { import { getOKIcon, getWarningIcon } from './icons.js'; import SecurityCheckupNavigationItem from './navigation-item'; -class SecurityCheckupAccountEmail extends React.Component { +class SecurityCheckupAccountEmail extends Component { static propTypes = { primaryEmail: PropTypes.string, primaryEmailVerified: PropTypes.bool, diff --git a/client/me/security-checkup/account-recovery-email.jsx b/client/me/security-checkup/account-recovery-email.jsx index f95f39e970a103..85278968316d7b 100644 --- a/client/me/security-checkup/account-recovery-email.jsx +++ b/client/me/security-checkup/account-recovery-email.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryAccountRecoverySettings from 'calypso/components/data/query-account-recovery-settings'; import { @@ -11,7 +11,7 @@ import { import { getOKIcon, getWarningIcon } from './icons.js'; import SecurityCheckupNavigationItem from './navigation-item'; -class SecurityCheckupAccountRecoveryEmail extends React.Component { +class SecurityCheckupAccountRecoveryEmail extends Component { static propTypes = { accountRecoveryEmail: PropTypes.oneOfType( [ PropTypes.bool, PropTypes.string ] ), accountRecoveryEmailActionInProgress: PropTypes.bool, @@ -29,11 +29,11 @@ class SecurityCheckupAccountRecoveryEmail extends React.Component { if ( accountRecoveryEmailActionInProgress ) { return ( - + - - ); + + ); } let icon; diff --git a/client/me/security-checkup/account-recovery-phone.jsx b/client/me/security-checkup/account-recovery-phone.jsx index ec2af4b59035a7..2c3f41ab60d922 100644 --- a/client/me/security-checkup/account-recovery-phone.jsx +++ b/client/me/security-checkup/account-recovery-phone.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryAccountRecoverySettings from 'calypso/components/data/query-account-recovery-settings'; import { @@ -11,7 +11,7 @@ import { import { getOKIcon, getWarningIcon } from './icons.js'; import SecurityCheckupNavigationItem from './navigation-item'; -class SecurityCheckupAccountRecoveryPhone extends React.Component { +class SecurityCheckupAccountRecoveryPhone extends Component { static propTypes = { accountRecoveryPhone: PropTypes.object, accountRecoveryPhoneActionInProgress: PropTypes.bool, @@ -29,11 +29,11 @@ class SecurityCheckupAccountRecoveryPhone extends React.Component { if ( accountRecoveryPhoneActionInProgress ) { return ( - + - - ); + + ); } let icon; diff --git a/client/me/security-checkup/connected-applications.jsx b/client/me/security-checkup/connected-applications.jsx index df2ca741409e0f..9b0bd99eff6479 100644 --- a/client/me/security-checkup/connected-applications.jsx +++ b/client/me/security-checkup/connected-applications.jsx @@ -1,12 +1,12 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryConnectedApplications from 'calypso/components/data/query-connected-applications'; import getConnectedApplications from 'calypso/state/selectors/get-connected-applications'; import SecurityCheckupNavigationItem from './navigation-item'; -class SecurityCheckupConnectedApplications extends React.Component { +class SecurityCheckupConnectedApplications extends Component { static propTypes = { connectedApps: PropTypes.array, translate: PropTypes.func.isRequired, @@ -52,11 +52,11 @@ class SecurityCheckupConnectedApplications extends React.Component { } return ( - + { content } - - ); + + ); } } diff --git a/client/me/security-checkup/index.jsx b/client/me/security-checkup/index.jsx index bb3fdb4a577f57..80aea9eb48cc67 100644 --- a/client/me/security-checkup/index.jsx +++ b/client/me/security-checkup/index.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import DocumentHead from 'calypso/components/data/document-head'; import FormattedHeader from 'calypso/components/formatted-header'; import Main from 'calypso/components/main'; @@ -21,7 +21,7 @@ import SecurityCheckupTwoFactorBackupCodes from './two-factor-backup-codes'; import './style.scss'; -class SecurityCheckupComponent extends React.Component { +class SecurityCheckupComponent extends Component { static propTypes = { path: PropTypes.string, translate: PropTypes.func.isRequired, diff --git a/client/me/security-checkup/navigation-item.jsx b/client/me/security-checkup/navigation-item.jsx index d7e09756e16dad..c0b370fbbec5b6 100644 --- a/client/me/security-checkup/navigation-item.jsx +++ b/client/me/security-checkup/navigation-item.jsx @@ -1,12 +1,12 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { Component, Fragment } from 'react'; import MaterialIcon from 'calypso/components/material-icon'; import VerticalNavItem from 'calypso/components/vertical-nav/item'; const SecurityCheckupNavigationItemContents = function ( props ) { const { materialIcon, materialIconStyle, text, description } = props; return ( - + { text }
{ description } - - ); + + ); }; -class SecurityCheckupNavigationItem extends React.Component { +class SecurityCheckupNavigationItem extends Component { static propTypes = { description: PropTypes.node, external: PropTypes.bool, diff --git a/client/me/security-checkup/password.jsx b/client/me/security-checkup/password.jsx index a8beeaec2f9101..8c237098c9ba8e 100644 --- a/client/me/security-checkup/password.jsx +++ b/client/me/security-checkup/password.jsx @@ -1,10 +1,10 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { getOKIcon } from './icons.js'; import SecurityCheckupNavigationItem from './navigation-item'; -class SecurityCheckupPassword extends React.Component { +class SecurityCheckupPassword extends Component { static propTypes = { translate: PropTypes.func.isRequired, }; diff --git a/client/me/security-checkup/social-logins.jsx b/client/me/security-checkup/social-logins.jsx index 99921a8566f644..3e47cfc47593c4 100644 --- a/client/me/security-checkup/social-logins.jsx +++ b/client/me/security-checkup/social-logins.jsx @@ -1,11 +1,11 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { getCurrentUser } from 'calypso/state/current-user/selectors'; import SecurityCheckupNavigationItem from './navigation-item'; -class SecurityCheckupSocialLogins extends React.Component { +class SecurityCheckupSocialLogins extends Component { static propTypes = { socialConnectionCount: PropTypes.number.isRequired, translate: PropTypes.func.isRequired, diff --git a/client/me/security-checkup/two-factor-authentication.jsx b/client/me/security-checkup/two-factor-authentication.jsx index f61623a4ad6021..a185a24a5636b7 100644 --- a/client/me/security-checkup/two-factor-authentication.jsx +++ b/client/me/security-checkup/two-factor-authentication.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryUserSettings from 'calypso/components/data/query-user-settings'; import getUserSetting from 'calypso/state/selectors/get-user-setting'; @@ -10,7 +10,7 @@ import isTwoStepSmsEnabled from 'calypso/state/selectors/is-two-step-sms-enabled import { getOKIcon, getWarningIcon } from './icons.js'; import SecurityCheckupNavigationItem from './navigation-item'; -class SecurityCheckupTwoFactorAuthentication extends React.Component { +class SecurityCheckupTwoFactorAuthentication extends Component { static propTypes = { areUserSettingsLoaded: PropTypes.bool, hasTwoStepEnabled: PropTypes.bool, @@ -30,11 +30,11 @@ class SecurityCheckupTwoFactorAuthentication extends React.Component { if ( ! areUserSettingsLoaded ) { return ( - + - - ); + + ); } let icon; @@ -69,7 +69,7 @@ class SecurityCheckupTwoFactorAuthentication extends React.Component { } return ( - + - - ); + + ); } } diff --git a/client/me/security-checkup/two-factor-backup-codes.jsx b/client/me/security-checkup/two-factor-backup-codes.jsx index 68786588b0c3dd..05fe67e1f6a64f 100644 --- a/client/me/security-checkup/two-factor-backup-codes.jsx +++ b/client/me/security-checkup/two-factor-backup-codes.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import QueryUserSettings from 'calypso/components/data/query-user-settings'; import getUserSetting from 'calypso/state/selectors/get-user-setting'; @@ -9,7 +9,7 @@ import isTwoStepEnabled from 'calypso/state/selectors/is-two-step-enabled'; import { getOKIcon, getWarningIcon } from './icons.js'; import SecurityCheckupNavigationItem from './navigation-item'; -class SecurityCheckupTwoFactorBackupCodes extends React.Component { +class SecurityCheckupTwoFactorBackupCodes extends Component { static propTypes = { areBackupCodesPrinted: PropTypes.bool, areUserSettingsLoaded: PropTypes.bool, @@ -27,11 +27,11 @@ class SecurityCheckupTwoFactorBackupCodes extends React.Component { if ( ! areUserSettingsLoaded ) { return ( - + - - ); + + ); } // Don't show this item if the user doesn't have 2FA enabled. @@ -58,7 +58,7 @@ class SecurityCheckupTwoFactorBackupCodes extends React.Component { } return ( - + - - ); + + ); } } diff --git a/client/me/security-section-nav/index.jsx b/client/me/security-section-nav/index.jsx index c32270413453bb..d7e5b1275b4140 100644 --- a/client/me/security-section-nav/index.jsx +++ b/client/me/security-section-nav/index.jsx @@ -1,12 +1,12 @@ import i18n from 'i18n-calypso'; import { find } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import SectionNav from 'calypso/components/section-nav'; import NavItem from 'calypso/components/section-nav/item'; import NavTabs from 'calypso/components/section-nav/tabs'; -export default class SecuritySectionNav extends React.Component { +export default class SecuritySectionNav extends Component { static propTypes = { path: PropTypes.string.isRequired, }; diff --git a/client/me/security/controller.js b/client/me/security/controller.js index 75654633c84b48..13285ea4381f86 100644 --- a/client/me/security/controller.js +++ b/client/me/security/controller.js @@ -1,6 +1,6 @@ import i18n from 'i18n-calypso'; import page from 'page'; -import React from 'react'; +import { createElement } from 'react'; import { getSocialServiceFromClientId } from 'calypso/lib/login'; import ConnectedAppsComponent from 'calypso/me/connected-applications'; import AccountRecoveryComponent from 'calypso/me/security-account-recovery'; @@ -20,7 +20,7 @@ export function password( context, next ) { page.replace( window.location.pathname ); } - context.primary = React.createElement( PasswordComponent, { + context.primary = createElement( PasswordComponent, { path: context.path, } ); next(); @@ -29,28 +29,28 @@ export function password( context, next ) { export function twoStep( context, next ) { const TwoStepComponent = require( 'calypso/me/two-step' ).default; - context.primary = React.createElement( TwoStepComponent, { + context.primary = createElement( TwoStepComponent, { path: context.path, } ); next(); } export function connectedApplications( context, next ) { - context.primary = React.createElement( ConnectedAppsComponent, { + context.primary = createElement( ConnectedAppsComponent, { path: context.path, } ); next(); } export function accountRecovery( context, next ) { - context.primary = React.createElement( AccountRecoveryComponent, { + context.primary = createElement( AccountRecoveryComponent, { path: context.path, } ); next(); } export function securityCheckup( context, next ) { - context.primary = React.createElement( SecurityCheckupComponent, { + context.primary = createElement( SecurityCheckupComponent, { path: context.path, } ); next(); @@ -70,7 +70,7 @@ export function socialLogin( context, next ) { : null; const socialService = getSocialServiceFromClientId( client_id ); - context.primary = React.createElement( SocialLoginComponent, { + context.primary = createElement( SocialLoginComponent, { path: context.path, socialService, socialServiceResponse, diff --git a/client/me/security/main.jsx b/client/me/security/main.jsx index fbb9350d6bc26e..1d78ca1b03a878 100644 --- a/client/me/security/main.jsx +++ b/client/me/security/main.jsx @@ -3,7 +3,7 @@ import { Card } from '@automattic/components'; import debugFactory from 'debug'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import DocumentHead from 'calypso/components/data/document-head'; import FormattedHeader from 'calypso/components/formatted-header'; import HeaderCake from 'calypso/components/header-cake'; @@ -19,7 +19,7 @@ const debug = debugFactory( 'calypso:me:security:password' ); import './style.scss'; -class Security extends React.Component { +class Security extends Component { static displayName = 'Security'; static propTypes = { diff --git a/client/me/sidebar-navigation/index.jsx b/client/me/sidebar-navigation/index.jsx index 3ea94b70f0525b..71557709225668 100644 --- a/client/me/sidebar-navigation/index.jsx +++ b/client/me/sidebar-navigation/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import Gravatar from 'calypso/components/gravatar'; import SidebarNavigation from 'calypso/components/sidebar-navigation'; diff --git a/client/me/sidebar/index.jsx b/client/me/sidebar/index.jsx index 47b9ed6254fef9..9bc38265e99d41 100644 --- a/client/me/sidebar/index.jsx +++ b/client/me/sidebar/index.jsx @@ -1,7 +1,7 @@ import config from '@automattic/calypso-config'; import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Sidebar from 'calypso/layout/sidebar'; import SidebarFooter from 'calypso/layout/sidebar/footer'; @@ -21,7 +21,7 @@ import { setNextLayoutFocus } from 'calypso/state/ui/layout-focus/actions'; import './style.scss'; import 'calypso/my-sites/sidebar-unified/style.scss'; // nav-unification overrides. Should be removed once launched. -class MeSidebar extends React.Component { +class MeSidebar extends Component { onNavigate = () => { this.props.setNextLayoutFocus( 'content' ); window.scrollTo( 0, 0 ); diff --git a/client/me/site-blocks/controller.js b/client/me/site-blocks/controller.js index 2224118eb6bd27..205f55728fc4b2 100644 --- a/client/me/site-blocks/controller.js +++ b/client/me/site-blocks/controller.js @@ -1,7 +1,7 @@ -import React from 'react'; +import { createElement } from 'react'; import SiteBlockListComponent from 'calypso/me/site-blocks/main'; export function siteBlockList( context, next ) { - context.primary = React.createElement( SiteBlockListComponent ); + context.primary = createElement( SiteBlockListComponent ); next(); } diff --git a/client/me/site-blocks/list-item-placeholder.jsx b/client/me/site-blocks/list-item-placeholder.jsx index fa57fb0fd04986..0a1a0cd721ecac 100644 --- a/client/me/site-blocks/list-item-placeholder.jsx +++ b/client/me/site-blocks/list-item-placeholder.jsx @@ -1,4 +1,4 @@ -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; class SiteBlockListItemPlaceholder extends PureComponent { render() { diff --git a/client/me/site-blocks/list-item.jsx b/client/me/site-blocks/list-item.jsx index b7c365c5509aa4..eb52931b0e5e17 100644 --- a/client/me/site-blocks/list-item.jsx +++ b/client/me/site-blocks/list-item.jsx @@ -1,6 +1,6 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ExternalLink from 'calypso/components/external-link'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; diff --git a/client/me/site-blocks/main.jsx b/client/me/site-blocks/main.jsx index d399c07ee5251b..5e6472cc5b8dc1 100644 --- a/client/me/site-blocks/main.jsx +++ b/client/me/site-blocks/main.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { times } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import QuerySiteBlocks from 'calypso/components/data/query-site-blocks'; diff --git a/client/me/social-login/action-button.jsx b/client/me/social-login/action-button.jsx index 28ed93b4e3d18c..2c2ea467737cc3 100644 --- a/client/me/social-login/action-button.jsx +++ b/client/me/social-login/action-button.jsx @@ -1,7 +1,7 @@ import config from '@automattic/calypso-config'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FormButton from 'calypso/components/forms/form-button'; import AppleLoginButton from 'calypso/components/social-buttons/apple'; diff --git a/client/me/social-login/index.jsx b/client/me/social-login/index.jsx index c5e84aaeaf23b1..2e14a9ff8eb4ac 100644 --- a/client/me/social-login/index.jsx +++ b/client/me/social-login/index.jsx @@ -2,7 +2,7 @@ import config from '@automattic/calypso-config'; import { CompactCard } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import FormattedHeader from 'calypso/components/formatted-header'; diff --git a/client/me/social-login/service.jsx b/client/me/social-login/service.jsx index 91449a20813ce6..91d0d5c8f70d58 100644 --- a/client/me/social-login/service.jsx +++ b/client/me/social-login/service.jsx @@ -1,6 +1,5 @@ import { CompactCard } from '@automattic/components'; import { find, get } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import { getCurrentUser } from 'calypso/state/current-user/selectors'; import SocialLoginActionButton from './action-button'; diff --git a/client/me/two-step/index.jsx b/client/me/two-step/index.jsx index fd1159d44ac6f7..01b56774854dc3 100644 --- a/client/me/two-step/index.jsx +++ b/client/me/two-step/index.jsx @@ -2,7 +2,7 @@ import config from '@automattic/calypso-config'; import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import QueryUserSettings from 'calypso/components/data/query-user-settings'; diff --git a/client/my-sites/activity/activity-log-banner/error-banner.jsx b/client/my-sites/activity/activity-log-banner/error-banner.jsx index 76c263f2bface8..7c63e684699bc1 100644 --- a/client/my-sites/activity/activity-log-banner/error-banner.jsx +++ b/client/my-sites/activity/activity-log-banner/error-banner.jsx @@ -1,7 +1,7 @@ import { Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import HappychatButton from 'calypso/components/happychat/button'; import TrackComponentView from 'calypso/lib/analytics/track-component-view'; diff --git a/client/my-sites/activity/activity-log-banner/index.jsx b/client/my-sites/activity/activity-log-banner/index.jsx index 5dceb26d01fbe2..d1babeff73904f 100644 --- a/client/my-sites/activity/activity-log-banner/index.jsx +++ b/client/my-sites/activity/activity-log-banner/index.jsx @@ -1,7 +1,7 @@ import { Card, ScreenReaderText, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import './style.scss'; diff --git a/client/my-sites/activity/activity-log-banner/intro-banner.jsx b/client/my-sites/activity/activity-log-banner/intro-banner.jsx index 282c998be6c43a..9ddbde92ab8b26 100644 --- a/client/my-sites/activity/activity-log-banner/intro-banner.jsx +++ b/client/my-sites/activity/activity-log-banner/intro-banner.jsx @@ -7,7 +7,7 @@ import { import { Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import activityImage from 'calypso/assets/images/illustrations/site-activity.svg'; import DismissibleCard from 'calypso/blocks/dismissible-card'; diff --git a/client/my-sites/activity/activity-log-banner/progress-banner.jsx b/client/my-sites/activity/activity-log-banner/progress-banner.jsx index 3a5fc9084da22b..4c3b905be66351 100644 --- a/client/my-sites/activity/activity-log-banner/progress-banner.jsx +++ b/client/my-sites/activity/activity-log-banner/progress-banner.jsx @@ -1,7 +1,6 @@ import { ProgressBar } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import QueryRewindBackupStatus from 'calypso/components/data/query-rewind-backup-status'; import QueryRewindRestoreStatus from 'calypso/components/data/query-rewind-restore-status'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; diff --git a/client/my-sites/activity/activity-log-banner/success-banner.jsx b/client/my-sites/activity/activity-log-banner/success-banner.jsx index 7096bfb0387cb0..5d5161a4d32851 100644 --- a/client/my-sites/activity/activity-log-banner/success-banner.jsx +++ b/client/my-sites/activity/activity-log-banner/success-banner.jsx @@ -2,7 +2,7 @@ import { Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { flowRight as compose } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import HappychatButton from 'calypso/components/happychat/button'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; diff --git a/client/my-sites/activity/activity-log-banner/upgrade-banner.jsx b/client/my-sites/activity/activity-log-banner/upgrade-banner.jsx index 7c402398f3f14e..ddd81946f4b332 100644 --- a/client/my-sites/activity/activity-log-banner/upgrade-banner.jsx +++ b/client/my-sites/activity/activity-log-banner/upgrade-banner.jsx @@ -5,7 +5,7 @@ import { PLAN_PERSONAL, } from '@automattic/calypso-products'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import UpsellNudge from 'calypso/blocks/upsell-nudge'; import { PRODUCT_UPSELLS_BY_FEATURE } from 'calypso/my-sites/plans/jetpack-plans/constants'; diff --git a/client/my-sites/activity/activity-log-confirm-dialog/index.jsx b/client/my-sites/activity/activity-log-confirm-dialog/index.jsx index c6ab5688e9c30a..b8a51913c1609a 100644 --- a/client/my-sites/activity/activity-log-confirm-dialog/index.jsx +++ b/client/my-sites/activity/activity-log-confirm-dialog/index.jsx @@ -1,6 +1,5 @@ import { Button, Card, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import ExternalLink from 'calypso/components/external-link'; import FormCheckbox from 'calypso/components/forms/form-checkbox'; diff --git a/client/my-sites/activity/activity-log-example/index.jsx b/client/my-sites/activity/activity-log-example/index.jsx index 1de4cb3001b188..eb4af447e39e98 100644 --- a/client/my-sites/activity/activity-log-example/index.jsx +++ b/client/my-sites/activity/activity-log-example/index.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import FeatureExample from 'calypso/components/feature-example'; import FormattedHeader from 'calypso/components/formatted-header'; diff --git a/client/my-sites/activity/activity-log-item/activity-actor-icon.jsx b/client/my-sites/activity/activity-log-item/activity-actor-icon.jsx index 49b868a91ba1b2..8130737a1e705b 100644 --- a/client/my-sites/activity/activity-log-item/activity-actor-icon.jsx +++ b/client/my-sites/activity/activity-log-item/activity-actor-icon.jsx @@ -1,6 +1,6 @@ import { Gridicon } from '@automattic/components'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; export default class ActivityActorIcon extends PureComponent { static propTypes = { diff --git a/client/my-sites/activity/activity-log-item/activity-actor.jsx b/client/my-sites/activity/activity-log-item/activity-actor.jsx index b80ab788ad4a70..2ec948207e5295 100644 --- a/client/my-sites/activity/activity-log-item/activity-actor.jsx +++ b/client/my-sites/activity/activity-log-item/activity-actor.jsx @@ -1,6 +1,6 @@ import { translate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import Gravatar from 'calypso/components/gravatar'; import JetpackLogo from 'calypso/components/jetpack-logo'; import SocialLogo from 'calypso/components/social-logo'; diff --git a/client/my-sites/activity/activity-log-item/activity-description.jsx b/client/my-sites/activity/activity-log-item/activity-description.jsx index ea59f9a9e9d86d..ce2c28abee936c 100644 --- a/client/my-sites/activity/activity-log-item/activity-description.jsx +++ b/client/my-sites/activity/activity-log-item/activity-description.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import FormattedBlock from 'calypso/components/notes-formatted-block'; import { recordTracksEvent } from 'calypso/lib/analytics/tracks'; diff --git a/client/my-sites/activity/activity-log-item/activity-icon.jsx b/client/my-sites/activity/activity-log-item/activity-icon.jsx index 4a3371d26edeeb..edb0f532f224f5 100644 --- a/client/my-sites/activity/activity-log-item/activity-icon.jsx +++ b/client/my-sites/activity/activity-log-item/activity-icon.jsx @@ -1,7 +1,7 @@ import { Gridicon } from '@automattic/components'; import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; export default class ActivityIcon extends PureComponent { static propTypes = { diff --git a/client/my-sites/activity/activity-log-item/activity-media.jsx b/client/my-sites/activity/activity-log-item/activity-media.jsx index 8fed3e4558b9dd..18447867ff1035 100644 --- a/client/my-sites/activity/activity-log-item/activity-media.jsx +++ b/client/my-sites/activity/activity-log-item/activity-media.jsx @@ -1,6 +1,6 @@ import { Gridicon } from '@automattic/components'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; export default class ActivityMedia extends PureComponent { static propTypes = { diff --git a/client/my-sites/activity/activity-log-item/aggregated.jsx b/client/my-sites/activity/activity-log-item/aggregated.jsx index cd96a231608650..8968b97d376201 100644 --- a/client/my-sites/activity/activity-log-item/aggregated.jsx +++ b/client/my-sites/activity/activity-log-item/aggregated.jsx @@ -3,7 +3,7 @@ import { withDesktopBreakpoint } from '@automattic/viewport-react'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { omit, flowRight as compose } from 'lodash'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import FoldableCard from 'calypso/components/foldable-card'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; diff --git a/client/my-sites/activity/activity-log-item/index.jsx b/client/my-sites/activity/activity-log-item/index.jsx index 1597b3f04fe630..8c84e18e19f5be 100644 --- a/client/my-sites/activity/activity-log-item/index.jsx +++ b/client/my-sites/activity/activity-log-item/index.jsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { flowRight as compose } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Fragment, Component } from 'react'; import { connect } from 'react-redux'; import FoldableCard from 'calypso/components/foldable-card'; import HappychatButton from 'calypso/components/happychat/button'; @@ -345,7 +345,7 @@ class ActivityLogItem extends Component { const adjustedTime = applySiteOffset( moment( activityTs ), { timezone, gmtOffset } ); return ( - + { mightRewind && ( - - ); + + ); } } diff --git a/client/my-sites/activity/activity-log-switch/index.jsx b/client/my-sites/activity/activity-log-switch/index.jsx index 9ad1f06a57b6f5..0ed7f7894d8eb4 100644 --- a/client/my-sites/activity/activity-log-switch/index.jsx +++ b/client/my-sites/activity/activity-log-switch/index.jsx @@ -1,7 +1,7 @@ import { Card, Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import getRewindState from 'calypso/state/selectors/get-rewind-state'; import { getSiteUrl } from 'calypso/state/sites/selectors'; diff --git a/client/my-sites/activity/activity-log-tasklist/index.jsx b/client/my-sites/activity/activity-log-tasklist/index.jsx index 06a9d3689ab010..c41f394cba4f30 100644 --- a/client/my-sites/activity/activity-log-tasklist/index.jsx +++ b/client/my-sites/activity/activity-log-tasklist/index.jsx @@ -5,7 +5,7 @@ import { localize } from 'i18n-calypso'; import { isEmpty, get, includes, find } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import PopoverMenuItem from 'calypso/components/popover-menu/item'; import SplitButton from 'calypso/components/split-button'; diff --git a/client/my-sites/activity/activity-log-tasklist/to-update.jsx b/client/my-sites/activity/activity-log-tasklist/to-update.jsx index 0ac340b8cb66a2..d1fdaf260fc173 100644 --- a/client/my-sites/activity/activity-log-tasklist/to-update.jsx +++ b/client/my-sites/activity/activity-log-tasklist/to-update.jsx @@ -1,6 +1,6 @@ import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { requestSiteAlerts } from 'calypso/state/data-getters'; import { getPluginsWithUpdates } from 'calypso/state/plugins/installed/selectors'; diff --git a/client/my-sites/activity/activity-log-tasklist/update.jsx b/client/my-sites/activity/activity-log-tasklist/update.jsx index fc943195819be7..2b56cceb573186 100644 --- a/client/my-sites/activity/activity-log-tasklist/update.jsx +++ b/client/my-sites/activity/activity-log-tasklist/update.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import PopoverMenuItem from 'calypso/components/popover-menu/item'; import SplitButton from 'calypso/components/split-button'; import { decodeEntities } from 'calypso/lib/formatting'; diff --git a/client/my-sites/activity/activity-log/activity-log-rewind-toggle.jsx b/client/my-sites/activity/activity-log/activity-log-rewind-toggle.jsx index 6b6a301a5fb69c..f853a5345fe13d 100644 --- a/client/my-sites/activity/activity-log/activity-log-rewind-toggle.jsx +++ b/client/my-sites/activity/activity-log/activity-log-rewind-toggle.jsx @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { activateRewind } from 'calypso/state/activity-log/actions'; import { recordTracksEvent, withAnalytics } from 'calypso/state/analytics/actions'; diff --git a/client/my-sites/activity/activity-log/index.jsx b/client/my-sites/activity/activity-log/index.jsx index 16678efb447fef..a302008359d110 100644 --- a/client/my-sites/activity/activity-log/index.jsx +++ b/client/my-sites/activity/activity-log/index.jsx @@ -6,7 +6,7 @@ import { isMobile } from '@automattic/viewport'; import { localize } from 'i18n-calypso'; import { find, get, isEmpty, isEqual } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import TimeMismatchWarning from 'calypso/blocks/time-mismatch-warning'; import VisibleDaysLimitUpsell from 'calypso/components/activity-card-list/visible-days-limit-upsell'; diff --git a/client/my-sites/activity/activity-log/rewind-alerts.jsx b/client/my-sites/activity/activity-log/rewind-alerts.jsx index 0747f4724c4e65..0361188657bc4c 100644 --- a/client/my-sites/activity/activity-log/rewind-alerts.jsx +++ b/client/my-sites/activity/activity-log/rewind-alerts.jsx @@ -1,6 +1,6 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import getSiteThreats from 'calypso/state/selectors/get-site-threats'; import ThreatAlert from './threat-alert'; diff --git a/client/my-sites/activity/activity-log/rewind-unavailability-notice.jsx b/client/my-sites/activity/activity-log/rewind-unavailability-notice.jsx index 22fcd98dce1441..f3340da14ba52a 100644 --- a/client/my-sites/activity/activity-log/rewind-unavailability-notice.jsx +++ b/client/my-sites/activity/activity-log/rewind-unavailability-notice.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import Banner from 'calypso/components/banner'; import getRewindState from 'calypso/state/selectors/get-rewind-state'; diff --git a/client/my-sites/activity/activity-log/threat-alert.jsx b/client/my-sites/activity/activity-log/threat-alert.jsx index 06811bb95bb493..cc2900d1c40d05 100644 --- a/client/my-sites/activity/activity-log/threat-alert.jsx +++ b/client/my-sites/activity/activity-log/threat-alert.jsx @@ -1,7 +1,7 @@ import { Button, Card } from '@automattic/components'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import DiffViewer from 'calypso/components/diff-viewer'; import FoldableCard from 'calypso/components/foldable-card'; diff --git a/client/my-sites/activity/controller.jsx b/client/my-sites/activity/controller.jsx index 0bb25f6d8fdcd9..132dc4ad13df7a 100644 --- a/client/my-sites/activity/controller.jsx +++ b/client/my-sites/activity/controller.jsx @@ -1,6 +1,5 @@ import config from '@automattic/calypso-config'; import { isEqual } from 'lodash'; -import React from 'react'; import IsCurrentUserAdminSwitch from 'calypso/components/jetpack/is-current-user-admin-switch'; import NotAuthorizedPage from 'calypso/components/jetpack/not-authorized-page'; import ActivityLog from 'calypso/my-sites/activity/activity-log'; diff --git a/client/my-sites/activity/filterbar/action-type-selector.jsx b/client/my-sites/activity/filterbar/action-type-selector.jsx index e92ff51356a264..74a22d687a2625 100644 --- a/client/my-sites/activity/filterbar/action-type-selector.jsx +++ b/client/my-sites/activity/filterbar/action-type-selector.jsx @@ -3,7 +3,7 @@ import { isWithinBreakpoint } from '@automattic/viewport'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import { concat, without, isEmpty, find } from 'lodash'; -import React, { Component, Fragment } from 'react'; +import { createRef, Component, Fragment } from 'react'; import { connect } from 'react-redux'; import FormCheckbox from 'calypso/components/forms/form-checkbox'; import FormLabel from 'calypso/components/forms/form-label'; @@ -20,7 +20,7 @@ export class ActionTypeSelector extends Component { constructor( props ) { super( props ); - this.activityTypeButton = React.createRef(); + this.activityTypeButton = createRef(); } resetActivityTypeSelector = ( event ) => { diff --git a/client/my-sites/activity/filterbar/date-range-selector.jsx b/client/my-sites/activity/filterbar/date-range-selector.jsx index b04876f79e26e1..9284b5e77ad2a3 100644 --- a/client/my-sites/activity/filterbar/date-range-selector.jsx +++ b/client/my-sites/activity/filterbar/date-range-selector.jsx @@ -2,7 +2,7 @@ import { Button, Gridicon } from '@automattic/components'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import { isEmpty, flowRight as compose } from 'lodash'; -import React, { Component, Fragment } from 'react'; +import { createRef, Component, Fragment } from 'react'; import { DateUtils } from 'react-day-picker'; import { connect } from 'react-redux'; import DateRangePicker from 'calypso/components/date-range'; @@ -21,7 +21,7 @@ export class DateRangeSelector extends Component { constructor( props ) { super( props ); - this.dateRangeButton = React.createRef(); + this.dateRangeButton = createRef(); } handleClose = () => { diff --git a/client/my-sites/activity/filterbar/index.jsx b/client/my-sites/activity/filterbar/index.jsx index c33a7793d7bcc2..ad0f309f90ee55 100644 --- a/client/my-sites/activity/filterbar/index.jsx +++ b/client/my-sites/activity/filterbar/index.jsx @@ -2,7 +2,7 @@ import { Button, Gridicon } from '@automattic/components'; import { isWithinBreakpoint } from '@automattic/viewport'; import { localize } from 'i18n-calypso'; import page from 'page'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import BackButton from 'calypso/components/back-button'; import { updateFilter } from 'calypso/state/activity-log/actions'; diff --git a/client/my-sites/backup/backup-date-picker/test/index.jsx b/client/my-sites/backup/backup-date-picker/test/index.jsx index a3cbdf16c74d5c..58673a4fcc653f 100644 --- a/client/my-sites/backup/backup-date-picker/test/index.jsx +++ b/client/my-sites/backup/backup-date-picker/test/index.jsx @@ -33,7 +33,6 @@ import { isEnabled } from '@automattic/calypso-config'; import { shallow } from 'enzyme'; import { useTranslate } from 'i18n-calypso'; import moment from 'moment'; -import React from 'react'; import { useSelector, useDispatch } from 'react-redux'; import BackupDatePicker from '..'; import { useCanGoToDate } from '../hooks'; diff --git a/client/my-sites/backup/controller.js b/client/my-sites/backup/controller.js index 0bc2a3578d45da..429c4f46c2f474 100644 --- a/client/my-sites/backup/controller.js +++ b/client/my-sites/backup/controller.js @@ -1,6 +1,5 @@ import { isJetpackBackupSlug, JETPACK_BACKUP_PRODUCTS } from '@automattic/calypso-products'; import Debug from 'debug'; -import React from 'react'; import QueryRewindState from 'calypso/components/data/query-rewind-state'; import FormattedHeader from 'calypso/components/formatted-header'; import BackupPlaceholder from 'calypso/components/jetpack/backup-placeholder'; diff --git a/client/my-sites/backup/main.jsx b/client/my-sites/backup/main.jsx index ed5b2fe2b20127..2cd332e95f9207 100644 --- a/client/my-sites/backup/main.jsx +++ b/client/my-sites/backup/main.jsx @@ -2,7 +2,6 @@ import { isEnabled } from '@automattic/calypso-config'; import classNames from 'classnames'; import { useTranslate } from 'i18n-calypso'; import page from 'page'; -import React from 'react'; import { useSelector } from 'react-redux'; import TimeMismatchWarning from 'calypso/blocks/time-mismatch-warning'; import BackupStorageSpace from 'calypso/components/backup-storage-space'; diff --git a/client/my-sites/backup/search-results.jsx b/client/my-sites/backup/search-results.jsx index 7d4979db2fce1b..9a2e6af5527bef 100644 --- a/client/my-sites/backup/search-results.jsx +++ b/client/my-sites/backup/search-results.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { useSelector } from 'react-redux'; import ActivityCardList from 'calypso/components/activity-card-list'; import getActivityLogFilter from 'calypso/state/selectors/get-activity-log-filter'; diff --git a/client/my-sites/backup/status/index.jsx b/client/my-sites/backup/status/index.jsx index 9a0b0dec372197..ca5436df2fbd10 100644 --- a/client/my-sites/backup/status/index.jsx +++ b/client/my-sites/backup/status/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { useSelector } from 'react-redux'; import BackupDelta from 'calypso/components/jetpack/backup-delta'; import BackupPlaceholder from 'calypso/components/jetpack/backup-placeholder'; diff --git a/client/my-sites/backup/status/simplified-i4.jsx b/client/my-sites/backup/status/simplified-i4.jsx index 0203c8d1a36e17..264d6dc024986f 100644 --- a/client/my-sites/backup/status/simplified-i4.jsx +++ b/client/my-sites/backup/status/simplified-i4.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { useSelector } from 'react-redux'; import BackupCard from 'calypso/components/jetpack/backup-card'; import BackupPlaceholder from 'calypso/components/jetpack/backup-placeholder'; diff --git a/client/my-sites/beta-testing/controller.js b/client/my-sites/beta-testing/controller.js index 56e9957c5d450e..3635fd9eb4de29 100644 --- a/client/my-sites/beta-testing/controller.js +++ b/client/my-sites/beta-testing/controller.js @@ -1,4 +1,3 @@ -import React from 'react'; import BetaTesting from 'calypso/my-sites/beta-testing/main'; export const betaTesting = ( context, next ) => { diff --git a/client/my-sites/beta-testing/main.jsx b/client/my-sites/beta-testing/main.jsx index cb49fa3c5a1b2d..2a8f9e2943ff55 100644 --- a/client/my-sites/beta-testing/main.jsx +++ b/client/my-sites/beta-testing/main.jsx @@ -1,6 +1,6 @@ import { Button, Gridicon } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { connect } from 'react-redux'; import FollowButtonContainer from 'calypso/blocks/follow-button'; import CardHeading from 'calypso/components/card-heading'; diff --git a/client/my-sites/checkout/cart/cart-body/index.jsx b/client/my-sites/checkout/cart/cart-body/index.jsx index f5c594d745f17f..409ddbe38423e6 100644 --- a/client/my-sites/checkout/cart/cart-body/index.jsx +++ b/client/my-sites/checkout/cart/cart-body/index.jsx @@ -1,9 +1,9 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import { forwardRef } from 'react'; import CartItems from 'calypso/my-sites/checkout/cart/cart-items'; import CartTotal from 'calypso/my-sites/checkout/cart/cart-total'; -const CartBody = React.forwardRef( ( props, ref ) => { +const CartBody = forwardRef( ( props, ref ) => { const { cart, selectedSite, collapse = false } = props; return ( diff --git a/client/my-sites/checkout/cart/cart-body/loading-placeholder.jsx b/client/my-sites/checkout/cart/cart-body/loading-placeholder.jsx index fa754a691f8b32..c2fe41b4fdfa01 100644 --- a/client/my-sites/checkout/cart/cart-body/loading-placeholder.jsx +++ b/client/my-sites/checkout/cart/cart-body/loading-placeholder.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import CartItemLoadingPlaceholder from 'calypso/my-sites/checkout/cart/cart-item/loading-placeholder'; const CartBodyLoadingPlaceholder = () => ( diff --git a/client/my-sites/checkout/cart/cart-buttons.jsx b/client/my-sites/checkout/cart/cart-buttons.jsx index 78b3d01e1df08c..2d43569ed644a4 100644 --- a/client/my-sites/checkout/cart/cart-buttons.jsx +++ b/client/my-sites/checkout/cart/cart-buttons.jsx @@ -2,11 +2,11 @@ import { Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import { recordGoogleEvent } from 'calypso/state/analytics/actions'; -export class CartButtons extends React.Component { +export class CartButtons extends Component { static propTypes = { selectedSite: PropTypes.oneOfType( [ PropTypes.object, PropTypes.bool ] ).isRequired, translate: PropTypes.func.isRequired, diff --git a/client/my-sites/checkout/cart/cart-empty.jsx b/client/my-sites/checkout/cart/cart-empty.jsx index b5be756b3a8b07..544016d52919c0 100644 --- a/client/my-sites/checkout/cart/cart-empty.jsx +++ b/client/my-sites/checkout/cart/cart-empty.jsx @@ -1,9 +1,9 @@ import { localize } from 'i18n-calypso'; import { startsWith } from 'lodash'; import page from 'page'; -import React from 'react'; +import { Component } from 'react'; -class CartEmpty extends React.Component { +class CartEmpty extends Component { render() { return (
diff --git a/client/my-sites/checkout/cart/cart-free-user-plan-upsell.jsx b/client/my-sites/checkout/cart/cart-free-user-plan-upsell.jsx index d46957d17e47d6..31762c4683c5dd 100644 --- a/client/my-sites/checkout/cart/cart-free-user-plan-upsell.jsx +++ b/client/my-sites/checkout/cart/cart-free-user-plan-upsell.jsx @@ -9,7 +9,7 @@ import formatCurrency from '@automattic/format-currency'; import { localize } from 'i18n-calypso'; import { find } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import SectionHeader from 'calypso/components/section-header'; import TrackComponentView from 'calypso/lib/analytics/track-component-view'; @@ -29,7 +29,7 @@ import { isRequestingSitePlans } from 'calypso/state/sites/plans/selectors'; import { getSelectedSite } from 'calypso/state/ui/selectors'; import { getAllCartItems } from '../../../lib/cart-values/cart-items'; -class CartFreeUserPlanUpsell extends React.Component { +class CartFreeUserPlanUpsell extends Component { static propTypes = { cart: PropTypes.object, isCartPendingUpdate: PropTypes.bool.isRequired, diff --git a/client/my-sites/checkout/cart/cart-item.jsx b/client/my-sites/checkout/cart/cart-item.jsx index 1e9fb5bdb7cb55..7d76cede50cf25 100644 --- a/client/my-sites/checkout/cart/cart-item.jsx +++ b/client/my-sites/checkout/cart/cart-item.jsx @@ -16,7 +16,7 @@ import { getCurrencyObject } from '@automattic/format-currency'; import { withShoppingCart } from '@automattic/shopping-cart'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; -import React from 'react'; +import { Component } from 'react'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; import { gaRecordEvent } from 'calypso/lib/analytics/ga'; import { canRemoveFromCart } from 'calypso/lib/cart-values'; @@ -28,7 +28,7 @@ import { } from 'calypso/lib/gsuite/constants'; import withCartKey from 'calypso/my-sites/checkout/with-cart-key'; -export class CartItem extends React.Component { +export class CartItem extends Component { removeFromCart = ( event ) => { event.preventDefault(); gaRecordEvent( diff --git a/client/my-sites/checkout/cart/cart-item/loading-placeholder.jsx b/client/my-sites/checkout/cart/cart-item/loading-placeholder.jsx index 7e6c9535a79aff..f8589a4af51de7 100644 --- a/client/my-sites/checkout/cart/cart-item/loading-placeholder.jsx +++ b/client/my-sites/checkout/cart/cart-item/loading-placeholder.jsx @@ -1,5 +1,4 @@ import { Button } from '@automattic/components'; -import React from 'react'; const CartItemLoadingPlaceholder = () => (
diff --git a/client/my-sites/checkout/cart/cart-items.jsx b/client/my-sites/checkout/cart/cart-items.jsx index 1f5b0fd6bfc9e8..61eee669e003e9 100644 --- a/client/my-sites/checkout/cart/cart-items.jsx +++ b/client/my-sites/checkout/cart/cart-items.jsx @@ -1,12 +1,12 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { getAllCartItems } from 'calypso/lib/cart-values/cart-items'; import CartItem from './cart-item'; const COLLAPSED_ITEMS_COUNT = 2; -export class CartItems extends React.Component { +export class CartItems extends Component { static propTypes = { collapse: PropTypes.bool.isRequired, }; diff --git a/client/my-sites/checkout/cart/cart-total.jsx b/client/my-sites/checkout/cart/cart-total.jsx index 0b5ef78525513f..918179a1a878be 100644 --- a/client/my-sites/checkout/cart/cart-total.jsx +++ b/client/my-sites/checkout/cart/cart-total.jsx @@ -1,9 +1,9 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { shouldShowTax } from 'calypso/lib/cart-values'; -class CartTotal extends React.Component { +class CartTotal extends Component { static propTypes = { cart: PropTypes.shape( { tax: PropTypes.shape( { diff --git a/client/my-sites/checkout/cart/header-cart.jsx b/client/my-sites/checkout/cart/header-cart.jsx index 328513d216eeea..f000a5a27a6d72 100644 --- a/client/my-sites/checkout/cart/header-cart.jsx +++ b/client/my-sites/checkout/cart/header-cart.jsx @@ -1,11 +1,11 @@ import { withShoppingCart } from '@automattic/shopping-cart'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { getAllCartItems } from 'calypso/lib/cart-values/cart-items'; import withCartKey from 'calypso/my-sites/checkout/with-cart-key'; import PopoverCart from './popover-cart'; -class HeaderCart extends React.Component { +class HeaderCart extends Component { static propTypes = { cart: PropTypes.object.isRequired, selectedSite: PropTypes.object.isRequired, diff --git a/client/my-sites/checkout/cart/popover-cart.jsx b/client/my-sites/checkout/cart/popover-cart.jsx index c7e5622a54e170..5d941d4c2b137c 100644 --- a/client/my-sites/checkout/cart/popover-cart.jsx +++ b/client/my-sites/checkout/cart/popover-cart.jsx @@ -7,7 +7,7 @@ import classNames from 'classnames'; import { localize, translate } from 'i18n-calypso'; import { reject } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { createRef, Component } from 'react'; import Count from 'calypso/components/count'; import HeaderButton from 'calypso/components/header-button'; import TrackComponentView from 'calypso/lib/analytics/track-component-view'; @@ -19,7 +19,7 @@ import CartEmpty from './cart-empty'; import './style.scss'; -class PopoverCart extends React.Component { +class PopoverCart extends Component { static propTypes = { cart: PropTypes.object.isRequired, shoppingCartManager: PropTypes.object.isRequired, @@ -34,7 +34,7 @@ class PopoverCart extends React.Component { compact: false, }; - toggleButtonRef = React.createRef(); + toggleButtonRef = createRef(); hasUnmounted = false; componentWillUnmount() { diff --git a/client/my-sites/checkout/cart/test/cart-buttons.js b/client/my-sites/checkout/cart/test/cart-buttons.js index db20997e5d52c2..86f927973a456f 100644 --- a/client/my-sites/checkout/cart/test/cart-buttons.js +++ b/client/my-sites/checkout/cart/test/cart-buttons.js @@ -4,7 +4,6 @@ import { mount } from 'enzyme'; import page from 'page'; -import React from 'react'; import { CartButtons } from '../cart-buttons'; jest.mock( 'page', () => jest.fn() ); diff --git a/client/my-sites/checkout/cart/test/cart-item.js b/client/my-sites/checkout/cart/test/cart-item.js index a4e0887db469d2..b20e9265cbf868 100644 --- a/client/my-sites/checkout/cart/test/cart-item.js +++ b/client/my-sites/checkout/cart/test/cart-item.js @@ -14,7 +14,6 @@ import { getBillingMonthsForPlan, } from '@automattic/calypso-products'; import { shallow } from 'enzyme'; -import React from 'react'; import { CartItem } from '../cart-item'; jest.mock( '@automattic/calypso-config', () => { diff --git a/client/my-sites/checkout/checkout-system-decider.js b/client/my-sites/checkout/checkout-system-decider.js index b11609aa0d8094..94d0eb55d41898 100644 --- a/client/my-sites/checkout/checkout-system-decider.js +++ b/client/my-sites/checkout/checkout-system-decider.js @@ -2,7 +2,7 @@ import config from '@automattic/calypso-config'; import { StripeHookProvider } from '@automattic/calypso-stripe'; import { CheckoutErrorBoundary } from '@automattic/composite-checkout'; import { useTranslate } from 'i18n-calypso'; -import React, { useEffect, useCallback } from 'react'; +import { useEffect, useCallback } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import wp from 'calypso/lib/wp'; import Recaptcha from 'calypso/signup/recaptcha'; diff --git a/client/my-sites/checkout/checkout-thank-you/atomic-store-thank-you-card.jsx b/client/my-sites/checkout/checkout-thank-you/atomic-store-thank-you-card.jsx index 766cb4a824b4a4..1fce2e2e8f1957 100644 --- a/client/my-sites/checkout/checkout-thank-you/atomic-store-thank-you-card.jsx +++ b/client/my-sites/checkout/checkout-thank-you/atomic-store-thank-you-card.jsx @@ -2,7 +2,7 @@ import { getPlanClass } from '@automattic/calypso-products'; import { Button } from '@automattic/components'; import classNames from 'classnames'; import { localize } from 'i18n-calypso'; -import React, { Component, Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { connect } from 'react-redux'; import PlanThankYouCard from 'calypso/blocks/plan-thank-you-card'; import { Interval, EVERY_FIVE_SECONDS } from 'calypso/lib/interval'; diff --git a/client/my-sites/checkout/checkout-thank-you/blogger-plan-details.jsx b/client/my-sites/checkout/checkout-thank-you/blogger-plan-details.jsx index 8fbcc163704b8f..ff38d5e0b323b1 100644 --- a/client/my-sites/checkout/checkout-thank-you/blogger-plan-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/blogger-plan-details.jsx @@ -2,7 +2,6 @@ import { isBlogger, isGSuiteOrExtraLicenseOrGoogleWorkspace } from '@automattic/ import { localize } from 'i18n-calypso'; import { find } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import CustomDomainPurchaseDetail from './custom-domain-purchase-detail'; import GoogleAppsDetails from './google-apps-details'; diff --git a/client/my-sites/checkout/checkout-thank-you/business-plan-details.jsx b/client/my-sites/checkout/checkout-thank-you/business-plan-details.jsx index a9455db2927e95..6615e0366184ce 100644 --- a/client/my-sites/checkout/checkout-thank-you/business-plan-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/business-plan-details.jsx @@ -2,7 +2,6 @@ import { isBusiness, isGSuiteOrExtraLicenseOrGoogleWorkspace } from '@automattic import i18n from 'i18n-calypso'; import { find } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect, useSelector } from 'react-redux'; import earnImage from 'calypso/assets/images/customer-home/illustration--task-earn.svg'; import analyticsImage from 'calypso/assets/images/illustrations/google-analytics.svg'; diff --git a/client/my-sites/checkout/checkout-thank-you/chargeback-details.jsx b/client/my-sites/checkout/checkout-thank-you/chargeback-details.jsx index f0eb85613d4f62..ea7fafb443f15f 100644 --- a/client/my-sites/checkout/checkout-thank-you/chargeback-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/chargeback-details.jsx @@ -1,6 +1,5 @@ import i18n from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import PurchaseDetail from 'calypso/components/purchase-detail'; import { newPost } from 'calypso/lib/paths'; diff --git a/client/my-sites/checkout/checkout-thank-you/custom-domain-purchase-detail.jsx b/client/my-sites/checkout/checkout-thank-you/custom-domain-purchase-detail.jsx index 652863b172ba33..ce9f5bb442c449 100644 --- a/client/my-sites/checkout/checkout-thank-you/custom-domain-purchase-detail.jsx +++ b/client/my-sites/checkout/checkout-thank-you/custom-domain-purchase-detail.jsx @@ -1,6 +1,5 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import customDomainBloggerImage from 'calypso/assets/images/illustrations/custom-domain-blogger.svg'; import customDomainImage from 'calypso/assets/images/illustrations/custom-domain.svg'; diff --git a/client/my-sites/checkout/checkout-thank-you/domain-mapping-details.jsx b/client/my-sites/checkout/checkout-thank-you/domain-mapping-details.jsx index 4da1b75bc73107..158ac98f6fa512 100644 --- a/client/my-sites/checkout/checkout-thank-you/domain-mapping-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/domain-mapping-details.jsx @@ -1,6 +1,5 @@ import { isBusiness } from '@automattic/calypso-products'; import { localize } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import QuerySiteDomains from 'calypso/components/data/query-site-domains'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/my-sites/checkout/checkout-thank-you/domain-registration-details.jsx b/client/my-sites/checkout/checkout-thank-you/domain-registration-details.jsx index dfa6cc9409406a..00a92a65df02a8 100644 --- a/client/my-sites/checkout/checkout-thank-you/domain-registration-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/domain-registration-details.jsx @@ -7,7 +7,6 @@ import { } from '@automattic/calypso-products'; import i18n from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import PurchaseDetail from 'calypso/components/purchase-detail'; import TrackComponentView from 'calypso/lib/analytics/track-component-view'; diff --git a/client/my-sites/checkout/checkout-thank-you/ecommerce-plan-details.jsx b/client/my-sites/checkout/checkout-thank-you/ecommerce-plan-details.jsx index a9e53a9a3ee2d0..14cf2018d2e063 100644 --- a/client/my-sites/checkout/checkout-thank-you/ecommerce-plan-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/ecommerce-plan-details.jsx @@ -2,7 +2,6 @@ import { isEcommerce, isGSuiteOrExtraLicenseOrGoogleWorkspace } from '@automatti import i18n from 'i18n-calypso'; import { find } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import analyticsImage from 'calypso/assets/images/illustrations/google-analytics.svg'; import conciergeImage from 'calypso/assets/images/illustrations/jetpack-concierge.svg'; import updatesImage from 'calypso/assets/images/illustrations/updates.svg'; diff --git a/client/my-sites/checkout/checkout-thank-you/failed-purchase-details.jsx b/client/my-sites/checkout/checkout-thank-you/failed-purchase-details.jsx index 2f87cc16616858..181603d0fc6fdd 100644 --- a/client/my-sites/checkout/checkout-thank-you/failed-purchase-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/failed-purchase-details.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import PurchaseDetail from 'calypso/components/purchase-detail'; import { CALYPSO_CONTACT } from 'calypso/lib/url/support'; diff --git a/client/my-sites/checkout/checkout-thank-you/features-header.jsx b/client/my-sites/checkout/checkout-thank-you/features-header.jsx index 4baecc667f05a2..470a922b778f80 100644 --- a/client/my-sites/checkout/checkout-thank-you/features-header.jsx +++ b/client/my-sites/checkout/checkout-thank-you/features-header.jsx @@ -9,7 +9,6 @@ import { import classNames from 'classnames'; import i18n from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; const FeaturesHeader = ( { isDataLoaded, isGenericReceipt, purchases, hasFailedPurchases } ) => { const classes = classNames( 'checkout-thank-you__features-header', { diff --git a/client/my-sites/checkout/checkout-thank-you/google-apps-details.jsx b/client/my-sites/checkout/checkout-thank-you/google-apps-details.jsx index 9c18ac55f7bdbe..e662f532ba8a67 100644 --- a/client/my-sites/checkout/checkout-thank-you/google-apps-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/google-apps-details.jsx @@ -1,6 +1,5 @@ import { isGSuiteOrExtraLicenseOrGoogleWorkspace } from '@automattic/calypso-products'; import i18n from 'i18n-calypso'; -import React from 'react'; import { useSelector } from 'react-redux'; import PurchaseDetail from 'calypso/components/purchase-detail'; import { getGoogleMailServiceFamily, isGSuiteExtraLicenseProductSlug } from 'calypso/lib/gsuite'; diff --git a/client/my-sites/checkout/checkout-thank-you/guided-transfer-details.jsx b/client/my-sites/checkout/checkout-thank-you/guided-transfer-details.jsx index 46adef31ea7097..cea58cc4bbe438 100644 --- a/client/my-sites/checkout/checkout-thank-you/guided-transfer-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/guided-transfer-details.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import PurchaseDetail from 'calypso/components/purchase-detail'; import { GUIDED_TRANSFER } from 'calypso/lib/url/support'; diff --git a/client/my-sites/checkout/checkout-thank-you/header.jsx b/client/my-sites/checkout/checkout-thank-you/header.jsx index 9f9c662bfedfba..7982698cc4d0ef 100644 --- a/client/my-sites/checkout/checkout-thank-you/header.jsx +++ b/client/my-sites/checkout/checkout-thank-you/header.jsx @@ -15,7 +15,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import { preventWidows } from 'calypso/lib/formatting'; import { diff --git a/client/my-sites/checkout/checkout-thank-you/index.jsx b/client/my-sites/checkout/checkout-thank-you/index.jsx index 9d677bde8b239b..801970fdb65b60 100644 --- a/client/my-sites/checkout/checkout-thank-you/index.jsx +++ b/client/my-sites/checkout/checkout-thank-you/index.jsx @@ -29,7 +29,7 @@ import { localize } from 'i18n-calypso'; import { find, get } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import PlanThankYouCard from 'calypso/blocks/plan-thank-you-card'; import AsyncLoad from 'calypso/components/async-load'; @@ -110,7 +110,7 @@ function findPurchaseAndDomain( purchases, predicate ) { return [ purchase, purchase.meta ]; } -export class CheckoutThankYou extends React.Component { +export class CheckoutThankYou extends Component { static propTypes = { domainOnlySiteFlow: PropTypes.bool.isRequired, failedPurchases: PropTypes.array, diff --git a/client/my-sites/checkout/checkout-thank-you/jetpack-plan-details.jsx b/client/my-sites/checkout/checkout-thank-you/jetpack-plan-details.jsx index ed426149f31fba..2b1fc4c7d87425 100644 --- a/client/my-sites/checkout/checkout-thank-you/jetpack-plan-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/jetpack-plan-details.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import PurchaseDetail from 'calypso/components/purchase-detail'; import { localizeUrl } from 'calypso/lib/i18n-utils'; diff --git a/client/my-sites/checkout/checkout-thank-you/pending.jsx b/client/my-sites/checkout/checkout-thank-you/pending.jsx index 2009788ebcfd31..2424f149af7bb5 100644 --- a/client/my-sites/checkout/checkout-thank-you/pending.jsx +++ b/client/my-sites/checkout/checkout-thank-you/pending.jsx @@ -1,7 +1,7 @@ import { localize } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import QueryOrderTransaction from 'calypso/components/data/query-order-transaction'; import EmptyContent from 'calypso/components/empty-content'; diff --git a/client/my-sites/checkout/checkout-thank-you/personal-plan-details.jsx b/client/my-sites/checkout/checkout-thank-you/personal-plan-details.jsx index ff1a4ac9089f66..a4ccac24ae1ea2 100644 --- a/client/my-sites/checkout/checkout-thank-you/personal-plan-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/personal-plan-details.jsx @@ -2,7 +2,6 @@ import { isPersonal, isGSuiteOrExtraLicenseOrGoogleWorkspace } from '@automattic import { localize } from 'i18n-calypso'; import { find } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import earnImage from 'calypso/assets/images/customer-home/illustration--task-earn.svg'; import adsRemovedImage from 'calypso/assets/images/illustrations/removed-ads.svg'; import PurchaseDetail from 'calypso/components/purchase-detail'; diff --git a/client/my-sites/checkout/checkout-thank-you/premium-plan-details.jsx b/client/my-sites/checkout/checkout-thank-you/premium-plan-details.jsx index 6540c8d0cde6ef..6691651b5886d9 100644 --- a/client/my-sites/checkout/checkout-thank-you/premium-plan-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/premium-plan-details.jsx @@ -2,7 +2,6 @@ import { isPremium, isGSuiteOrExtraLicenseOrGoogleWorkspace } from '@automattic/ import { useTranslate } from 'i18n-calypso'; import { find } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import earnImage from 'calypso/assets/images/customer-home/illustration--task-earn.svg'; import analyticsImage from 'calypso/assets/images/illustrations/google-analytics.svg'; import customizeThemeImage from 'calypso/assets/images/upgrades/customize-theme.svg'; diff --git a/client/my-sites/checkout/checkout-thank-you/rebrand-cities-thank-you.jsx b/client/my-sites/checkout/checkout-thank-you/rebrand-cities-thank-you.jsx index 8735db23027929..3ab20047862587 100644 --- a/client/my-sites/checkout/checkout-thank-you/rebrand-cities-thank-you.jsx +++ b/client/my-sites/checkout/checkout-thank-you/rebrand-cities-thank-you.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import { get } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import ThankYouCard from 'calypso/components/thank-you-card'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; diff --git a/client/my-sites/checkout/checkout-thank-you/site-redirect-details.jsx b/client/my-sites/checkout/checkout-thank-you/site-redirect-details.jsx index f8053abe1895ce..dbe7114a7bc686 100644 --- a/client/my-sites/checkout/checkout-thank-you/site-redirect-details.jsx +++ b/client/my-sites/checkout/checkout-thank-you/site-redirect-details.jsx @@ -1,6 +1,5 @@ import i18n from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import PurchaseDetail from 'calypso/components/purchase-detail'; import { getDomainManagementUrl } from './utils'; diff --git a/client/my-sites/checkout/checkout-thank-you/test/header.js b/client/my-sites/checkout/checkout-thank-you/test/header.js index 27cfc66c3b43ee..50b9f9a3a8b17a 100644 --- a/client/my-sites/checkout/checkout-thank-you/test/header.js +++ b/client/my-sites/checkout/checkout-thank-you/test/header.js @@ -1,5 +1,4 @@ import { shallow } from 'enzyme'; -import React from 'react'; import { CheckoutThankYouHeader } from '../header'; jest.unmock( '@automattic/calypso-products' ); diff --git a/client/my-sites/checkout/checkout-thank-you/test/index.js b/client/my-sites/checkout/checkout-thank-you/test/index.js index 75d79d850874d5..6a9987ec1a2c2b 100644 --- a/client/my-sites/checkout/checkout-thank-you/test/index.js +++ b/client/my-sites/checkout/checkout-thank-you/test/index.js @@ -21,7 +21,6 @@ import { isDIFMProduct, } from '@automattic/calypso-products'; import { shallow } from 'enzyme'; -import React from 'react'; import { isRebrandCitiesSiteUrl } from 'calypso/lib/rebrand-cities'; import DIFMLiteThankYou from 'calypso/my-sites/checkout/checkout-thank-you/difm/difm-lite-thank-you'; import { CheckoutThankYou } from '../index'; diff --git a/client/my-sites/checkout/checkout/country-specific-payment-fields.jsx b/client/my-sites/checkout/checkout/country-specific-payment-fields.jsx index d633df662176fe..81f692b5672a73 100644 --- a/client/my-sites/checkout/checkout/country-specific-payment-fields.jsx +++ b/client/my-sites/checkout/checkout/country-specific-payment-fields.jsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { find, isEmpty, includes, get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { createElement, Component } from 'react'; import FormPhoneMediaInput from 'calypso/components/forms/form-phone-media-input'; import InfoPopover from 'calypso/components/info-popover'; import { paymentMethodName } from 'calypso/lib/cart-values'; @@ -67,7 +67,7 @@ export class CountrySpecificPaymentFields extends Component { ); return includes( this.state.fields, fieldName ) - ? React.createElement( componentClass, fieldProps ) + ? createElement( componentClass, fieldProps ) : null; }; diff --git a/client/my-sites/checkout/checkout/notice-error-message.jsx b/client/my-sites/checkout/checkout/notice-error-message.jsx index 5b6fa710a9a069..f2c533d3752ed8 100644 --- a/client/my-sites/checkout/checkout/notice-error-message.jsx +++ b/client/my-sites/checkout/checkout/notice-error-message.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; const NoticeErrorMessage = ( { message } ) => { message }; diff --git a/client/my-sites/checkout/checkout/test/country-specific-payment-fields.js b/client/my-sites/checkout/checkout/test/country-specific-payment-fields.js index f2c019ed7dbeed..39e1c36f63aa91 100644 --- a/client/my-sites/checkout/checkout/test/country-specific-payment-fields.js +++ b/client/my-sites/checkout/checkout/test/country-specific-payment-fields.js @@ -3,7 +3,6 @@ */ import { shallow } from 'enzyme'; -import React from 'react'; import { CountrySpecificPaymentFields } from '../country-specific-payment-fields'; const defaultProps = { diff --git a/client/my-sites/checkout/composite-checkout/components/bundled-domain-notice.jsx b/client/my-sites/checkout/composite-checkout/components/bundled-domain-notice.jsx index 998f328bbb26d0..7ccb7257cd0e9a 100644 --- a/client/my-sites/checkout/composite-checkout/components/bundled-domain-notice.jsx +++ b/client/my-sites/checkout/composite-checkout/components/bundled-domain-notice.jsx @@ -1,7 +1,6 @@ import { isMonthly, getPlan, getBillingMonthsForTerm } from '@automattic/calypso-products'; import { Gridicon } from '@automattic/components'; import { translate } from 'i18n-calypso'; -import React from 'react'; import { hasDomainRegistration, hasPlan, diff --git a/client/my-sites/checkout/composite-checkout/components/checkout-terms.jsx b/client/my-sites/checkout/composite-checkout/components/checkout-terms.jsx index fc82be85e2aed0..7796a929e80f92 100644 --- a/client/my-sites/checkout/composite-checkout/components/checkout-terms.jsx +++ b/client/my-sites/checkout/composite-checkout/components/checkout-terms.jsx @@ -1,5 +1,5 @@ import { localize } from 'i18n-calypso'; -import React, { Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { hasRenewableSubscription } from 'calypso/lib/cart-values/cart-items'; import AdditionalTermsOfServiceInCart from './additional-terms-of-service-in-cart'; import BundledDomainNotice from './bundled-domain-notice'; @@ -12,7 +12,7 @@ import TitanTermsOfService from './titan-terms-of-service'; /* eslint-disable wpcalypso/jsx-classname-namespace */ -class CheckoutTerms extends React.Component { +class CheckoutTerms extends Component { render() { const { cart } = this.props; return ( diff --git a/client/my-sites/checkout/composite-checkout/components/concierge-refund-policy.jsx b/client/my-sites/checkout/composite-checkout/components/concierge-refund-policy.jsx index 987773b5cf0122..f48346cb32ea73 100644 --- a/client/my-sites/checkout/composite-checkout/components/concierge-refund-policy.jsx +++ b/client/my-sites/checkout/composite-checkout/components/concierge-refund-policy.jsx @@ -1,13 +1,13 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { gaRecordEvent } from 'calypso/lib/analytics/ga'; import { hasConciergeSession } from 'calypso/lib/cart-values/cart-items'; import { REFUNDS } from 'calypso/lib/url/support'; /* eslint-disable wpcalypso/jsx-classname-namespace */ -class ConciergeRefundPolicy extends React.Component { +class ConciergeRefundPolicy extends Component { static displayName = 'RegistrationRefundPolicy'; recordRefundsSupportClick = () => { diff --git a/client/my-sites/checkout/composite-checkout/components/country-select-menu.js b/client/my-sites/checkout/composite-checkout/components/country-select-menu.js index 0372b6ea4fb2da..9933d56203e843 100644 --- a/client/my-sites/checkout/composite-checkout/components/country-select-menu.js +++ b/client/my-sites/checkout/composite-checkout/components/country-select-menu.js @@ -1,4 +1,3 @@ -import React from 'react'; import FormCountrySelect from 'calypso/components/forms/form-country-select'; import FormFieldAnnotation from 'calypso/my-sites/checkout/composite-checkout/components/form-field-annotation'; diff --git a/client/my-sites/checkout/composite-checkout/components/domain-refund-policy.jsx b/client/my-sites/checkout/composite-checkout/components/domain-refund-policy.jsx index 557317dc122a58..be7f6a1b962b96 100644 --- a/client/my-sites/checkout/composite-checkout/components/domain-refund-policy.jsx +++ b/client/my-sites/checkout/composite-checkout/components/domain-refund-policy.jsx @@ -1,6 +1,6 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { gaRecordEvent } from 'calypso/lib/analytics/ga'; import { hasDomainBeingUsedForPlan, @@ -12,7 +12,7 @@ import { DOMAIN_CANCEL, REFUNDS } from 'calypso/lib/url/support'; /* eslint-disable wpcalypso/jsx-classname-namespace */ -class DomainRefundPolicy extends React.Component { +class DomainRefundPolicy extends Component { recordCancelDomainSupportClick = () => { gaRecordEvent( 'Upgrades', 'Clicked Cancel Domain Support Link' ); }; diff --git a/client/my-sites/checkout/composite-checkout/components/domain-registration-agreement.jsx b/client/my-sites/checkout/composite-checkout/components/domain-registration-agreement.jsx index 74fbde8b70a36b..23d6669f84da41 100644 --- a/client/my-sites/checkout/composite-checkout/components/domain-registration-agreement.jsx +++ b/client/my-sites/checkout/composite-checkout/components/domain-registration-agreement.jsx @@ -1,7 +1,7 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get, map, reduce } from 'lodash'; -import React, { Fragment } from 'react'; +import { Component, Fragment } from 'react'; import { gaRecordEvent } from 'calypso/lib/analytics/ga'; import { getDomainRegistrations, @@ -12,7 +12,7 @@ import { /* eslint-disable wpcalypso/jsx-classname-namespace */ -class DomainRegistrationAgreement extends React.Component { +class DomainRegistrationAgreement extends Component { recordRegistrationAgreementClick = () => { gaRecordEvent( 'Upgrades', 'Clicked Registration Agreement Link' ); }; diff --git a/client/my-sites/checkout/composite-checkout/components/domain-registration-hsts.jsx b/client/my-sites/checkout/composite-checkout/components/domain-registration-hsts.jsx index 2f45f3d3dc977c..2c11c94248a161 100644 --- a/client/my-sites/checkout/composite-checkout/components/domain-registration-hsts.jsx +++ b/client/my-sites/checkout/composite-checkout/components/domain-registration-hsts.jsx @@ -1,7 +1,7 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { isEmpty, merge, reduce } from 'lodash'; -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import { getDomainRegistrations, getDomainTransfers } from 'calypso/lib/cart-values/cart-items'; import { getTld, isHstsRequired } from 'calypso/lib/domains'; @@ -10,7 +10,7 @@ import { getProductsList } from 'calypso/state/products-list/selectors'; /* eslint-disable wpcalypso/jsx-classname-namespace */ -class DomainRegistrationHsts extends React.PureComponent { +class DomainRegistrationHsts extends PureComponent { getHstsTlds = () => { const { cart, productsList } = this.props; const domains = merge( getDomainRegistrations( cart ), getDomainTransfers( cart ) ); diff --git a/client/my-sites/checkout/composite-checkout/components/payment-logos.js b/client/my-sites/checkout/composite-checkout/components/payment-logos.js index 76280329811873..950162c5622ba3 100644 --- a/client/my-sites/checkout/composite-checkout/components/payment-logos.js +++ b/client/my-sites/checkout/composite-checkout/components/payment-logos.js @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; export function VisaLogo( { className } ) { return ( diff --git a/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/index.jsx b/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/index.jsx index 057b4cded8697a..c0a695bfe6ce1f 100644 --- a/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/index.jsx +++ b/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/index.jsx @@ -5,7 +5,6 @@ import { isJetpackPlanSlug, } from '@automattic/calypso-products'; import { useShoppingCart } from '@automattic/shopping-cart'; -import React from 'react'; import { useSelector } from 'react-redux'; import Notice from 'calypso/components/notice'; import useCartKey from 'calypso/my-sites/checkout/use-cart-key'; diff --git a/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/jetpack-plugin-required-version-notice.jsx b/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/jetpack-plugin-required-version-notice.jsx index 08140bae5e8545..12372be82accca 100644 --- a/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/jetpack-plugin-required-version-notice.jsx +++ b/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/jetpack-plugin-required-version-notice.jsx @@ -1,6 +1,5 @@ import { getJetpackProductDisplayName } from '@automattic/calypso-products'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { useSelector } from 'react-redux'; import { preventWidows } from 'calypso/lib/formatting'; import getSiteAdminUrl from 'calypso/state/sites/selectors/get-site-admin-url'; diff --git a/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/prepurchase-notice.jsx b/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/prepurchase-notice.jsx index 95270c2dd5aed7..cbd9bc5ab822d3 100644 --- a/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/prepurchase-notice.jsx +++ b/client/my-sites/checkout/composite-checkout/components/prepurchase-notices/prepurchase-notice.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - import './style.scss'; const PrePurchaseNotice = ( { message, linkUrl, linkText } ) => ( diff --git a/client/my-sites/checkout/composite-checkout/components/spinner.js b/client/my-sites/checkout/composite-checkout/components/spinner.js index 76233b87bfaed8..b3e4674f3b9449 100644 --- a/client/my-sites/checkout/composite-checkout/components/spinner.js +++ b/client/my-sites/checkout/composite-checkout/components/spinner.js @@ -1,6 +1,5 @@ import { keyframes } from '@emotion/react'; import styled from '@emotion/styled'; -import React from 'react'; export default function Spinner( { className } ) { return ; diff --git a/client/my-sites/checkout/composite-checkout/components/terms-of-service.jsx b/client/my-sites/checkout/composite-checkout/components/terms-of-service.jsx index 23f2111b9b5ae1..92ff53b6fdb085 100644 --- a/client/my-sites/checkout/composite-checkout/components/terms-of-service.jsx +++ b/client/my-sites/checkout/composite-checkout/components/terms-of-service.jsx @@ -1,6 +1,6 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; +import { Component } from 'react'; import { gaRecordEvent } from 'calypso/lib/analytics/ga'; import { localizeUrl } from 'calypso/lib/i18n-utils'; import { @@ -10,7 +10,7 @@ import { /* eslint-disable wpcalypso/jsx-classname-namespace */ -class TermsOfService extends React.Component { +class TermsOfService extends Component { static displayName = 'TermsOfService'; recordTermsAndConditionsClick = () => { diff --git a/client/my-sites/checkout/composite-checkout/components/titan-terms-of-service.jsx b/client/my-sites/checkout/composite-checkout/components/titan-terms-of-service.jsx index bef8d12e3734e5..46b36ad26347b6 100644 --- a/client/my-sites/checkout/composite-checkout/components/titan-terms-of-service.jsx +++ b/client/my-sites/checkout/composite-checkout/components/titan-terms-of-service.jsx @@ -1,6 +1,5 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; -import React from 'react'; import { hasTitanMail } from 'calypso/lib/cart-values/cart-items'; import { getTitanProductName } from 'calypso/lib/titan'; diff --git a/client/my-sites/checkout/composite-checkout/components/upsell.jsx b/client/my-sites/checkout/composite-checkout/components/upsell.jsx index 218c86c4f33453..5e6cd74ca09742 100644 --- a/client/my-sites/checkout/composite-checkout/components/upsell.jsx +++ b/client/my-sites/checkout/composite-checkout/components/upsell.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - export function UpSellCoupon( { onClick } ) { return (
diff --git a/client/my-sites/checkout/composite-checkout/components/wordpress-logo.jsx b/client/my-sites/checkout/composite-checkout/components/wordpress-logo.jsx index bc67c0656604b7..5be5502fc08a3a 100644 --- a/client/my-sites/checkout/composite-checkout/components/wordpress-logo.jsx +++ b/client/my-sites/checkout/composite-checkout/components/wordpress-logo.jsx @@ -1,5 +1,4 @@ import styled from '@emotion/styled'; -import React from 'react'; const PaymentMethodLogos = styled.span` height: 16px; diff --git a/client/my-sites/checkout/composite-checkout/components/wp-contact-form-summary.js b/client/my-sites/checkout/composite-checkout/components/wp-contact-form-summary.js index 180d6e1041d1e7..24db2e820a47a0 100644 --- a/client/my-sites/checkout/composite-checkout/components/wp-contact-form-summary.js +++ b/client/my-sites/checkout/composite-checkout/components/wp-contact-form-summary.js @@ -1,7 +1,6 @@ import { useSelect } from '@automattic/composite-checkout'; import { useShoppingCart } from '@automattic/shopping-cart'; import styled from '@emotion/styled'; -import React from 'react'; import { hasOnlyRenewalItems } from 'calypso/lib/cart-values/cart-items'; import useCartKey from 'calypso/my-sites/checkout/use-cart-key'; import { SummaryLine, SummaryDetails } from './summary-details'; diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/contact-fields.js b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/contact-fields.js index c6c508cc735917..1a4df6275026ee 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/contact-fields.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/contact-fields.js @@ -1,5 +1,4 @@ import { FormStatus, useFormStatus, useSelect } from '@automattic/composite-checkout'; -import React from 'react'; import TaxFields from 'calypso/my-sites/checkout/composite-checkout/components/tax-fields'; import useCountryList from 'calypso/my-sites/checkout/composite-checkout/hooks/use-country-list'; import CountrySpecificPaymentFields from '../../components/country-specific-payment-fields'; diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-cvv-field.js b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-cvv-field.js index a20c1fe2050006..e227525d2a9882 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-cvv-field.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-cvv-field.js @@ -1,7 +1,6 @@ import { FormStatus, useFormStatus, useSelect } from '@automattic/composite-checkout'; import { CardCvcElement } from '@stripe/react-stripe-js'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { LeftColumn, RightColumn, diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-expiry-field.js b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-expiry-field.js index 150c43309f64a8..1d8cf016c99da4 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-expiry-field.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-expiry-field.js @@ -1,7 +1,6 @@ import { FormStatus, useFormStatus, useSelect } from '@automattic/composite-checkout'; import { CardExpiryElement } from '@stripe/react-stripe-js'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { Input } from 'calypso/my-sites/domains/components/form'; import { Label, LabelText, StripeFieldWrapper, StripeErrorMessage } from './form-layout-components'; diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-fields.js b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-fields.js index fd93d662b426a8..522e8503950e6f 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-fields.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-fields.js @@ -8,7 +8,7 @@ import { import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { useI18n } from '@wordpress/react-i18n'; -import React, { useState, useEffect } from 'react'; +import { Fragment, useState, useEffect } from 'react'; import { LeftColumn, RightColumn, @@ -175,11 +175,11 @@ const StripeFields = styled.div` function LoadingFields() { return ( - + - - ); + + ); } const LoadingIndicator = styled( Spinner )` diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-loading.js b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-loading.js index bd6796a172e801..40b89ba6f1dbf4 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-loading.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-loading.js @@ -1,7 +1,6 @@ import { Field } from '@automattic/wpcom-checkout'; import styled from '@emotion/styled'; import { useI18n } from '@wordpress/react-i18n'; -import React from 'react'; import { LeftColumn, RightColumn, diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-number-field.js b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-number-field.js index b27e479901175c..0d4a5a2fb06c75 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-number-field.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-number-field.js @@ -1,7 +1,6 @@ import { FormStatus, useFormStatus, useSelect, PaymentLogo } from '@automattic/composite-checkout'; import { CardNumberElement } from '@stripe/react-stripe-js'; import { useI18n } from '@wordpress/react-i18n'; -import React from 'react'; import CreditCardNumberInput from 'calypso/components/upgrades/credit-card-number-input'; import { Label, LabelText, StripeFieldWrapper, StripeErrorMessage } from './form-layout-components'; diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-pay-button.js b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-pay-button.js index 0223fbe995d1ed..e353fc7be7286a 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-pay-button.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/credit-card-pay-button.js @@ -10,7 +10,6 @@ import { useElements, CardNumberElement } from '@stripe/react-stripe-js'; import { sprintf } from '@wordpress/i18n'; import { useI18n } from '@wordpress/react-i18n'; import debugFactory from 'debug'; -import React from 'react'; import { validatePaymentDetails } from 'calypso/lib/checkout/validation'; const debug = debugFactory( 'calypso:composite-checkout:credit-card' ); diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/cvv-image.js b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/cvv-image.js index 7a67e81f08408c..0039a1de3158ec 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/cvv-image.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/cvv-image.js @@ -1,6 +1,5 @@ import styled from '@emotion/styled'; import { useI18n } from '@wordpress/react-i18n'; -import React from 'react'; function CVV( { className } ) { const { __ } = useI18n(); diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/index.js b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/index.js index dd813dfbe54ba1..86529f33cc093e 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/index.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/credit-card/index.js @@ -1,7 +1,7 @@ import { registerStore, useSelect, PaymentLogo } from '@automattic/composite-checkout'; import { useI18n } from '@wordpress/react-i18n'; import debugFactory from 'debug'; -import React from 'react'; +import { Fragment } from 'react'; import { maskField } from 'calypso/lib/checkout'; import { VisaLogo, @@ -208,11 +208,11 @@ function CreditCardSummary() { function CreditCardLabel() { const { __ } = useI18n(); return ( - + { __( 'Credit or debit card' ) } - - ); + + ); } function CreditCardLogos() { diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/ebanx-tef.js b/client/my-sites/checkout/composite-checkout/payment-methods/ebanx-tef.js index 877227e3c20ca9..bc2f81ff1e2a93 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/ebanx-tef.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/ebanx-tef.js @@ -13,7 +13,7 @@ import { sprintf } from '@wordpress/i18n'; import { useI18n } from '@wordpress/react-i18n'; import debugFactory from 'debug'; import { camelCase } from 'lodash'; -import React from 'react'; +import { Fragment } from 'react'; import { useDispatch as useReduxDispatch } from 'react-redux'; import { maskField } from 'calypso/lib/checkout'; import { validatePaymentDetails } from 'calypso/lib/checkout/validation'; @@ -391,13 +391,13 @@ function isFormValid( store, contactCountryCode, __, reduxDispatch ) { function EbanxTefLabel() { return ( - + { 'Transferência bancária' } - - ); + + ); } const EbanxTefLogo = styled( EbanxTefLogoImg )` diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/free-purchase.js b/client/my-sites/checkout/composite-checkout/payment-methods/free-purchase.js index f111a6e035f565..bdfd4f856cfe5d 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/free-purchase.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/free-purchase.js @@ -6,7 +6,7 @@ import { useEvents, } from '@automattic/composite-checkout'; import { useI18n } from '@wordpress/react-i18n'; -import React from 'react'; +import { Fragment } from 'react'; import WordPressLogo from '../components/wordpress-logo'; export function createFreePaymentMethod() { @@ -59,11 +59,11 @@ function WordPressFreePurchaseLabel() { const { __ } = useI18n(); return ( - +
{ __( 'Free Purchase' ) }
-
- ); + + ); } function WordPressFreePurchaseSummary() { diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/full-credits.js b/client/my-sites/checkout/composite-checkout/payment-methods/full-credits.js index d797e642171fa6..f194db12259960 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/full-credits.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/full-credits.js @@ -8,7 +8,7 @@ import { import { useShoppingCart } from '@automattic/shopping-cart'; import { sprintf } from '@wordpress/i18n'; import { useI18n } from '@wordpress/react-i18n'; -import React from 'react'; +import { Fragment } from 'react'; import useCartKey from 'calypso/my-sites/checkout/use-cart-key'; import WordPressLogo from '../components/wordpress-logo'; @@ -70,7 +70,7 @@ function WordPressCreditsLabel() { const { responseCart } = useShoppingCart( cartKey ); return ( - +
{ /* translators: %(amount)s is the total amount of credits available in localized currency */ @@ -80,8 +80,8 @@ function WordPressCreditsLabel() { }
-
- ); + + ); } function WordPressCreditsSummary() { diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/netbanking.js b/client/my-sites/checkout/composite-checkout/payment-methods/netbanking.js index c716e2e2eb4fe7..102019d79bc712 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/netbanking.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/netbanking.js @@ -13,7 +13,7 @@ import { sprintf } from '@wordpress/i18n'; import { useI18n } from '@wordpress/react-i18n'; import debugFactory from 'debug'; import { camelCase } from 'lodash'; -import React from 'react'; +import { Fragment } from 'react'; import { useDispatch as useReduxDispatch } from 'react-redux'; import { maskField } from 'calypso/lib/checkout'; import { validatePaymentDetails } from 'calypso/lib/checkout/validation'; @@ -311,13 +311,13 @@ function isFormValid( store, contactCountryCode, __, reduxDispatch ) { function NetBankingLabel() { return ( - + Net Banking - - ); + + ); } const NetbankingLogo = styled( NetbankingLogoImg )` diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/wechat/index.js b/client/my-sites/checkout/composite-checkout/payment-methods/wechat/index.js index d1b5d758cd4c72..c7365082cd0b26 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/wechat/index.js +++ b/client/my-sites/checkout/composite-checkout/payment-methods/wechat/index.js @@ -15,7 +15,7 @@ import styled from '@emotion/styled'; import { sprintf } from '@wordpress/i18n'; import { useI18n } from '@wordpress/react-i18n'; import debugFactory from 'debug'; -import React, { useEffect, useState } from 'react'; +import { Fragment, useEffect, useState } from 'react'; import { PaymentMethodLogos } from 'calypso/my-sites/checkout/composite-checkout/components/payment-method-logos'; import { SummaryLine, @@ -241,13 +241,13 @@ function isFormValid( store ) { function WeChatLabel() { return ( - + WeChat Pay - - ); + + ); } function WeChatLogo() { diff --git a/client/my-sites/checkout/composite-checkout/payment-methods/wechat/wechat-payment-qrcode.jsx b/client/my-sites/checkout/composite-checkout/payment-methods/wechat/wechat-payment-qrcode.jsx index 5df885b6ad7669..965f3d84a215f3 100644 --- a/client/my-sites/checkout/composite-checkout/payment-methods/wechat/wechat-payment-qrcode.jsx +++ b/client/my-sites/checkout/composite-checkout/payment-methods/wechat/wechat-payment-qrcode.jsx @@ -2,7 +2,7 @@ import { localize, translate } from 'i18n-calypso'; import page from 'page'; import PropTypes from 'prop-types'; import QRCode from 'qrcode.react'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryOrderTransaction from 'calypso/components/data/query-order-transaction'; import Spinner from 'calypso/components/spinner'; diff --git a/client/my-sites/checkout/composite-checkout/test/composite-checkout.js b/client/my-sites/checkout/composite-checkout/test/composite-checkout.js index 0c8844d964cac5..de1383a60c6fcd 100644 --- a/client/my-sites/checkout/composite-checkout/test/composite-checkout.js +++ b/client/my-sites/checkout/composite-checkout/test/composite-checkout.js @@ -14,7 +14,6 @@ import { } from '@testing-library/react'; import nock from 'nock'; import page from 'page'; -import React from 'react'; import { Provider as ReduxProvider } from 'react-redux'; import '@testing-library/jest-dom/extend-expect'; import useCartKey from 'calypso/my-sites/checkout/use-cart-key'; diff --git a/client/my-sites/checkout/composite-checkout/test/form-field-annotation.js b/client/my-sites/checkout/composite-checkout/test/form-field-annotation.js index c0a1856b92ea49..b5f67375087778 100644 --- a/client/my-sites/checkout/composite-checkout/test/form-field-annotation.js +++ b/client/my-sites/checkout/composite-checkout/test/form-field-annotation.js @@ -7,7 +7,6 @@ import { matchers } from '@emotion/jest'; import { ThemeProvider } from '@emotion/react'; import { render } from '@testing-library/react'; import '@testing-library/jest-dom/extend-expect'; -import React from 'react'; import FormFieldAnnotation from '../components/form-field-annotation'; // Add the custom matchers provided by '@emotion/jest' diff --git a/client/my-sites/checkout/composite-checkout/test/wechat-payment-qrcode.js b/client/my-sites/checkout/composite-checkout/test/wechat-payment-qrcode.js index 5fec31ac3aa76c..60ea594a3625fb 100644 --- a/client/my-sites/checkout/composite-checkout/test/wechat-payment-qrcode.js +++ b/client/my-sites/checkout/composite-checkout/test/wechat-payment-qrcode.js @@ -5,7 +5,6 @@ import { shallow } from 'enzyme'; import page from 'page'; import QRCode from 'qrcode.react'; -import React from 'react'; import { ORDER_TRANSACTION_STATUS } from 'calypso/state/order-transactions/constants'; import { WechatPaymentQRCode } from '../payment-methods/wechat/wechat-payment-qrcode'; diff --git a/client/my-sites/checkout/controller.jsx b/client/my-sites/checkout/controller.jsx index 6f347c814f2d8d..7e6077fd146fea 100644 --- a/client/my-sites/checkout/controller.jsx +++ b/client/my-sites/checkout/controller.jsx @@ -3,7 +3,6 @@ import debugFactory from 'debug'; import i18n from 'i18n-calypso'; import { get, isEmpty } from 'lodash'; import page from 'page'; -import React from 'react'; import { setSectionMiddleware } from 'calypso/controller'; import { CALYPSO_PLANS_PAGE } from 'calypso/jetpack-connect/constants'; import { MARKETING_COUPONS_KEY } from 'calypso/lib/analytics/utils'; diff --git a/client/my-sites/checkout/upsell-nudge/business-plan-upgrade-upsell/index.jsx b/client/my-sites/checkout/upsell-nudge/business-plan-upgrade-upsell/index.jsx index 7dbb059b71dc4f..24c0a1b85e9343 100644 --- a/client/my-sites/checkout/upsell-nudge/business-plan-upgrade-upsell/index.jsx +++ b/client/my-sites/checkout/upsell-nudge/business-plan-upgrade-upsell/index.jsx @@ -1,6 +1,6 @@ import { CompactCard, Button, Gridicon } from '@automattic/components'; import formatCurrency from '@automattic/format-currency'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import premiumThemesImage from 'calypso/assets/images/illustrations/themes.svg'; import DocumentHead from 'calypso/components/data/document-head'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; diff --git a/client/my-sites/checkout/upsell-nudge/concierge-quickstart-session/index.jsx b/client/my-sites/checkout/upsell-nudge/concierge-quickstart-session/index.jsx index 9856f666fdf27f..36ea0ae59d5b51 100644 --- a/client/my-sites/checkout/upsell-nudge/concierge-quickstart-session/index.jsx +++ b/client/my-sites/checkout/upsell-nudge/concierge-quickstart-session/index.jsx @@ -1,6 +1,6 @@ import { CompactCard, Button, Gridicon } from '@automattic/components'; import formatCurrency from '@automattic/format-currency'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import supportIllustration from 'calypso/assets/images/illustrations/happiness-support.svg'; import DocumentHead from 'calypso/components/data/document-head'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; diff --git a/client/my-sites/checkout/upsell-nudge/concierge-support-session/index.jsx b/client/my-sites/checkout/upsell-nudge/concierge-support-session/index.jsx index 5fff5d334d1857..7cf3b9d6365af6 100644 --- a/client/my-sites/checkout/upsell-nudge/concierge-support-session/index.jsx +++ b/client/my-sites/checkout/upsell-nudge/concierge-support-session/index.jsx @@ -1,6 +1,6 @@ import { CompactCard, Button, Gridicon } from '@automattic/components'; import formatCurrency from '@automattic/format-currency'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import supportIllustration from 'calypso/assets/images/illustrations/happiness-support.svg'; import DocumentHead from 'calypso/components/data/document-head'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; diff --git a/client/my-sites/checkout/upsell-nudge/index.jsx b/client/my-sites/checkout/upsell-nudge/index.jsx index 9898d36ea7b85a..03b42c89451b8e 100644 --- a/client/my-sites/checkout/upsell-nudge/index.jsx +++ b/client/my-sites/checkout/upsell-nudge/index.jsx @@ -8,7 +8,7 @@ import { localize } from 'i18n-calypso'; import { pick } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import QueryProductsList from 'calypso/components/data/query-products-list'; import QuerySitePlans from 'calypso/components/data/query-site-plans'; @@ -68,7 +68,7 @@ export const CONCIERGE_QUICKSTART_SESSION = 'concierge-quickstart-session'; export const CONCIERGE_SUPPORT_SESSION = 'concierge-support-session'; export const BUSINESS_PLAN_UPGRADE_UPSELL = 'business-plan-upgrade-upsell'; -export class UpsellNudge extends React.Component { +export class UpsellNudge extends Component { static propTypes = { receiptId: PropTypes.number, upsellType: PropTypes.string, diff --git a/client/my-sites/checkout/upsell-nudge/purchase-modal/content.jsx b/client/my-sites/checkout/upsell-nudge/purchase-modal/content.jsx index cde2206ae9ad68..6df0b0053da682 100644 --- a/client/my-sites/checkout/upsell-nudge/purchase-modal/content.jsx +++ b/client/my-sites/checkout/upsell-nudge/purchase-modal/content.jsx @@ -3,7 +3,7 @@ import { CheckoutCheckIcon, PaymentLogo } from '@automattic/composite-checkout'; import { sprintf } from '@wordpress/i18n'; import { useTranslate } from 'i18n-calypso'; import page from 'page'; -import React, { useCallback } from 'react'; +import { useCallback } from 'react'; import CheckoutTerms from 'calypso/my-sites/checkout/composite-checkout/components/checkout-terms'; import { BEFORE_SUBMIT } from './constants'; import { formatDate } from './util'; diff --git a/client/my-sites/checkout/upsell-nudge/purchase-modal/placeholder.jsx b/client/my-sites/checkout/upsell-nudge/purchase-modal/placeholder.jsx index f14727860c5940..82c12ab7d7eea1 100644 --- a/client/my-sites/checkout/upsell-nudge/purchase-modal/placeholder.jsx +++ b/client/my-sites/checkout/upsell-nudge/purchase-modal/placeholder.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - function OrderStep() { return (
diff --git a/client/my-sites/comment/comment-delete-warning.jsx b/client/my-sites/comment/comment-delete-warning.jsx index dc5a1af5a10a93..b7a033c43dac56 100644 --- a/client/my-sites/comment/comment-delete-warning.jsx +++ b/client/my-sites/comment/comment-delete-warning.jsx @@ -1,6 +1,5 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import Notice from 'calypso/components/notice'; import NoticeAction from 'calypso/components/notice/notice-action'; diff --git a/client/my-sites/comment/comment-permalink.jsx b/client/my-sites/comment/comment-permalink.jsx index 1afd5d980659fc..56556263d74340 100644 --- a/client/my-sites/comment/comment-permalink.jsx +++ b/client/my-sites/comment/comment-permalink.jsx @@ -2,7 +2,6 @@ import { Card } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import ExternalLink from 'calypso/components/external-link'; import SectionHeader from 'calypso/components/section-header'; diff --git a/client/my-sites/comment/main.jsx b/client/my-sites/comment/main.jsx index 459d2a26724d23..a7b0dc97293c54 100644 --- a/client/my-sites/comment/main.jsx +++ b/client/my-sites/comment/main.jsx @@ -1,7 +1,7 @@ import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import ModerateComment from 'calypso/components/data/moderate-comment'; diff --git a/client/my-sites/comments/comment-list/comment-list-header.jsx b/client/my-sites/comments/comment-list/comment-list-header.jsx index fb8567e72cd107..21da512e0a15e1 100644 --- a/client/my-sites/comments/comment-list/comment-list-header.jsx +++ b/client/my-sites/comments/comment-list/comment-list-header.jsx @@ -1,6 +1,5 @@ import { localize } from 'i18n-calypso'; import { get } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import QueryPosts from 'calypso/components/data/query-posts'; import HeaderCake from 'calypso/components/header-cake'; diff --git a/client/my-sites/comments/comment-list/index.jsx b/client/my-sites/comments/comment-list/index.jsx index ef3e37b58463ff..be1921fc2dfe1d 100644 --- a/client/my-sites/comments/comment-list/index.jsx +++ b/client/my-sites/comments/comment-list/index.jsx @@ -1,7 +1,7 @@ import { localize } from 'i18n-calypso'; import { find, get, isEqual, map } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import CSSTransition from 'react-transition-group/CSSTransition'; import TransitionGroup from 'react-transition-group/TransitionGroup'; diff --git a/client/my-sites/comments/comment-navigation/comment-navigation-tab.jsx b/client/my-sites/comments/comment-navigation/comment-navigation-tab.jsx index be0eb040833c2f..9ce7a2eb00332a 100644 --- a/client/my-sites/comments/comment-navigation/comment-navigation-tab.jsx +++ b/client/my-sites/comments/comment-navigation/comment-navigation-tab.jsx @@ -1,5 +1,4 @@ import classNames from 'classnames'; -import React from 'react'; export const CommentNavigationTab = ( { children, className } ) => (
{ children }
diff --git a/client/my-sites/comments/comment-navigation/index.jsx b/client/my-sites/comments/comment-navigation/index.jsx index 9ee3552aa57871..3cbc56b8f3c06b 100644 --- a/client/my-sites/comments/comment-navigation/index.jsx +++ b/client/my-sites/comments/comment-navigation/index.jsx @@ -1,7 +1,7 @@ import { Button, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get, includes, isEqual, map } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ButtonGroup from 'calypso/components/button-group'; import Count from 'calypso/components/count'; diff --git a/client/my-sites/comments/comment-replies-list/index.jsx b/client/my-sites/comments/comment-replies-list/index.jsx index fa08a4e564d395..0fe7ad7b0acd7e 100644 --- a/client/my-sites/comments/comment-replies-list/index.jsx +++ b/client/my-sites/comments/comment-replies-list/index.jsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { map, take } from 'lodash'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import Notice from 'calypso/components/notice'; import NoticeAction from 'calypso/components/notice/notice-action'; diff --git a/client/my-sites/comments/comment-tree/index.jsx b/client/my-sites/comments/comment-tree/index.jsx index fbf64c0022d645..c834689e275799 100644 --- a/client/my-sites/comments/comment-tree/index.jsx +++ b/client/my-sites/comments/comment-tree/index.jsx @@ -2,7 +2,7 @@ import { isEnabled } from '@automattic/calypso-config'; import { localize } from 'i18n-calypso'; import { filter, find, get, isEqual, map, orderBy } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import CSSTransition from 'react-transition-group/CSSTransition'; import TransitionGroup from 'react-transition-group/TransitionGroup'; diff --git a/client/my-sites/comments/comment/comment-actions.jsx b/client/my-sites/comments/comment/comment-actions.jsx index b8f53e4376bea2..1d9629c8073db7 100644 --- a/client/my-sites/comments/comment/comment-actions.jsx +++ b/client/my-sites/comments/comment/comment-actions.jsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { get, includes, isEqual } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import scrollTo from 'calypso/lib/scroll-to'; import { getMinimumComment } from 'calypso/my-sites/comments/comment/utils'; diff --git a/client/my-sites/comments/comment/comment-author-more-info.jsx b/client/my-sites/comments/comment/comment-author-more-info.jsx index 7a9a7b6a646154..868086ce052038 100644 --- a/client/my-sites/comments/comment/comment-author-more-info.jsx +++ b/client/my-sites/comments/comment/comment-author-more-info.jsx @@ -2,7 +2,7 @@ import { Button, Popover, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import ExternalLink from 'calypso/components/external-link'; import { decodeEntities } from 'calypso/lib/formatting'; diff --git a/client/my-sites/comments/comment/comment-author.jsx b/client/my-sites/comments/comment/comment-author.jsx index 01e760d40aaceb..ed04910af520da 100644 --- a/client/my-sites/comments/comment/comment-author.jsx +++ b/client/my-sites/comments/comment/comment-author.jsx @@ -2,7 +2,7 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component, Fragment } from 'react'; +import { createRef, Component, Fragment } from 'react'; import { connect } from 'react-redux'; import ExternalLink from 'calypso/components/external-link'; import Gravatar from 'calypso/components/gravatar'; @@ -26,7 +26,7 @@ export class CommentAuthor extends Component { isLinkTooltipVisible: false, }; - linkIndicatorRef = React.createRef(); + linkIndicatorRef = createRef(); hideLinkTooltip = () => this.setState( { isLinkTooltipVisible: false } ); diff --git a/client/my-sites/comments/comment/comment-content.jsx b/client/my-sites/comments/comment/comment-content.jsx index cf55f5f64b4e46..d5b3be6ebe937a 100644 --- a/client/my-sites/comments/comment/comment-content.jsx +++ b/client/my-sites/comments/comment/comment-content.jsx @@ -3,7 +3,7 @@ import DOMPurify from 'dompurify'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import AutoDirection from 'calypso/components/auto-direction'; import QueryComment from 'calypso/components/data/query-comment'; diff --git a/client/my-sites/comments/comment/comment-edit.jsx b/client/my-sites/comments/comment/comment-edit.jsx index 67ba246026963b..34316ddb67d41e 100644 --- a/client/my-sites/comments/comment/comment-edit.jsx +++ b/client/my-sites/comments/comment/comment-edit.jsx @@ -2,7 +2,7 @@ import { Button, Popover, Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get, pick } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component, createRef } from 'react'; +import { Component, createRef } from 'react'; import { connect } from 'react-redux'; import QuerySiteSettings from 'calypso/components/data/query-site-settings'; import FormButton from 'calypso/components/forms/form-button'; diff --git a/client/my-sites/comments/comment/comment-header.jsx b/client/my-sites/comments/comment/comment-header.jsx index 2ce669ffb85e9a..4de2d0159d3924 100644 --- a/client/my-sites/comments/comment/comment-header.jsx +++ b/client/my-sites/comments/comment/comment-header.jsx @@ -1,5 +1,5 @@ import { get } from 'lodash'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import FormCheckbox from 'calypso/components/forms/form-checkbox'; import CommentAuthor from 'calypso/my-sites/comments/comment/comment-author'; diff --git a/client/my-sites/comments/comment/comment-html-editor/add-image-dialog.jsx b/client/my-sites/comments/comment/comment-html-editor/add-image-dialog.jsx index 839831bdd534fb..5886400cb39cd8 100644 --- a/client/my-sites/comments/comment/comment-html-editor/add-image-dialog.jsx +++ b/client/my-sites/comments/comment/comment-html-editor/add-image-dialog.jsx @@ -1,7 +1,7 @@ import { Dialog } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import FormFieldset from 'calypso/components/forms/form-fieldset'; import FormLabel from 'calypso/components/forms/form-label'; import FormTextInput from 'calypso/components/forms/form-text-input'; diff --git a/client/my-sites/comments/comment/comment-html-editor/add-link-dialog.jsx b/client/my-sites/comments/comment/comment-html-editor/add-link-dialog.jsx index 013767aea5d56d..0b01e9d53b556d 100644 --- a/client/my-sites/comments/comment/comment-html-editor/add-link-dialog.jsx +++ b/client/my-sites/comments/comment/comment-html-editor/add-link-dialog.jsx @@ -1,7 +1,7 @@ import { Dialog } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import FormCheckbox from 'calypso/components/forms/form-checkbox'; import FormFieldset from 'calypso/components/forms/form-fieldset'; import FormLabel from 'calypso/components/forms/form-label'; diff --git a/client/my-sites/comments/comment/comment-html-editor/index.jsx b/client/my-sites/comments/comment/comment-html-editor/index.jsx index 869ce5046f7bed..803d1bf7de48db 100644 --- a/client/my-sites/comments/comment/comment-html-editor/index.jsx +++ b/client/my-sites/comments/comment/comment-html-editor/index.jsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { delay, get, map, reduce, reject } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import FormTextarea from 'calypso/components/forms/form-textarea'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; import AddImageDialog from 'calypso/my-sites/comments/comment/comment-html-editor/add-image-dialog'; diff --git a/client/my-sites/comments/comment/comment-link.jsx b/client/my-sites/comments/comment/comment-link.jsx index 033cf00bb3ed5a..af782fb231eb31 100644 --- a/client/my-sites/comments/comment/comment-link.jsx +++ b/client/my-sites/comments/comment/comment-link.jsx @@ -1,6 +1,6 @@ import page from 'page'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; export default class CommentLink extends PureComponent { static propTypes = { diff --git a/client/my-sites/comments/comment/comment-post-link.jsx b/client/my-sites/comments/comment/comment-post-link.jsx index 2f7fcfe240d040..2e83edde0b2fe6 100644 --- a/client/my-sites/comments/comment/comment-post-link.jsx +++ b/client/my-sites/comments/comment/comment-post-link.jsx @@ -1,7 +1,6 @@ import { Gridicon } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; -import React from 'react'; import { connect } from 'react-redux'; import QueryPosts from 'calypso/components/data/query-posts'; import { decodeEntities, stripHTML } from 'calypso/lib/formatting'; diff --git a/client/my-sites/comments/comment/comment-reply.jsx b/client/my-sites/comments/comment/comment-reply.jsx index 51a7d0bc6f1a58..b1fc312e4f6afe 100644 --- a/client/my-sites/comments/comment/comment-reply.jsx +++ b/client/my-sites/comments/comment/comment-reply.jsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import AutoDirection from 'calypso/components/auto-direction'; import FormTextarea from 'calypso/components/forms/form-textarea'; diff --git a/client/my-sites/comments/comment/index.jsx b/client/my-sites/comments/comment/index.jsx index 28363335384bf5..ebd7e68be9d8e1 100644 --- a/client/my-sites/comments/comment/index.jsx +++ b/client/my-sites/comments/comment/index.jsx @@ -4,7 +4,7 @@ import { isWithinBreakpoint } from '@automattic/viewport'; import classNames from 'classnames'; import { debounce, get, isEqual } from 'lodash'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import ReactDom from 'react-dom'; import { connect } from 'react-redux'; import QueryComment from 'calypso/components/data/query-comment'; diff --git a/client/my-sites/comments/controller.js b/client/my-sites/comments/controller.js index 888839c720f5b0..4e1d6a2faf4b96 100644 --- a/client/my-sites/comments/controller.js +++ b/client/my-sites/comments/controller.js @@ -1,6 +1,5 @@ import { startsWith } from 'lodash'; import page from 'page'; -import React from 'react'; import { addQueryArgs, getSiteFragment } from 'calypso/lib/route'; import CommentView from 'calypso/my-sites/comment/main'; import { removeNotice } from 'calypso/state/notices/actions'; diff --git a/client/my-sites/comments/main.jsx b/client/my-sites/comments/main.jsx index e4f659cb9513ea..21e075f654623f 100644 --- a/client/my-sites/comments/main.jsx +++ b/client/my-sites/comments/main.jsx @@ -1,7 +1,7 @@ import { isEnabled } from '@automattic/calypso-config'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import EmptyContent from 'calypso/components/empty-content'; diff --git a/client/my-sites/controller.js b/client/my-sites/controller.js index e8b135a5bc8d66..d03b1a49169cc9 100644 --- a/client/my-sites/controller.js +++ b/client/my-sites/controller.js @@ -3,7 +3,7 @@ import { removeQueryArgs } from '@wordpress/url'; import i18n from 'i18n-calypso'; import { some, startsWith } from 'lodash'; import page from 'page'; -import React from 'react'; +import { createElement } from 'react'; import EmptyContentComponent from 'calypso/components/empty-content'; import NoSitesMessage from 'calypso/components/empty-content/no-sites-message'; import { makeLayout, render as clientRender, setSectionMiddleware } from 'calypso/controller'; @@ -98,7 +98,7 @@ export function createNavigation( context ) { export function renderEmptySites( context ) { setSectionMiddleware( { group: 'sites' } )( context ); - context.primary = React.createElement( NoSitesMessage ); + context.primary = createElement( NoSitesMessage ); makeLayout( context, noop ); clientRender( context ); @@ -113,7 +113,7 @@ export function renderNoVisibleSites( context ) { setSectionMiddleware( { group: 'sites' } )( context ); - context.primary = React.createElement( EmptyContentComponent, { + context.primary = createElement( EmptyContentComponent, { title: i18n.translate( 'You have %(hidden)d hidden WordPress site.', 'You have %(hidden)d hidden WordPress sites.', diff --git a/client/my-sites/current-site/domain-warnings.jsx b/client/my-sites/current-site/domain-warnings.jsx index 8cef961fb413c4..7875a4b2fb93f5 100644 --- a/client/my-sites/current-site/domain-warnings.jsx +++ b/client/my-sites/current-site/domain-warnings.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import { connect } from 'react-redux'; import QuerySiteDomains from 'calypso/components/data/query-site-domains'; import DomainWarnings from 'calypso/my-sites/domains/components/domain-warnings'; diff --git a/client/my-sites/current-site/index.jsx b/client/my-sites/current-site/index.jsx index c97ead5da558b9..27bb105873dbb9 100644 --- a/client/my-sites/current-site/index.jsx +++ b/client/my-sites/current-site/index.jsx @@ -2,7 +2,7 @@ import { isEnabled } from '@automattic/calypso-config'; import { Button, Card, Gridicon } from '@automattic/components'; import { localize, withRtl } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import AllSites from 'calypso/blocks/all-sites'; import Site from 'calypso/blocks/site'; diff --git a/client/my-sites/current-site/notice.jsx b/client/my-sites/current-site/notice.jsx index 5d54ea92b9ed50..3ae7db294baeda 100644 --- a/client/my-sites/current-site/notice.jsx +++ b/client/my-sites/current-site/notice.jsx @@ -5,7 +5,7 @@ import { localize } from 'i18n-calypso'; import { get, reject } from 'lodash'; import moment from 'moment'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import UpsellNudge from 'calypso/blocks/upsell-nudge'; import AsyncLoad from 'calypso/components/async-load'; @@ -40,7 +40,7 @@ import { getSectionName } from 'calypso/state/ui/selectors'; const DOMAIN_UPSELL_NUDGE_DISMISS_KEY = 'domain_upsell_nudge_dismiss'; -export class SiteNotice extends React.Component { +export class SiteNotice extends Component { static propTypes = { site: PropTypes.object, }; diff --git a/client/my-sites/current-site/pending-payment-notice.jsx b/client/my-sites/current-site/pending-payment-notice.jsx index 23ab9e835af768..9170886558aba4 100644 --- a/client/my-sites/current-site/pending-payment-notice.jsx +++ b/client/my-sites/current-site/pending-payment-notice.jsx @@ -1,5 +1,4 @@ import { localize } from 'i18n-calypso'; -import React from 'react'; import Notice from 'calypso/components/notice'; import NoticeAction from 'calypso/components/notice/notice-action'; import { hasPendingPayment } from 'calypso/lib/cart-values'; diff --git a/client/my-sites/current-site/sidebar-banner/index.jsx b/client/my-sites/current-site/sidebar-banner/index.jsx index f04a18f224261d..172be79b17d8b2 100644 --- a/client/my-sites/current-site/sidebar-banner/index.jsx +++ b/client/my-sites/current-site/sidebar-banner/index.jsx @@ -2,7 +2,7 @@ import { Gridicon } from '@automattic/components'; import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import TrackComponentView from 'calypso/lib/analytics/track-component-view'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; diff --git a/client/my-sites/customer-home/cards/actions/quick-links/action-box.jsx b/client/my-sites/customer-home/cards/actions/quick-links/action-box.jsx index 5d84602e8a5a97..43db92680387f5 100644 --- a/client/my-sites/customer-home/cards/actions/quick-links/action-box.jsx +++ b/client/my-sites/customer-home/cards/actions/quick-links/action-box.jsx @@ -1,6 +1,5 @@ import { CompactCard, Gridicon } from '@automattic/components'; import classnames from 'classnames'; -import React from 'react'; import MaterialIcon from 'calypso/components/material-icon'; const ActionBox = ( { diff --git a/client/my-sites/customer-home/cards/actions/quick-links/index.jsx b/client/my-sites/customer-home/cards/actions/quick-links/index.jsx index c37ac465db669f..8bca887f8d328f 100644 --- a/client/my-sites/customer-home/cards/actions/quick-links/index.jsx +++ b/client/my-sites/customer-home/cards/actions/quick-links/index.jsx @@ -1,5 +1,5 @@ import i18nCalypso, { getLocaleSlug, useTranslate } from 'i18n-calypso'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { connect } from 'react-redux'; import { useDebouncedCallback } from 'use-debounce'; import anchorLogoIcon from 'calypso/assets/images/customer-home/anchor-logo-grey.svg'; diff --git a/client/my-sites/customer-home/cards/actions/wp-for-teams-quick-links/index.jsx b/client/my-sites/customer-home/cards/actions/wp-for-teams-quick-links/index.jsx index 3718ff8c5259cb..6c13a0a10a9e62 100644 --- a/client/my-sites/customer-home/cards/actions/wp-for-teams-quick-links/index.jsx +++ b/client/my-sites/customer-home/cards/actions/wp-for-teams-quick-links/index.jsx @@ -1,5 +1,5 @@ import { useTranslate } from 'i18n-calypso'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { connect } from 'react-redux'; import { useDebouncedCallback } from 'use-debounce'; import FoldableCard from 'calypso/components/foldable-card'; diff --git a/client/my-sites/customer-home/cards/education/earn/index.jsx b/client/my-sites/customer-home/cards/education/earn/index.jsx index 3574e24097d266..bf120a677fc25a 100644 --- a/client/my-sites/customer-home/cards/education/earn/index.jsx +++ b/client/my-sites/customer-home/cards/education/earn/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import earnCardPrompt from 'calypso/assets/images/customer-home/illustration--secondary-earn.svg'; import { getSelectedSiteSlug } from 'calypso/state/ui/selectors'; diff --git a/client/my-sites/customer-home/cards/education/educational-content/index.jsx b/client/my-sites/customer-home/cards/education/educational-content/index.jsx index 0908c27377e4fa..798d733729bd9b 100644 --- a/client/my-sites/customer-home/cards/education/educational-content/index.jsx +++ b/client/my-sites/customer-home/cards/education/educational-content/index.jsx @@ -1,6 +1,5 @@ import { Gridicon } from '@automattic/components'; import { isDesktop } from '@automattic/viewport'; -import React from 'react'; import { useDispatch } from 'react-redux'; import ExternalLink from 'calypso/components/external-link'; import InlineSupportLink from 'calypso/components/inline-support-link'; diff --git a/client/my-sites/customer-home/cards/education/find-success/index.jsx b/client/my-sites/customer-home/cards/education/find-success/index.jsx index 68f43ba54a6f45..ecc843d4fce1e0 100644 --- a/client/my-sites/customer-home/cards/education/find-success/index.jsx +++ b/client/my-sites/customer-home/cards/education/find-success/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import findSuccessPrompt from 'calypso/assets/images/customer-home/illustration--secondary-find-success.svg'; import { EDUCATION_FIND_SUCCESS } from 'calypso/my-sites/customer-home/cards/constants'; import EducationalContent from '../educational-content'; diff --git a/client/my-sites/customer-home/cards/education/free-photo-library/index.jsx b/client/my-sites/customer-home/cards/education/free-photo-library/index.jsx index 993cb9a8dbd3e7..83608684821a53 100644 --- a/client/my-sites/customer-home/cards/education/free-photo-library/index.jsx +++ b/client/my-sites/customer-home/cards/education/free-photo-library/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import freePhotoLibraryVideoPrompt from 'calypso/assets/images/customer-home/illustration--secondary-free-photo-library.svg'; import { localizeUrl } from 'calypso/lib/i18n-utils'; import { EDUCATION_FREE_PHOTO_LIBRARY } from 'calypso/my-sites/customer-home/cards/constants'; diff --git a/client/my-sites/customer-home/cards/education/mastering-gutenberg/index.jsx b/client/my-sites/customer-home/cards/education/mastering-gutenberg/index.jsx index edc2a2f03a5475..a7722b8adba3e6 100644 --- a/client/my-sites/customer-home/cards/education/mastering-gutenberg/index.jsx +++ b/client/my-sites/customer-home/cards/education/mastering-gutenberg/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import gutenbergIllustration from 'calypso/assets/images/customer-home/illustration--secondary-gutenberg.svg'; import { localizeUrl } from 'calypso/lib/i18n-utils'; import { EDUCATION_GUTENBERG } from 'calypso/my-sites/customer-home/cards/constants'; diff --git a/client/my-sites/customer-home/cards/education/quick-start-video/index.jsx b/client/my-sites/customer-home/cards/education/quick-start-video/index.jsx index fe52e8f7b686e5..8e6931bf4102f1 100644 --- a/client/my-sites/customer-home/cards/education/quick-start-video/index.jsx +++ b/client/my-sites/customer-home/cards/education/quick-start-video/index.jsx @@ -1,7 +1,7 @@ import { Card } from '@automattic/components'; import { isDesktop } from '@automattic/viewport'; import { useTranslate } from 'i18n-calypso'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { connect } from 'react-redux'; import quickStartVideoImage from 'calypso/assets/images/customer-home/quick-start-video-ss.png'; import InlineSupportLink from 'calypso/components/inline-support-link'; diff --git a/client/my-sites/customer-home/cards/education/respond-to-customer-feedback/index.jsx b/client/my-sites/customer-home/cards/education/respond-to-customer-feedback/index.jsx index 989a806823fcf5..937770367805d0 100644 --- a/client/my-sites/customer-home/cards/education/respond-to-customer-feedback/index.jsx +++ b/client/my-sites/customer-home/cards/education/respond-to-customer-feedback/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import respondToCustomerFeedbackPrompt from 'calypso/assets/images/customer-home/illustration--secondary-respond-to-customer-feedback.svg'; import { EDUCATION_RESPOND_TO_CUSTOMER_FEEDBACK } from 'calypso/my-sites/customer-home/cards/constants'; import EducationalContent from '../educational-content'; diff --git a/client/my-sites/customer-home/cards/education/webinars/index.jsx b/client/my-sites/customer-home/cards/education/webinars/index.jsx index 04b385cafb554e..16fc7bda4fd48a 100644 --- a/client/my-sites/customer-home/cards/education/webinars/index.jsx +++ b/client/my-sites/customer-home/cards/education/webinars/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import webinarIllustration from 'calypso/assets/images/customer-home/illustration-webinars.svg'; import EducationalContent from '../educational-content'; diff --git a/client/my-sites/customer-home/cards/education/wpcourses/index.jsx b/client/my-sites/customer-home/cards/education/wpcourses/index.jsx index ae23488d94cad4..34401b69f89d44 100644 --- a/client/my-sites/customer-home/cards/education/wpcourses/index.jsx +++ b/client/my-sites/customer-home/cards/education/wpcourses/index.jsx @@ -1,6 +1,5 @@ import config from '@automattic/calypso-config'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import freePhotoLibraryVideoPrompt from 'calypso/assets/images/customer-home/illustration--secondary-wp-courses.svg'; import { EDUCATION_WPCOURSES } from 'calypso/my-sites/customer-home/cards/constants'; import EducationalContent from '../educational-content'; diff --git a/client/my-sites/customer-home/cards/features/go-mobile/index.jsx b/client/my-sites/customer-home/cards/features/go-mobile/index.jsx index c6b81c6f3b0259..61d4fa99095d20 100644 --- a/client/my-sites/customer-home/cards/features/go-mobile/index.jsx +++ b/client/my-sites/customer-home/cards/features/go-mobile/index.jsx @@ -2,7 +2,6 @@ import config from '@automattic/calypso-config'; import { Card, Button } from '@automattic/components'; import classnames from 'classnames'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import AppsBadge from 'calypso/blocks/get-apps/apps-badge'; import CardHeading from 'calypso/components/card-heading'; diff --git a/client/my-sites/customer-home/cards/features/help-search/index.jsx b/client/my-sites/customer-home/cards/features/help-search/index.jsx index 4ad656dd02bd79..33e14a66a64f64 100644 --- a/client/my-sites/customer-home/cards/features/help-search/index.jsx +++ b/client/my-sites/customer-home/cards/features/help-search/index.jsx @@ -1,6 +1,5 @@ import { Card, Gridicon } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import { RESULT_ARTICLE } from 'calypso/blocks/inline-help/constants'; import HelpSearchCard from 'calypso/blocks/inline-help/inline-help-search-card'; diff --git a/client/my-sites/customer-home/cards/features/quick-start/index.js b/client/my-sites/customer-home/cards/features/quick-start/index.js index 9d7b9a7fc8b413..80cf2592021340 100644 --- a/client/my-sites/customer-home/cards/features/quick-start/index.js +++ b/client/my-sites/customer-home/cards/features/quick-start/index.js @@ -1,7 +1,6 @@ import { Button, Card } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import page from 'page'; -import React from 'react'; import { connect } from 'react-redux'; import CardHeading from 'calypso/components/card-heading'; import QueryConciergeInitial from 'calypso/components/data/query-concierge-initial'; diff --git a/client/my-sites/customer-home/cards/features/stats/index.jsx b/client/my-sites/customer-home/cards/features/stats/index.jsx index d668b409dda905..e6b6cd9563a467 100644 --- a/client/my-sites/customer-home/cards/features/stats/index.jsx +++ b/client/my-sites/customer-home/cards/features/stats/index.jsx @@ -2,7 +2,7 @@ import { Card } from '@automattic/components'; import classnames from 'classnames'; import { numberFormat, useTranslate } from 'i18n-calypso'; import moment from 'moment'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { connect, useDispatch } from 'react-redux'; import CardHeading from 'calypso/components/card-heading'; import Chart from 'calypso/components/chart'; diff --git a/client/my-sites/customer-home/cards/features/support/index.jsx b/client/my-sites/customer-home/cards/features/support/index.jsx index a347ff8509d133..e993053cbf9818 100644 --- a/client/my-sites/customer-home/cards/features/support/index.jsx +++ b/client/my-sites/customer-home/cards/features/support/index.jsx @@ -1,6 +1,5 @@ import { Card } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import happinessIllustration from 'calypso/assets/images/customer-home/happiness.png'; import CardHeading from 'calypso/components/card-heading'; diff --git a/client/my-sites/customer-home/cards/notices/celebrate-notice/index.jsx b/client/my-sites/customer-home/cards/notices/celebrate-notice/index.jsx index 88bfa0c86ba5f4..4ba56e57815950 100644 --- a/client/my-sites/customer-home/cards/notices/celebrate-notice/index.jsx +++ b/client/my-sites/customer-home/cards/notices/celebrate-notice/index.jsx @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { isDesktop } from '@automattic/viewport'; import classnames from 'classnames'; -import React, { useState } from 'react'; +import { useState } from 'react'; import { connect, useDispatch } from 'react-redux'; import fireworksIllustration from 'calypso/assets/images/customer-home/illustration--fireworks-v2.svg'; import Spinner from 'calypso/components/spinner'; diff --git a/client/my-sites/customer-home/cards/notices/celebrate-site-creation/index.jsx b/client/my-sites/customer-home/cards/notices/celebrate-site-creation/index.jsx index 8d33985a28ba9b..63dc23b47bcb62 100644 --- a/client/my-sites/customer-home/cards/notices/celebrate-site-creation/index.jsx +++ b/client/my-sites/customer-home/cards/notices/celebrate-site-creation/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { NOTICE_CELEBRATE_SITE_CREATION } from 'calypso/my-sites/customer-home/cards/constants'; import CelebrateNotice from 'calypso/my-sites/customer-home/cards/notices/celebrate-notice'; diff --git a/client/my-sites/customer-home/cards/notices/celebrate-site-launch/index.jsx b/client/my-sites/customer-home/cards/notices/celebrate-site-launch/index.jsx index 2a3d51ef612ea0..8ee7414b3ebe86 100644 --- a/client/my-sites/customer-home/cards/notices/celebrate-site-launch/index.jsx +++ b/client/my-sites/customer-home/cards/notices/celebrate-site-launch/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect, useDispatch } from 'react-redux'; import launchedIllustration from 'calypso/assets/images/customer-home/illustration--rocket.svg'; import { diff --git a/client/my-sites/customer-home/cards/notices/celebrate-site-migration/index.jsx b/client/my-sites/customer-home/cards/notices/celebrate-site-migration/index.jsx index 35c0e23e243725..3549e81a1307bf 100644 --- a/client/my-sites/customer-home/cards/notices/celebrate-site-migration/index.jsx +++ b/client/my-sites/customer-home/cards/notices/celebrate-site-migration/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import migrationIllustration from 'calypso/assets/images/customer-home/illustration--import-complete.svg'; import { NOTICE_CELEBRATE_SITE_MIGRATION } from 'calypso/my-sites/customer-home/cards/constants'; import CelebrateNotice from 'calypso/my-sites/customer-home/cards/notices/celebrate-notice'; diff --git a/client/my-sites/customer-home/cards/notices/celebrate-site-setup-complete/index.jsx b/client/my-sites/customer-home/cards/notices/celebrate-site-setup-complete/index.jsx index 33bd1e7af2f1b8..3240ff6f687360 100644 --- a/client/my-sites/customer-home/cards/notices/celebrate-site-setup-complete/index.jsx +++ b/client/my-sites/customer-home/cards/notices/celebrate-site-setup-complete/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import checklistIllustration from 'calypso/assets/images/customer-home/illustration--checklist-complete.svg'; import { NOTICE_CELEBRATE_SITE_SETUP_COMPLETE } from 'calypso/my-sites/customer-home/cards/constants'; import CelebrateNotice from 'calypso/my-sites/customer-home/cards/notices/celebrate-notice'; diff --git a/client/my-sites/customer-home/cards/tasks/cloudflare/index.js b/client/my-sites/customer-home/cards/tasks/cloudflare/index.js index 5f573efc2a3fa8..62659ec25f4f5f 100644 --- a/client/my-sites/customer-home/cards/tasks/cloudflare/index.js +++ b/client/my-sites/customer-home/cards/tasks/cloudflare/index.js @@ -1,6 +1,5 @@ import config from '@automattic/calypso-config'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import growthSummitIllustration from 'calypso/assets/images/customer-home/illustration--task-cloudflare.svg'; import { TASK_CLOUDFLARE } from 'calypso/my-sites/customer-home/cards/constants'; import Task from 'calypso/my-sites/customer-home/cards/tasks/task'; diff --git a/client/my-sites/customer-home/cards/tasks/connect-accounts/index.jsx b/client/my-sites/customer-home/cards/tasks/connect-accounts/index.jsx index 5568d72d8d7831..0cfe7773748c25 100644 --- a/client/my-sites/customer-home/cards/tasks/connect-accounts/index.jsx +++ b/client/my-sites/customer-home/cards/tasks/connect-accounts/index.jsx @@ -1,6 +1,5 @@ import { isMobile } from '@automattic/viewport'; import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import connectSocialAccountsIllustration from 'calypso/assets/images/customer-home/illustration--task-connect-social-accounts.svg'; import QueryPublicizeConnections from 'calypso/components/data/query-publicize-connections'; diff --git a/client/my-sites/customer-home/cards/tasks/earn-features/index.jsx b/client/my-sites/customer-home/cards/tasks/earn-features/index.jsx index 1ca15596bed214..0eb64d51fd9cdf 100644 --- a/client/my-sites/customer-home/cards/tasks/earn-features/index.jsx +++ b/client/my-sites/customer-home/cards/tasks/earn-features/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import earnIllustration from 'calypso/assets/images/customer-home/illustration--task-earn.svg'; import { TASK_EARN_FEATURES } from 'calypso/my-sites/customer-home/cards/constants'; diff --git a/client/my-sites/customer-home/cards/tasks/find-domain/index.jsx b/client/my-sites/customer-home/cards/tasks/find-domain/index.jsx index 1a8abcaba4eecc..03feb5449430cb 100644 --- a/client/my-sites/customer-home/cards/tasks/find-domain/index.jsx +++ b/client/my-sites/customer-home/cards/tasks/find-domain/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import findDomainIllustration from 'calypso/assets/images/customer-home/illustration--task-find-domain.svg'; import { preventWidows } from 'calypso/lib/formatting'; diff --git a/client/my-sites/customer-home/cards/tasks/go-mobile/index.js b/client/my-sites/customer-home/cards/tasks/go-mobile/index.js index 78397927b8dd99..18b03826d8a67e 100644 --- a/client/my-sites/customer-home/cards/tasks/go-mobile/index.js +++ b/client/my-sites/customer-home/cards/tasks/go-mobile/index.js @@ -1,6 +1,5 @@ import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; import AppsBadge from 'calypso/blocks/get-apps/apps-badge'; import { preventWidows } from 'calypso/lib/formatting'; import { diff --git a/client/my-sites/customer-home/cards/tasks/growth-summit/index.jsx b/client/my-sites/customer-home/cards/tasks/growth-summit/index.jsx index c5aaaba718380f..6b05520b08d8be 100644 --- a/client/my-sites/customer-home/cards/tasks/growth-summit/index.jsx +++ b/client/my-sites/customer-home/cards/tasks/growth-summit/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import growthSummitIllustration from 'calypso/assets/images/customer-home/illustration--growth-summit.png'; import { TASK_GROWTH_SUMMIT } from 'calypso/my-sites/customer-home/cards/constants'; import Task from 'calypso/my-sites/customer-home/cards/tasks/task'; diff --git a/client/my-sites/customer-home/cards/tasks/podcasting/index.jsx b/client/my-sites/customer-home/cards/tasks/podcasting/index.jsx index 134e5ffec76c9a..1b490356d508cc 100644 --- a/client/my-sites/customer-home/cards/tasks/podcasting/index.jsx +++ b/client/my-sites/customer-home/cards/tasks/podcasting/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import podcastingIllustration from 'calypso/assets/images/customer-home/illustration--task-podcasting.svg'; import { TASK_PODCASTING } from 'calypso/my-sites/customer-home/cards/constants'; import Task from 'calypso/my-sites/customer-home/cards/tasks/task'; diff --git a/client/my-sites/customer-home/cards/tasks/renew/index.js b/client/my-sites/customer-home/cards/tasks/renew/index.js index 366163a38c5af4..ee11a4d3ffb992 100644 --- a/client/my-sites/customer-home/cards/tasks/renew/index.js +++ b/client/my-sites/customer-home/cards/tasks/renew/index.js @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import expiredIllustration from 'calypso/assets/images/customer-home/disconnected-dark.svg'; import expiringIllustration from 'calypso/assets/images/customer-home/disconnected.svg'; diff --git a/client/my-sites/customer-home/cards/tasks/site-setup-checklist-ecommerce/index.jsx b/client/my-sites/customer-home/cards/tasks/site-setup-checklist-ecommerce/index.jsx index d54da9272ab08b..8ad195160f3ec9 100644 --- a/client/my-sites/customer-home/cards/tasks/site-setup-checklist-ecommerce/index.jsx +++ b/client/my-sites/customer-home/cards/tasks/site-setup-checklist-ecommerce/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { connect } from 'react-redux'; import earnSectionImage from 'calypso/assets/images/earn/earn-section.svg'; import { TASK_SITE_SETUP_CHECKLIST_ECOMMERCE } from 'calypso/my-sites/customer-home/cards/constants'; diff --git a/client/my-sites/customer-home/cards/tasks/site-setup-list/current-task-item.jsx b/client/my-sites/customer-home/cards/tasks/site-setup-list/current-task-item.jsx index 1d74e941e9d972..257ea41fbd2bc7 100644 --- a/client/my-sites/customer-home/cards/tasks/site-setup-list/current-task-item.jsx +++ b/client/my-sites/customer-home/cards/tasks/site-setup-list/current-task-item.jsx @@ -1,7 +1,6 @@ import { Button, Gridicon } from '@automattic/components'; import classnames from 'classnames'; import { translate } from 'i18n-calypso'; -import React from 'react'; import Badge from 'calypso/components/badge'; const CurrentTaskItem = ( { currentTask, skipTask, startTask, useAccordionLayout } ) => { diff --git a/client/my-sites/customer-home/cards/tasks/site-setup-list/get-task.js b/client/my-sites/customer-home/cards/tasks/site-setup-list/get-task.js index f784a2b26a1bb0..c615e302efd603 100644 --- a/client/my-sites/customer-home/cards/tasks/site-setup-list/get-task.js +++ b/client/my-sites/customer-home/cards/tasks/site-setup-list/get-task.js @@ -1,5 +1,4 @@ import { translate } from 'i18n-calypso'; -import React from 'react'; import InlineSupportLink from 'calypso/components/inline-support-link'; import { localizeUrl } from 'calypso/lib/i18n-utils'; import { domainManagementEdit, domainManagementList } from 'calypso/my-sites/domains/paths'; diff --git a/client/my-sites/customer-home/cards/tasks/site-setup-list/index.jsx b/client/my-sites/customer-home/cards/tasks/site-setup-list/index.jsx index 786e97474ac95b..61576bed7f72d5 100644 --- a/client/my-sites/customer-home/cards/tasks/site-setup-list/index.jsx +++ b/client/my-sites/customer-home/cards/tasks/site-setup-list/index.jsx @@ -2,7 +2,7 @@ import { Card } from '@automattic/components'; import { isDesktop, isWithinBreakpoint, subscribeIsWithinBreakpoint } from '@automattic/viewport'; import classnames from 'classnames'; import { translate } from 'i18n-calypso'; -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import { connect, useDispatch } from 'react-redux'; import CardHeading from 'calypso/components/card-heading'; import Spinner from 'calypso/components/spinner'; diff --git a/client/my-sites/customer-home/cards/tasks/site-setup-list/nav-item.jsx b/client/my-sites/customer-home/cards/tasks/site-setup-list/nav-item.jsx index b9d5712399e039..c27e61527ca3d5 100644 --- a/client/my-sites/customer-home/cards/tasks/site-setup-list/nav-item.jsx +++ b/client/my-sites/customer-home/cards/tasks/site-setup-list/nav-item.jsx @@ -1,7 +1,6 @@ import { Gridicon } from '@automattic/components'; import classnames from 'classnames'; import { translate } from 'i18n-calypso'; -import React from 'react'; import { useDispatch } from 'react-redux'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; diff --git a/client/my-sites/customer-home/cards/tasks/task.jsx b/client/my-sites/customer-home/cards/tasks/task.jsx index 64a2107e9f1300..a95c8d20bfd4fd 100644 --- a/client/my-sites/customer-home/cards/tasks/task.jsx +++ b/client/my-sites/customer-home/cards/tasks/task.jsx @@ -3,7 +3,7 @@ import { isDesktop } from '@automattic/viewport'; import { useInstanceId } from '@wordpress/compose'; import classnames from 'classnames'; import { useTranslate } from 'i18n-calypso'; -import React, { useEffect, useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; import { connect, useDispatch } from 'react-redux'; import Badge from 'calypso/components/badge'; import PopoverMenu from 'calypso/components/popover-menu'; diff --git a/client/my-sites/customer-home/cards/tasks/titan-banner/index.jsx b/client/my-sites/customer-home/cards/tasks/titan-banner/index.jsx index 29aa2d7728e1d2..0ed970a168bf61 100644 --- a/client/my-sites/customer-home/cards/tasks/titan-banner/index.jsx +++ b/client/my-sites/customer-home/cards/tasks/titan-banner/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import { useSelector } from 'react-redux'; import emailIllustration from 'calypso/assets/images/email-providers/email-illustration.svg'; import { TASK_UPSELL_TITAN } from 'calypso/my-sites/customer-home/cards/constants'; diff --git a/client/my-sites/customer-home/cards/tasks/webinars/index.jsx b/client/my-sites/customer-home/cards/tasks/webinars/index.jsx index 6d1c3b5b16b836..9a8a1fe30a6c37 100644 --- a/client/my-sites/customer-home/cards/tasks/webinars/index.jsx +++ b/client/my-sites/customer-home/cards/tasks/webinars/index.jsx @@ -1,5 +1,4 @@ import { useTranslate } from 'i18n-calypso'; -import React from 'react'; import webinarsIllustration from 'calypso/assets/images/customer-home/illustration-webinars.svg'; import { TASK_WEBINARS } from 'calypso/my-sites/customer-home/cards/constants'; import Task from 'calypso/my-sites/customer-home/cards/tasks/task'; diff --git a/client/my-sites/customer-home/cards/tasks/wp-courses/index.jsx b/client/my-sites/customer-home/cards/tasks/wp-courses/index.jsx index 3113d5485f8d90..78aa933d5a5d31 100644 --- a/client/my-sites/customer-home/cards/tasks/wp-courses/index.jsx +++ b/client/my-sites/customer-home/cards/tasks/wp-courses/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import coursesLogo from 'calypso/assets/images/customer-home/courses-logo.png'; import { TASK_WP_COURSES } from 'calypso/my-sites/customer-home/cards/constants'; import Task from 'calypso/my-sites/customer-home/cards/tasks/task'; diff --git a/client/my-sites/customer-home/controller.jsx b/client/my-sites/customer-home/controller.jsx index c60b3b6269ed76..390cdcbe77c8f5 100644 --- a/client/my-sites/customer-home/controller.jsx +++ b/client/my-sites/customer-home/controller.jsx @@ -1,5 +1,4 @@ import page from 'page'; -import React from 'react'; import { canCurrentUserUseCustomerHome } from 'calypso/state/sites/selectors'; import { getSelectedSiteSlug, getSelectedSiteId } from 'calypso/state/ui/selectors'; import CustomerHome from './main'; diff --git a/client/my-sites/customer-home/locations/primary/index.jsx b/client/my-sites/customer-home/locations/primary/index.jsx index 83a0fc0249f672..5580b7f70f6456 100644 --- a/client/my-sites/customer-home/locations/primary/index.jsx +++ b/client/my-sites/customer-home/locations/primary/index.jsx @@ -1,5 +1,5 @@ import classnames from 'classnames'; -import React, { useEffect, useRef } from 'react'; +import { createElement, useEffect, useRef } from 'react'; import { connect } from 'react-redux'; import DotPager from 'calypso/components/dot-pager'; import { withPerformanceTrackerStop } from 'calypso/lib/performance-tracking'; @@ -93,7 +93,7 @@ const Primary = ( { cards, trackCard } ) => { const isUrgent = cards.length === 1 && cards[ 0 ] === TASK_RENEW_EXPIRED_PLAN; return ( - { { cards.map( ( card, index ) => cardComponents[ card ] && - React.createElement( cardComponents[ card ], { + createElement( cardComponents[ card ], { key: index, isIos: card === 'home-task-go-mobile-ios' ? true : null, card, } ) ) } - ); + ); }; const trackCardImpression = ( card ) => { diff --git a/client/my-sites/customer-home/locations/secondary/index.jsx b/client/my-sites/customer-home/locations/secondary/index.jsx index de8cff2a75446d..3f713e98927a79 100644 --- a/client/my-sites/customer-home/locations/secondary/index.jsx +++ b/client/my-sites/customer-home/locations/secondary/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { createElement } from 'react'; import { FEATURE_STATS, SECTION_LEARN_GROW, @@ -22,17 +22,15 @@ const Secondary = ( { cards } ) => { return null; } - return ( - <> - { cards.map( - ( card ) => - cardComponents[ card ] && - React.createElement( cardComponents[ card ], { - key: card, - } ) - ) } - - ); + return <> + { cards.map( + ( card ) => + cardComponents[ card ] && + createElement( cardComponents[ card ], { + key: card, + } ) + ) } + ; }; export default Secondary; diff --git a/client/my-sites/customer-home/locations/secondary/learn-grow/index.jsx b/client/my-sites/customer-home/locations/secondary/learn-grow/index.jsx index b350d5d3a8e047..a5465891036b20 100644 --- a/client/my-sites/customer-home/locations/secondary/learn-grow/index.jsx +++ b/client/my-sites/customer-home/locations/secondary/learn-grow/index.jsx @@ -1,6 +1,6 @@ import config from '@automattic/calypso-config'; import { useTranslate } from 'i18n-calypso'; -import React, { useRef, useEffect } from 'react'; +import { createElement, useRef, useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import DotPager from 'calypso/components/dot-pager'; import useHomeLayoutQuery from 'calypso/data/home/use-home-layout-query'; @@ -53,7 +53,7 @@ const LearnGrow = () => { } return ( - { { cards.map( ( card, index ) => cardComponents[ card ] && - React.createElement( cardComponents[ card ], { + createElement( cardComponents[ card ], { key: index, } ) ) } - ); + ); }; function useLearnGrowCards() { diff --git a/client/my-sites/customer-home/locations/tertiary/index.jsx b/client/my-sites/customer-home/locations/tertiary/index.jsx index abb08032d81ac4..e5325d591631fd 100644 --- a/client/my-sites/customer-home/locations/tertiary/index.jsx +++ b/client/my-sites/customer-home/locations/tertiary/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { createElement } from 'react'; import { SECTION_MANAGE_SITE } from 'calypso/my-sites/customer-home/cards/constants'; import ManageSite from './manage-site'; @@ -11,17 +11,15 @@ const Tertiary = ( { cards } ) => { return null; } - return ( - <> - { cards.map( - ( card, index ) => - cardComponents[ card ] && - React.createElement( cardComponents[ card ], { - key: index, - } ) - ) } - - ); + return <> + { cards.map( + ( card, index ) => + cardComponents[ card ] && + createElement( cardComponents[ card ], { + key: index, + } ) + ) } + ; }; export default Tertiary; diff --git a/client/my-sites/customer-home/locations/tertiary/manage-site/index.jsx b/client/my-sites/customer-home/locations/tertiary/manage-site/index.jsx index 37131d313cf10e..b29f78ec8dc89f 100644 --- a/client/my-sites/customer-home/locations/tertiary/manage-site/index.jsx +++ b/client/my-sites/customer-home/locations/tertiary/manage-site/index.jsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import { createElement, useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import useHomeLayoutQuery from 'calypso/data/home/use-home-layout-query'; import QuickLinks from 'calypso/my-sites/customer-home/cards/actions/quick-links'; @@ -38,17 +38,15 @@ const ManageSite = () => { return null; } - return ( - <> - { cards.map( - ( card, index ) => - cardComponents[ card ] && - React.createElement( cardComponents[ card ], { - key: index, - } ) - ) } - - ); + return <> + { cards.map( + ( card, index ) => + cardComponents[ card ] && + createElement( cardComponents[ card ], { + key: index, + } ) + ) } + ; }; function useManageSiteCards() { diff --git a/client/my-sites/customer-home/main.jsx b/client/my-sites/customer-home/main.jsx index 2e80de6e9e837d..88f81dcb61b351 100644 --- a/client/my-sites/customer-home/main.jsx +++ b/client/my-sites/customer-home/main.jsx @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { useEffect, useRef } from 'react'; +import { useEffect, useRef } from 'react'; import { connect, useDispatch } from 'react-redux'; import DocumentHead from 'calypso/components/data/document-head'; import QuerySiteChecklist from 'calypso/components/data/query-site-checklist'; diff --git a/client/my-sites/customize/controller.js b/client/my-sites/customize/controller.js index 5456dfe529d025..1f84fa31021f30 100644 --- a/client/my-sites/customize/controller.js +++ b/client/my-sites/customize/controller.js @@ -1,5 +1,5 @@ import i18n from 'i18n-calypso'; -import React from 'react'; +import { createElement } from 'react'; import CustomizeComponent from 'calypso/my-sites/customize/main'; import { setDocumentHeadTitle as setTitle } from 'calypso/state/document-head/actions'; @@ -7,7 +7,7 @@ export function customize( context, next ) { // FIXME: Auto-converted from the setTitle action. Please use instead. context.store.dispatch( setTitle( i18n.translate( 'Customizer', { textOnly: true } ) ) ); - context.primary = React.createElement( CustomizeComponent, { + context.primary = createElement( CustomizeComponent, { domain: context.params.domain || '', pathname: context.pathname, prevPath: context.prevPath || '', diff --git a/client/my-sites/customize/loading-panel.jsx b/client/my-sites/customize/loading-panel.jsx index 6b70728507fa24..17ca920fa021a6 100644 --- a/client/my-sites/customize/loading-panel.jsx +++ b/client/my-sites/customize/loading-panel.jsx @@ -1,10 +1,10 @@ import classnames from 'classnames'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import Spinner from 'calypso/components/spinner'; -class CustomizerLoadingPanel extends React.Component { +class CustomizerLoadingPanel extends Component { static displayName = 'CustomizerLoadingPanel'; static propTypes = { diff --git a/client/my-sites/customize/main.jsx b/client/my-sites/customize/main.jsx index de9d28ceeba050..88bf9fc45a96a6 100644 --- a/client/my-sites/customize/main.jsx +++ b/client/my-sites/customize/main.jsx @@ -5,7 +5,7 @@ import { cloneDeep, get, startsWith } from 'lodash'; import page from 'page'; import PropTypes from 'prop-types'; import { stringify } from 'qs'; -import React from 'react'; +import { Component } from 'react'; import { connect } from 'react-redux'; import EmptyContent from 'calypso/components/empty-content'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; @@ -27,7 +27,7 @@ const debug = debugFactory( 'calypso:my-sites:customize' ); // Used to allow timing-out the iframe loading process let loadingTimer; -class Customize extends React.Component { +class Customize extends Component { constructor( props ) { super( props ); this.state = { diff --git a/client/my-sites/domains/components/domain-warnings/index.jsx b/client/my-sites/domains/components/domain-warnings/index.jsx index c2b1d8e9a1824b..29b2fb260b366c 100644 --- a/client/my-sites/domains/components/domain-warnings/index.jsx +++ b/client/my-sites/domains/components/domain-warnings/index.jsx @@ -2,7 +2,7 @@ import _debug from 'debug'; import { localize } from 'i18n-calypso'; import { intersection, map, find, get } from 'lodash'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; import Notice from 'calypso/components/notice'; @@ -51,7 +51,7 @@ const expiringDomainsCanManageWarning = 'expiring-domains-can-manage'; const expiringDomainsCannotManageWarning = 'expiring-domains-cannot-manage'; const newTransfersWrongNSWarning = 'new-transfer-wrong-ns'; -export class DomainWarnings extends React.PureComponent { +export class DomainWarnings extends PureComponent { static propTypes = { domains: PropTypes.array, allowedRules: PropTypes.array, diff --git a/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice-action.js b/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice-action.js index 71a0b7b8b2dcfc..4dd041d1ec36ea 100644 --- a/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice-action.js +++ b/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice-action.js @@ -1,7 +1,7 @@ import { Button } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Fragment, useState } from 'react'; +import { Fragment, useState } from 'react'; import PendingGSuiteTosNoticeDialog from './pending-gsuite-tos-notice-dialog'; function PendingGSuiteTosNoticeAction( props ) { diff --git a/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice-dialog.jsx b/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice-dialog.jsx index 58515709715c22..027f536267210d 100644 --- a/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice-dialog.jsx +++ b/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice-dialog.jsx @@ -1,7 +1,7 @@ import { Button, Dialog, Gridicon } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React, { Fragment, useState } from 'react'; +import { Fragment, useState } from 'react'; import { connect } from 'react-redux'; import ClipboardButton from 'calypso/components/forms/clipboard-button'; import VerticalNav from 'calypso/components/vertical-nav'; diff --git a/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice.jsx b/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice.jsx index 312faec41c7025..7a299fa5497a35 100644 --- a/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice.jsx +++ b/client/my-sites/domains/components/domain-warnings/pending-gsuite-tos-notice.jsx @@ -1,6 +1,6 @@ import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import { withLocalizedMoment } from 'calypso/components/localized-moment'; import Notice from 'calypso/components/notice'; @@ -16,7 +16,7 @@ import PendingGSuiteTosNoticeAction from './pending-gsuite-tos-notice-action'; import './style.scss'; const strong = ; -class PendingGSuiteTosNotice extends React.PureComponent { +class PendingGSuiteTosNotice extends PureComponent { static propTypes = { siteSlug: PropTypes.string.isRequired, domains: PropTypes.array.isRequired, diff --git a/client/my-sites/domains/components/domain-warnings/test/index.js b/client/my-sites/domains/components/domain-warnings/test/index.js index 07a79a104ab71f..019d932f8a6ccc 100644 --- a/client/my-sites/domains/components/domain-warnings/test/index.js +++ b/client/my-sites/domains/components/domain-warnings/test/index.js @@ -3,7 +3,6 @@ */ import moment from 'moment'; -import React from 'react'; import ReactDom from 'react-dom'; import TestUtils from 'react-dom/test-utils'; import { type as domainTypes } from 'calypso/lib/domains/constants'; diff --git a/client/my-sites/domains/components/form/country-select.jsx b/client/my-sites/domains/components/form/country-select.jsx index 626054714641a7..de9a52178cd181 100644 --- a/client/my-sites/domains/components/form/country-select.jsx +++ b/client/my-sites/domains/components/form/country-select.jsx @@ -1,13 +1,13 @@ import classNames from 'classnames'; import { localize, translate } from 'i18n-calypso'; import { isEmpty } from 'lodash'; -import React from 'react'; +import { PureComponent } from 'react'; import FormInputValidation from 'calypso/components/forms/form-input-validation'; import FormLabel from 'calypso/components/forms/form-label'; import FormSelect from 'calypso/components/forms/form-select'; import { gaRecordEvent } from 'calypso/lib/analytics/ga'; -class CountrySelect extends React.PureComponent { +class CountrySelect extends PureComponent { recordCountrySelectClick = () => { if ( this.props.eventFormName ) { gaRecordEvent( 'Upgrades', `Clicked ${ this.props.eventFormName } Country Select` ); diff --git a/client/my-sites/domains/components/form/hidden-input.jsx b/client/my-sites/domains/components/form/hidden-input.jsx index cc4b9beb556fdc..796791f0329f7a 100644 --- a/client/my-sites/domains/components/form/hidden-input.jsx +++ b/client/my-sites/domains/components/form/hidden-input.jsx @@ -1,7 +1,7 @@ /* eslint-disable jsx-a11y/anchor-is-valid */ import { isEmpty } from 'lodash'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import Input from './input'; export class HiddenInput extends PureComponent { diff --git a/client/my-sites/domains/components/form/input.jsx b/client/my-sites/domains/components/form/input.jsx index f120fd37ccefd5..44e000b6104cbb 100644 --- a/client/my-sites/domains/components/form/input.jsx +++ b/client/my-sites/domains/components/form/input.jsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React from 'react'; +import { Component } from 'react'; import FormInputValidation from 'calypso/components/forms/form-input-validation'; import FormLabel from 'calypso/components/forms/form-label'; import FormSettingExplanation from 'calypso/components/forms/form-setting-explanation'; @@ -7,7 +7,7 @@ import FormTextInput from 'calypso/components/forms/form-text-input'; import { gaRecordEvent } from 'calypso/lib/analytics/ga'; import scrollIntoViewport from 'calypso/lib/scroll-into-viewport'; -export default class Input extends React.Component { +export default class Input extends Component { static defaultProps = { autoFocus: false, autoComplete: 'on' }; inputRef = ( element ) => { diff --git a/client/my-sites/domains/components/form/select.jsx b/client/my-sites/domains/components/form/select.jsx index 183725062d782c..d8520bf2dd198f 100644 --- a/client/my-sites/domains/components/form/select.jsx +++ b/client/my-sites/domains/components/form/select.jsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import FormInputValidation from 'calypso/components/forms/form-input-validation'; import FormLabel from 'calypso/components/forms/form-label'; import FormSelect from 'calypso/components/forms/form-select'; diff --git a/client/my-sites/domains/components/form/state-select.jsx b/client/my-sites/domains/components/form/state-select.jsx index 7f4a88cc33bc0a..ae7f1c6ce6ca87 100644 --- a/client/my-sites/domains/components/form/state-select.jsx +++ b/client/my-sites/domains/components/form/state-select.jsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import { localize } from 'i18n-calypso'; import { isEmpty } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import QueryCountryStates from 'calypso/components/data/query-country-states'; import FormInputValidation from 'calypso/components/forms/form-input-validation'; diff --git a/client/my-sites/domains/components/form/test/hidden-input.js b/client/my-sites/domains/components/form/test/hidden-input.js index e9a9ed383c39ec..6b059cc0162b28 100644 --- a/client/my-sites/domains/components/form/test/hidden-input.js +++ b/client/my-sites/domains/components/form/test/hidden-input.js @@ -4,7 +4,6 @@ import { expect } from 'chai'; import { shallow } from 'enzyme'; -import React from 'react'; import { HiddenInput } from '../hidden-input'; describe( 'HiddenInput', () => { diff --git a/client/my-sites/domains/components/form/test/select.js b/client/my-sites/domains/components/form/test/select.js index edc2c0a26fd8d4..a01ceac13bcf76 100644 --- a/client/my-sites/domains/components/form/test/select.js +++ b/client/my-sites/domains/components/form/test/select.js @@ -3,7 +3,6 @@ */ import { shallow } from 'enzyme'; -import React from 'react'; import Select from '../select'; describe( ' bar'; const placeholder = 'bar'; const translatedComponent = translate( 'foo {{ input /}} %(placeholder)s', { @@ -175,7 +175,7 @@ describe( 'I18n', function () { placeholder: placeholder, }, } ); - const instance = React.createElement( 'span', null, translatedComponent ); + const instance = createElement( 'span', null, translatedComponent ); expect( stripReactAttributes( ReactDomServer.renderToStaticMarkup( instance ) ) ).toBe( expectedResultString diff --git a/packages/i18n-calypso/test/localize.js b/packages/i18n-calypso/test/localize.js index 37eab1a4f61d08..578b4d97b41178 100644 --- a/packages/i18n-calypso/test/localize.js +++ b/packages/i18n-calypso/test/localize.js @@ -1,10 +1,10 @@ -import React from 'react'; +import { Component } from 'react'; import ShallowRenderer from 'react-test-renderer/shallow'; import i18n, { localize } from '../src'; describe( 'localize()', () => { it( 'should be named using the variable name of the composed component', () => { - class MyComponent extends React.Component { + class MyComponent extends Component { render() { return null; } diff --git a/packages/i18n-calypso/test/use-translate.js b/packages/i18n-calypso/test/use-translate.js index 2bd2672a7f8083..d1f61ccf451d75 100644 --- a/packages/i18n-calypso/test/use-translate.js +++ b/packages/i18n-calypso/test/use-translate.js @@ -2,7 +2,6 @@ * @jest-environment jsdom */ -import React from 'react'; import ReactDOM from 'react-dom'; import { act } from 'react-dom/test-utils'; import i18n, { useTranslate } from '../src'; diff --git a/packages/plans-grid/src/segmented-control/index.jsx b/packages/plans-grid/src/segmented-control/index.jsx index 160c6b6e71c509..682a1419048f43 100644 --- a/packages/plans-grid/src/segmented-control/index.jsx +++ b/packages/plans-grid/src/segmented-control/index.jsx @@ -1,11 +1,11 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; import SegmentedControlItem from './item'; import './style.scss'; -export default class SegmentedControl extends React.Component { +export default class SegmentedControl extends Component { static Item = SegmentedControlItem; static propTypes = { diff --git a/packages/plans-grid/src/segmented-control/item.jsx b/packages/plans-grid/src/segmented-control/item.jsx index 7ce35a3492b2b8..1882eb6f017999 100644 --- a/packages/plans-grid/src/segmented-control/item.jsx +++ b/packages/plans-grid/src/segmented-control/item.jsx @@ -1,8 +1,8 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; -import React from 'react'; +import { Component } from 'react'; -class SegmentedControlItem extends React.Component { +class SegmentedControlItem extends Component { static propTypes = { children: PropTypes.node.isRequired, path: PropTypes.string, diff --git a/packages/plans-grid/src/segmented-control/simplified.jsx b/packages/plans-grid/src/segmented-control/simplified.jsx index c11b46226fde97..6c8ff0edb53d8e 100644 --- a/packages/plans-grid/src/segmented-control/simplified.jsx +++ b/packages/plans-grid/src/segmented-control/simplified.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { useState } from 'react'; +import { useState } from 'react'; import SegmentedControl from '.'; const noop = () => {}; diff --git a/packages/search/src/search.stories.jsx b/packages/search/src/search.stories.jsx index c40c3040a07b6d..c07e02ce95e37d 100644 --- a/packages/search/src/search.stories.jsx +++ b/packages/search/src/search.stories.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import Search from './search'; export default { title: 'Search', component: Search }; diff --git a/packages/search/src/test/index.js b/packages/search/src/test/index.js index 411a384f12a7ef..9410c3512d2e9c 100644 --- a/packages/search/src/test/index.js +++ b/packages/search/src/test/index.js @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import React from 'react'; +import { createRef, useReducer } from 'react'; import { act } from 'react-dom/test-utils'; import Search from '..'; @@ -10,7 +10,7 @@ describe( 'search', () => { let ref; beforeEach( () => { - ref = React.createRef(); + ref = createRef(); render( ); } ); @@ -168,7 +168,7 @@ describe( 'search', () => { it( 'should not call onSearch with current value when the prop changes', () => { function SearchWithHistory() { - const [ history, push ] = React.useReducer( ( list, item ) => [ ...list, item ], [] ); + const [ history, push ] = useReducer( ( list, item ) => [ ...list, item ], [] ); return (
push( keyword ) } /> diff --git a/packages/social-previews/src/facebook-preview/index.jsx b/packages/social-previews/src/facebook-preview/index.jsx index 76d3c96fff41f3..3ebb6caae71f4d 100644 --- a/packages/social-previews/src/facebook-preview/index.jsx +++ b/packages/social-previews/src/facebook-preview/index.jsx @@ -1,6 +1,6 @@ import { compact } from 'lodash'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { firstValid, hardTruncation, shortEnough, stripHtmlTags } from '../helpers'; import './style.scss'; diff --git a/packages/social-previews/src/search-preview/index.jsx b/packages/social-previews/src/search-preview/index.jsx index 9e746029bf91be..7b7ac4f752392e 100644 --- a/packages/social-previews/src/search-preview/index.jsx +++ b/packages/social-previews/src/search-preview/index.jsx @@ -1,5 +1,4 @@ import PropTypes from 'prop-types'; -import React from 'react'; import { firstValid, hardTruncation, diff --git a/packages/social-previews/src/twitter-preview/index.jsx b/packages/social-previews/src/twitter-preview/index.jsx index 18017c88c7ddf2..f259d4c577696c 100644 --- a/packages/social-previews/src/twitter-preview/index.jsx +++ b/packages/social-previews/src/twitter-preview/index.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { Tweet } from './tweet'; import './style.scss'; diff --git a/packages/social-previews/src/twitter-preview/tweet.jsx b/packages/social-previews/src/twitter-preview/tweet.jsx index 2f3ced1f870b24..a160629ab3fee8 100644 --- a/packages/social-previews/src/twitter-preview/tweet.jsx +++ b/packages/social-previews/src/twitter-preview/tweet.jsx @@ -3,7 +3,7 @@ import { __ } from '@wordpress/i18n'; import classnames from 'classnames'; import moment from 'moment'; import PropTypes from 'prop-types'; -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import { firstValid, hardTruncation, shortEnough, stripHtmlTags } from '../helpers'; import './style.scss'; diff --git a/packages/social-previews/test/index.js b/packages/social-previews/test/index.js index 282c873b7ec03f..fe78f19b1ab13d 100644 --- a/packages/social-previews/test/index.js +++ b/packages/social-previews/test/index.js @@ -6,7 +6,6 @@ import { shallow } from 'enzyme'; import moment from 'moment'; -import React from 'react'; import { FacebookPreview as Facebook, TwitterPreview as Twitter, diff --git a/packages/viewport-react/src/index.js b/packages/viewport-react/src/index.js index 0a8dcd424740d2..9ea6eb41a298a4 100644 --- a/packages/viewport-react/src/index.js +++ b/packages/viewport-react/src/index.js @@ -5,7 +5,7 @@ import { DESKTOP_BREAKPOINT, } from '@automattic/viewport'; import { createHigherOrderComponent } from '@wordpress/compose'; -import React, { forwardRef, useState, useEffect } from 'react'; +import { forwardRef, useState, useEffect } from 'react'; /** * React hook for getting the status for a breakpoint and keeping it updated. diff --git a/packages/viewport-react/test/index.js b/packages/viewport-react/test/index.js index bbedfbd79e59ff..2d613f87477d53 100644 --- a/packages/viewport-react/test/index.js +++ b/packages/viewport-react/test/index.js @@ -5,7 +5,7 @@ /* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["runComponentTests", "expect"] }] */ import 'regenerator-runtime'; -import React, { useState, useEffect } from 'react'; +import { Component, useState, useEffect } from 'react'; import ReactDOM from 'react-dom'; import { act } from 'react-dom/test-utils'; @@ -83,7 +83,7 @@ describe( '@automattic/viewport-react', () => { } // Auxiliary class for HOC tests. - class BaseComponent extends React.Component { + class BaseComponent extends Component { render() { const isActive = this.props.isBreakpointActive; return isActive ? 'true' : 'false'; @@ -226,7 +226,7 @@ describe( '@automattic/viewport-react', () => { } ); describe( 'withBreakpoint', () => { - class ExpectUndefinedComponent extends React.Component { + class ExpectUndefinedComponent extends Component { render() { const isActive = this.props.isBreakpointActive; return isActive === undefined ? 'undefined' : `unexpected value: ${ isActive }`; diff --git a/packages/whats-new/src/index.js b/packages/whats-new/src/index.js index dc53d54edf414e..3fada2909c5b02 100644 --- a/packages/whats-new/src/index.js +++ b/packages/whats-new/src/index.js @@ -1,7 +1,7 @@ import { useLocale } from '@automattic/i18n-utils'; import { Guide } from '@wordpress/components'; import { useI18n } from '@wordpress/react-i18n'; -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import wpcom from 'wpcom'; import proxyRequest from 'wpcom-proxy-request'; import WhatsNewPage from './whats-new-page'; diff --git a/packages/whats-new/src/whats-new-page.js b/packages/whats-new/src/whats-new-page.js index f128e897362281..b5c2ad2ad04844 100644 --- a/packages/whats-new/src/whats-new-page.js +++ b/packages/whats-new/src/whats-new-page.js @@ -1,7 +1,7 @@ import { recordTracksEvent } from '@automattic/calypso-analytics'; import { Button, GuidePage } from '@wordpress/components'; import { useI18n } from '@wordpress/react-i18n'; -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; function WhatsNewPage( { description, heading, imageSrc, isLastPage, link, pageNumber } ) { const __ = useI18n().__;