Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Remove unused React imports closes #407 #408

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: MIT
*/

import React, { useEffect, useRef, useState } from "react";
import { useEffect, useRef, useState } from "react";
import PropTypes from "prop-types";
import classNames from "classnames";

Expand Down
1 change: 0 additions & 1 deletion src/components/DropdownItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* License: MIT
*/

import React from "react";
import PropTypes from "prop-types";
import classNames from "classnames";

Expand Down
2 changes: 1 addition & 1 deletion src/components/ErrorBoundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: MIT
*/

import React, { Component } from "react";
import { Component } from "react";

import { BlockContent, CommonBlock } from "./plugin";
import MediaMessage from "./MediaMessage";
Expand Down
2 changes: 0 additions & 2 deletions src/components/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

const Link = ({ contentState, entityKey, children }) => {
const { url } = contentState.getEntity(entityKey).getData();
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Media.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: MIT
*/

import React, { useMemo, useCallback } from "react";
import { useMemo, useCallback } from "react";
import { EditorState, SelectionState, Modifier } from "draft-js";

import ErrorBoundary from "./ErrorBoundary";
Expand Down
1 change: 0 additions & 1 deletion src/components/MediaMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* License: MIT
*/

import React from "react";
import classNames from "classnames";

const MediaMessage = ({ text, type }) => {
Expand Down
2 changes: 0 additions & 2 deletions src/components/MediaWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

/*
* MediaWrapper component avoids Draft JS bugs when a custom block component
* is being updated by setting the editor's readOnly flag to true
Expand Down
20 changes: 10 additions & 10 deletions src/components/MegadraftEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
).__ = x => {
console.warn(
"__() has been deprecated and will be removed soon. " +
"You can move this code to your app, instead. __() code can be found at " +
"https://gist.github.com/marcelometal/768454831c0c10ee03b939187b7bebbf"
"You can move this code to your app, instead. __() code can be found at " +
"https://gist.github.com/marcelometal/768454831c0c10ee03b939187b7bebbf"
);
return x;
};

import React, { Component } from "react";
import { Component } from "react";
import {
Editor,
RichUtils,
Expand Down Expand Up @@ -50,7 +50,7 @@ const NO_RESET_STYLE_DEFAULT = ["ordered-list-item", "unordered-list-item"];
export default class MegadraftEditor extends Component {
static defaultProps = {
actions: DEFAULT_ACTIONS,
blockRendererFn: () => {},
blockRendererFn: () => { },
i18n: i18nConfig,
language: "en-US"
};
Expand Down Expand Up @@ -202,12 +202,12 @@ export default class MegadraftEditor extends Component {
});
const blockMap = contentState.getBlockMap();

const blocksBefore = blockMap.toSeq().takeUntil(function(v) {
const blocksBefore = blockMap.toSeq().takeUntil(function (v) {
return v === currentBlock;
});
const blocksAfter = blockMap
.toSeq()
.skipUntil(function(v) {
.skipUntil(function (v) {
return v === currentBlock;
})
.rest();
Expand Down Expand Up @@ -358,10 +358,10 @@ export default class MegadraftEditor extends Component {
// Class with styling to spacing placeholder.
if (!contentState.hasText()) {
switch (
contentState
.getBlockMap()
.first()
.getType()
contentState
.getBlockMap()
.first()
.getType()
) {
case "ordered-list-item":
case "unordered-list-item":
Expand Down
2 changes: 1 addition & 1 deletion src/components/ModalPluginItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: MIT
*/

import React, { Component } from "react";
import { Component } from "react";

import { ActionsContext } from "./ActionsProvider";
import { PLUGINS_MODAL_ADD_PLUGIN } from "../constants";
Expand Down
2 changes: 1 addition & 1 deletion src/components/ModalPluginList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: MIT
*/

import React, { Component } from "react";
import { Component } from "react";

import { ModalBody } from "backstage-modal";
import ModalPluginItem from "./ModalPluginItem";
Expand Down
2 changes: 1 addition & 1 deletion src/components/PluginsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: MIT
*/

import React, { useCallback } from "react";
import { useCallback } from "react";

import Modal from "backstage-modal";
import ModalPluginList from "./ModalPluginList";
Expand Down
2 changes: 0 additions & 2 deletions src/components/Separator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Separator() {
return <li className="toolbar__item toolbar__item--separator" />;
}
2 changes: 1 addition & 1 deletion src/components/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: MIT
*/

import React, { Component } from "react";
import { Component } from "react";
import ReactDOM from "react-dom";
import classNames from "classnames";
import icons from "../icons";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: MIT
*/

import React, { Component } from "react";
import { Component } from "react";
import PropTypes from "prop-types";
import { EditorState, RichUtils } from "draft-js";
import classNames from "classnames";
Expand Down
2 changes: 1 addition & 1 deletion src/components/ToolbarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: MIT
*/

import React, { Component } from "react";
import { Component } from "react";
import classNames from "classnames";

import Separator from "./Separator";
Expand Down
1 change: 0 additions & 1 deletion src/components/plugin/BlockAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* License: MIT
*/

import React from "react";
import PropTypes from "prop-types";

export default function BlockAction(props) {
Expand Down
1 change: 0 additions & 1 deletion src/components/plugin/BlockActionGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* License: MIT
*/

import React from "react";
import PropTypes from "prop-types";

import BlockAction from "./BlockAction";
Expand Down
1 change: 0 additions & 1 deletion src/components/plugin/BlockContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* License: MIT
*/

import React from "react";
import classNames from "classnames";

export default function BlockContent(props) {
Expand Down
2 changes: 0 additions & 2 deletions src/components/plugin/BlockControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function BlockControls(props) {
return <div className="block__controls">{props.children}</div>;
}
2 changes: 0 additions & 2 deletions src/components/plugin/BlockData.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function BlockData(props) {
return <div className="block__data">{props.children}</div>;
}
1 change: 0 additions & 1 deletion src/components/plugin/BlockInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* License: MIT
*/

import React from "react";
import classNames from "classnames";

import icons from "../../icons";
Expand Down
2 changes: 0 additions & 2 deletions src/components/plugin/BlockWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function BlockWrapper(props) {
return (
<div className={props.readOnly ? "block__hover--readonly" : "block__hover"}>
Expand Down
2 changes: 0 additions & 2 deletions src/components/plugin/CommonBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

import Dropdown from "../../components/Dropdown";
import {
BlockActionGroup,
Expand Down
2 changes: 1 addition & 1 deletion src/entity_inputs/LinkInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: MIT
*/

import React, { useRef, useState } from "react";
import { useRef, useState } from "react";
import icons from "../icons";

const addHttpPrefix = url => {
Expand Down
2 changes: 0 additions & 2 deletions src/icons/blockquote.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Blockquote() {
return (
<svg width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/bold.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Bold() {
return (
<svg width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/close.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Close() {
return (
<svg width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/crop.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Crop(props) {
return (
<svg {...props} width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/cross.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Cross(props) {
return (
<svg {...props} width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Delete(props) {
return (
<svg {...props} width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/dropdownArrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function DropDownArrow(props) {
return (
<svg {...props} width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Edit(props) {
return (
<svg {...props} width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/ellipsis.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Ellipsis() {
return (
<svg width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Error(props) {
return (
<svg {...props} width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/h2.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function H2() {
return (
<svg width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Image(props) {
return (
<svg {...props} width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/italic.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Italic() {
return (
<svg width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function Link() {
return (
<svg width="24" height="24" viewBox="0 0 24 24">
Expand Down
2 changes: 0 additions & 2 deletions src/icons/mediaBig.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* License: MIT
*/

import React from "react";

export default function MediaBig(props) {
return (
<svg {...props} width="24" height="24" viewBox="0 0 24 24">
Expand Down
Loading