From 631f71e5c09a8c7d8e6bf6553f3fd4eda48e69db Mon Sep 17 00:00:00 2001 From: Daniil Palagin Date: Thu, 29 Aug 2024 09:44:41 +0200 Subject: [PATCH] Revert "[#49] Refactor js extension to jsx" This reverts commit b6d949c68ea82f366eba80815a9004201f2bc277. --- build-utils/webpack.common.js | 5 +--- build-utils/webpack.dev.js | 2 +- build-utils/webpack.prod.js | 2 +- package.json | 2 +- src/components/{App.jsx => App.js} | 14 +++++----- .../{DelayRender.jsx => DelayRender.js} | 0 .../{DynamicPage.jsx => DynamicPage.js} | 2 +- .../{Executions.jsx => Executions.js} | 4 +-- src/components/{Features.jsx => Features.js} | 0 src/components/{Home.jsx => Home.js} | 4 +-- src/components/{Layout.jsx => Layout.js} | 2 +- src/components/{Loading.jsx => Loading.js} | 4 +-- ...sSelection.jsx => ModuleTypesSelection.js} | 4 +-- .../{NavbarMenu.jsx => NavbarMenu.js} | 0 src/components/{NoMatch.jsx => NoMatch.js} | 2 +- src/components/{Profile.jsx => Profile.js} | 0 ...lection.jsx => ScriptFunctionSelection.js} | 4 +-- src/components/{Scripts.jsx => Scripts.js} | 4 +-- src/components/dagre/{Dagre.jsx => Dagre.js} | 28 +++++++++---------- .../dagre/{DagreIcons.jsx => DagreIcons.js} | 0 .../modal/{ErrorModal.jsx => ErrorModal.js} | 2 +- ...ionModal.jsx => FunctionExecutionModal.js} | 2 +- ...MoveModuleModal.jsx => MoveModuleModal.js} | 4 +-- ...eModal.jsx => ScriptActionsModuleModal.js} | 4 +-- ...utionModal.jsx => ScriptExecutionModal.js} | 2 +- ...tologyModal.jsx => ScriptOntologyModal.js} | 4 +-- ...portModal.jsx => ValidationReportModal.js} | 2 +- src/components/rest/{Rest.jsx => Rest.js} | 0 ...nctionModal.jsx => SFormsFunctionModal.js} | 6 ++-- .../sform/{SFormsModal.jsx => SFormsModal.js} | 6 ++-- ...putModal.jsx => ScriptInputOutputModal.js} | 2 +- .../spinner/{Spinner.jsx => Spinner.js} | 0 .../treebeard/{Header.jsx => Header.js} | 0 .../{ScriptsTree.jsx => ScriptsTree.js} | 12 ++++---- .../treebeard/{styles.jsx => styles.js} | 0 src/index.js | 10 +++++++ src/index.jsx | 9 ------ 37 files changed, 73 insertions(+), 75 deletions(-) rename src/components/{App.jsx => App.js} (81%) rename src/components/{DelayRender.jsx => DelayRender.js} (100%) rename src/components/{DynamicPage.jsx => DynamicPage.js} (88%) rename src/components/{Executions.jsx => Executions.js} (98%) rename src/components/{Features.jsx => Features.js} (100%) rename src/components/{Home.jsx => Home.js} (84%) rename src/components/{Layout.jsx => Layout.js} (92%) rename src/components/{Loading.jsx => Loading.js} (50%) rename src/components/{ModuleTypesSelection.jsx => ModuleTypesSelection.js} (92%) rename src/components/{NavbarMenu.jsx => NavbarMenu.js} (100%) rename src/components/{NoMatch.jsx => NoMatch.js} (87%) rename src/components/{Profile.jsx => Profile.js} (100%) rename src/components/{ScriptFunctionSelection.jsx => ScriptFunctionSelection.js} (89%) rename src/components/{Scripts.jsx => Scripts.js} (82%) rename src/components/dagre/{Dagre.jsx => Dagre.js} (97%) rename src/components/dagre/{DagreIcons.jsx => DagreIcons.js} (100%) rename src/components/modal/{ErrorModal.jsx => ErrorModal.js} (97%) rename src/components/modal/{FunctionExecutionModal.jsx => FunctionExecutionModal.js} (98%) rename src/components/modal/{MoveModuleModal.jsx => MoveModuleModal.js} (98%) rename src/components/modal/{ScriptActionsModuleModal.jsx => ScriptActionsModuleModal.js} (98%) rename src/components/modal/{ScriptExecutionModal.jsx => ScriptExecutionModal.js} (99%) rename src/components/modal/{ScriptOntologyModal.jsx => ScriptOntologyModal.js} (98%) rename src/components/modal/{ValidationReportModal.jsx => ValidationReportModal.js} (99%) rename src/components/rest/{Rest.jsx => Rest.js} (100%) rename src/components/sform/{SFormsFunctionModal.jsx => SFormsFunctionModal.js} (97%) rename src/components/sform/{SFormsModal.jsx => SFormsModal.js} (96%) rename src/components/sform/{ScriptInputOutputModal.jsx => ScriptInputOutputModal.js} (99%) rename src/components/spinner/{Spinner.jsx => Spinner.js} (100%) rename src/components/treebeard/{Header.jsx => Header.js} (100%) rename src/components/treebeard/{ScriptsTree.jsx => ScriptsTree.js} (94%) rename src/components/treebeard/{styles.jsx => styles.js} (100%) create mode 100644 src/index.js delete mode 100644 src/index.jsx diff --git a/build-utils/webpack.common.js b/build-utils/webpack.common.js index edaf99e..22bb836 100644 --- a/build-utils/webpack.common.js +++ b/build-utils/webpack.common.js @@ -14,15 +14,12 @@ const config = { module: { rules: [ { - test: /\.(js|jsx)$/, + test: /\.(js)$/, exclude: /node_modules/, use: ["babel-loader"], }, ], }, - resolve: { - extensions: [".js", ".jsx"], - }, optimization: { splitChunks: { cacheGroups: { diff --git a/build-utils/webpack.dev.js b/build-utils/webpack.dev.js index 796e07c..c54560c 100644 --- a/build-utils/webpack.dev.js +++ b/build-utils/webpack.dev.js @@ -7,7 +7,7 @@ const port = process.env.PORT || 3000; const config = { mode: "development", entry: { - app: `${commonPaths.appEntry}/index.jsx`, + app: `${commonPaths.appEntry}/index.js`, }, output: { filename: "[name].[hash].js", diff --git a/build-utils/webpack.prod.js b/build-utils/webpack.prod.js index fa76cd9..d1a052a 100644 --- a/build-utils/webpack.prod.js +++ b/build-utils/webpack.prod.js @@ -6,7 +6,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const config = { mode: "production", entry: { - app: [`${commonPaths.appEntry}/index.jsx`], + app: [`${commonPaths.appEntry}/index.js`], }, output: { filename: "static/[name].[hash].js", diff --git a/package.json b/package.json index 90bcaf8..2829354 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "react-starter-boilerplate-hmr", "version": "1.0.0", "description": "SPipes editor UI", - "main": "index.jsx", + "main": "index.js", "author": "Petr Jordan", "license": "MIT", "scripts": { diff --git a/src/components/App.jsx b/src/components/App.js similarity index 81% rename from src/components/App.jsx rename to src/components/App.js index 8db4bbe..4294925 100644 --- a/src/components/App.jsx +++ b/src/components/App.js @@ -2,22 +2,22 @@ import React, { Component } from "react"; import { Switch, BrowserRouter as Router, Route } from "react-router-dom"; import importedComponent from "react-imported-component"; -import Home from "./Home.jsx"; -import Loading from "./Loading.jsx"; +import Home from "./Home"; +import Loading from "./Loading"; -const Scripts = importedComponent(() => import(/* webpackChunkName:'Scripts' */ "./Scripts.jsx"), { +const Scripts = importedComponent(() => import(/* webpackChunkName:'Scripts' */ "./Scripts"), { LoadingComponent: Loading, }); -const Executions = importedComponent(() => import(/* webpackChunkName:'Executions' */ "./Executions.jsx"), { +const Executions = importedComponent(() => import(/* webpackChunkName:'Executions' */ "./Executions"), { LoadingComponent: Loading, }); -const AsyncDynamicPAge = importedComponent(() => import(/* webpackChunkName:'DynamicPage' */ "./DynamicPage.jsx"), { +const AsyncDynamicPAge = importedComponent(() => import(/* webpackChunkName:'DynamicPage' */ "./DynamicPage"), { LoadingComponent: Loading, }); -const AsyncDagre = importedComponent(() => import(/* webpackChunkName:'Dagre' */ "./dagre/Dagre.jsx"), { +const AsyncDagre = importedComponent(() => import(/* webpackChunkName:'Dagre' */ "./dagre/Dagre.js"), { LoadingComponent: Loading, }); -const AsyncNoMatch = importedComponent(() => import(/* webpackChunkName:'NoMatch' */ "./NoMatch.jsx"), { +const AsyncNoMatch = importedComponent(() => import(/* webpackChunkName:'NoMatch' */ "./NoMatch"), { LoadingComponent: Loading, }); diff --git a/src/components/DelayRender.jsx b/src/components/DelayRender.js similarity index 100% rename from src/components/DelayRender.jsx rename to src/components/DelayRender.js diff --git a/src/components/DynamicPage.jsx b/src/components/DynamicPage.js similarity index 88% rename from src/components/DynamicPage.jsx rename to src/components/DynamicPage.js index 5839581..c8f7011 100644 --- a/src/components/DynamicPage.jsx +++ b/src/components/DynamicPage.js @@ -1,7 +1,7 @@ import React from "react"; import { Header } from "semantic-ui-react"; -import Layout from "./Layout.jsx"; +import Layout from "./Layout"; const DynamicPage = () => { return ( diff --git a/src/components/Executions.jsx b/src/components/Executions.js similarity index 98% rename from src/components/Executions.jsx rename to src/components/Executions.js index 798ac91..2e447a9 100644 --- a/src/components/Executions.jsx +++ b/src/components/Executions.js @@ -1,6 +1,6 @@ import React, { Fragment } from "react"; -import Layout from "./Layout.jsx"; +import Layout from "./Layout"; import { ABSOLUTE_PATH, DISPLAY_NAME, @@ -9,7 +9,7 @@ import { Rest, START_DATE_UNIX, TRANSFORMATION, -} from "./rest/Rest.jsx"; +} from "./rest/Rest"; import { Col, Container, Row, Table } from "react-bootstrap"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faMugHot, faTrash, faRunning, faPlayCircle, faEdit, faQuestion } from "@fortawesome/free-solid-svg-icons"; diff --git a/src/components/Features.jsx b/src/components/Features.js similarity index 100% rename from src/components/Features.jsx rename to src/components/Features.js diff --git a/src/components/Home.jsx b/src/components/Home.js similarity index 84% rename from src/components/Home.jsx rename to src/components/Home.js index e4c0686..9559d0a 100644 --- a/src/components/Home.jsx +++ b/src/components/Home.js @@ -1,8 +1,8 @@ import React from "react"; import { Grid } from "semantic-ui-react"; -import Layout from "./Layout.jsx"; -import ScriptsTree from "./treebeard/ScriptsTree.jsx"; +import Layout from "./Layout"; +import ScriptsTree from "./treebeard/ScriptsTree"; import { Link } from "react-router-dom"; class Home extends React.Component { diff --git a/src/components/Layout.jsx b/src/components/Layout.js similarity index 92% rename from src/components/Layout.jsx rename to src/components/Layout.js index 0841eb2..63d0d4b 100644 --- a/src/components/Layout.jsx +++ b/src/components/Layout.js @@ -2,7 +2,7 @@ import React from "react"; import { Container, Icon } from "semantic-ui-react"; import { Nav, Navbar } from "react-bootstrap"; -import NavbarMenu from "./NavbarMenu.jsx"; +import NavbarMenu from "./NavbarMenu"; const Layout = ({ children }) => { return ( diff --git a/src/components/Loading.jsx b/src/components/Loading.js similarity index 50% rename from src/components/Loading.jsx rename to src/components/Loading.js index 92744ed..6b833d7 100644 --- a/src/components/Loading.jsx +++ b/src/components/Loading.js @@ -1,6 +1,6 @@ import React from "react"; -import Spinner from "./spinner/Spinner.jsx"; -import { DelayRender } from "./DelayRender.jsx"; +import Spinner from "./spinner/Spinner"; +import { DelayRender } from "./DelayRender"; const Loading = DelayRender(Spinner, 0); diff --git a/src/components/ModuleTypesSelection.jsx b/src/components/ModuleTypesSelection.js similarity index 92% rename from src/components/ModuleTypesSelection.jsx rename to src/components/ModuleTypesSelection.js index 339c89d..92ec35d 100644 --- a/src/components/ModuleTypesSelection.jsx +++ b/src/components/ModuleTypesSelection.js @@ -1,7 +1,7 @@ import React from "react"; import { Dropdown } from "semantic-ui-react"; -import { Rest } from "./rest/Rest.jsx"; -import { ICONS_MAP } from "./dagre/DagreIcons.jsx"; +import { Rest } from "./rest/Rest"; +import { ICONS_MAP } from "./dagre/DagreIcons"; class ModuleTypesSelection extends React.Component { constructor(props) { diff --git a/src/components/NavbarMenu.jsx b/src/components/NavbarMenu.js similarity index 100% rename from src/components/NavbarMenu.jsx rename to src/components/NavbarMenu.js diff --git a/src/components/NoMatch.jsx b/src/components/NoMatch.js similarity index 87% rename from src/components/NoMatch.jsx rename to src/components/NoMatch.js index 71f781a..e1ccda2 100644 --- a/src/components/NoMatch.jsx +++ b/src/components/NoMatch.js @@ -1,7 +1,7 @@ import React from "react"; import { Icon } from "semantic-ui-react"; -import Layout from "./Layout.jsx"; +import Layout from "./Layout"; const NoMatch = () => { return ( diff --git a/src/components/Profile.jsx b/src/components/Profile.js similarity index 100% rename from src/components/Profile.jsx rename to src/components/Profile.js diff --git a/src/components/ScriptFunctionSelection.jsx b/src/components/ScriptFunctionSelection.js similarity index 89% rename from src/components/ScriptFunctionSelection.jsx rename to src/components/ScriptFunctionSelection.js index bf9303f..d1cbcf8 100644 --- a/src/components/ScriptFunctionSelection.jsx +++ b/src/components/ScriptFunctionSelection.js @@ -1,7 +1,7 @@ import React from "react"; import { Dropdown } from "semantic-ui-react"; -import { FUNCTION, FUNCTION_NAME, Rest } from "./rest/Rest.jsx"; -import { ICONS_MAP } from "./dagre/DagreIcons.jsx"; +import { FUNCTION, FUNCTION_NAME, Rest } from "./rest/Rest"; +import { ICONS_MAP } from "./dagre/DagreIcons"; class ScriptFunctionSelection extends React.Component { constructor(props) { diff --git a/src/components/Scripts.jsx b/src/components/Scripts.js similarity index 82% rename from src/components/Scripts.jsx rename to src/components/Scripts.js index 4609239..90b5cdf 100644 --- a/src/components/Scripts.jsx +++ b/src/components/Scripts.js @@ -1,8 +1,8 @@ import React from "react"; import { Grid } from "semantic-ui-react"; -import Layout from "./Layout.jsx"; -import ScriptsTree from "./treebeard/ScriptsTree.jsx"; +import Layout from "./Layout"; +import ScriptsTree from "./treebeard/ScriptsTree"; import { Link } from "react-router-dom"; class Scripts extends React.Component { diff --git a/src/components/dagre/Dagre.jsx b/src/components/dagre/Dagre.js similarity index 97% rename from src/components/dagre/Dagre.jsx rename to src/components/dagre/Dagre.js index c2a1870..b9eece3 100644 --- a/src/components/dagre/Dagre.jsx +++ b/src/components/dagre/Dagre.js @@ -13,25 +13,25 @@ import { MODULE_VARIABLES, Rest, SCRIPT_PATH, -} from "../rest/Rest.jsx"; -import NavbarMenu from "../NavbarMenu.jsx"; -import SFormsModal from "../sform/SFormsModal.jsx"; -import ModuleTypesSelection from "../ModuleTypesSelection.jsx"; -import ScriptInputOutputModal from "../sform/ScriptInputOutputModal.jsx"; +} from "../rest/Rest"; +import NavbarMenu from "../NavbarMenu"; +import SFormsModal from "../sform/SFormsModal"; +import ModuleTypesSelection from "../ModuleTypesSelection"; +import ScriptInputOutputModal from "../sform/ScriptInputOutputModal"; import { Dropdown } from "semantic-ui-react"; -import { ICONS_MAP } from "./DagreIcons.jsx"; -import ScriptFunctionSelection from "../ScriptFunctionSelection.jsx"; +import { ICONS_MAP } from "./DagreIcons"; +import ScriptFunctionSelection from "../ScriptFunctionSelection"; import { Button } from "react-bootstrap"; -import ValidationReportModal from "../modal/ValidationReportModal.jsx"; +import ValidationReportModal from "../modal/ValidationReportModal"; import { w3cwebsocket as W3CWebSocket } from "websocket"; -import MoveModuleModal from "../modal/MoveModuleModal.jsx"; -import ScriptOntologyModal from "../modal/ScriptOntologyModal.jsx"; -import ScriptExecutionModal from "../modal/ScriptExecutionModal.jsx"; +import MoveModuleModal from "../modal/MoveModuleModal"; +import ScriptOntologyModal from "../modal/ScriptOntologyModal"; +import ScriptExecutionModal from "../modal/ScriptExecutionModal"; import "@triply/yasgui/build/yasgui.min.css"; -import SFormsFunctionModal from "../sform/SFormsFunctionModal.jsx"; +import SFormsFunctionModal from "../sform/SFormsFunctionModal"; import "@kbss-cvut/s-forms/css"; -import Loading from "../Loading.jsx"; -import ErrorModal from "../modal/ErrorModal.jsx"; +import Loading from "../Loading"; +import ErrorModal from "../modal/ErrorModal"; const TYPE = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/has-module-type"; const LABEL = "http://www.w3.org/2000/01/rdf-schema#label"; const X = "http://onto.fel.cvut.cz/ontologies/s-pipes-view/has-x-coordinate"; diff --git a/src/components/dagre/DagreIcons.jsx b/src/components/dagre/DagreIcons.js similarity index 100% rename from src/components/dagre/DagreIcons.jsx rename to src/components/dagre/DagreIcons.js diff --git a/src/components/modal/ErrorModal.jsx b/src/components/modal/ErrorModal.js similarity index 97% rename from src/components/modal/ErrorModal.jsx rename to src/components/modal/ErrorModal.js index 9884a0f..c7cce97 100644 --- a/src/components/modal/ErrorModal.jsx +++ b/src/components/modal/ErrorModal.js @@ -1,7 +1,7 @@ import React from "react"; import { Button, Form, Modal } from "react-bootstrap"; -import { Rest } from "../rest/Rest.jsx"; +import { Rest } from "../rest/Rest"; class ErrorModal extends React.Component { constructor(props) { diff --git a/src/components/modal/FunctionExecutionModal.jsx b/src/components/modal/FunctionExecutionModal.js similarity index 98% rename from src/components/modal/FunctionExecutionModal.jsx rename to src/components/modal/FunctionExecutionModal.js index 27628f1..b716c01 100644 --- a/src/components/modal/FunctionExecutionModal.jsx +++ b/src/components/modal/FunctionExecutionModal.js @@ -1,7 +1,7 @@ import React from "react"; import { Button, Form, Modal } from "react-bootstrap"; -import { Rest } from "../rest/Rest.jsx"; +import { Rest } from "../rest/Rest"; class FunctionExecutionModal extends React.Component { constructor(props) { diff --git a/src/components/modal/MoveModuleModal.jsx b/src/components/modal/MoveModuleModal.js similarity index 98% rename from src/components/modal/MoveModuleModal.jsx rename to src/components/modal/MoveModuleModal.js index ce6dc55..7eac2b9 100644 --- a/src/components/modal/MoveModuleModal.jsx +++ b/src/components/modal/MoveModuleModal.js @@ -14,12 +14,12 @@ import { SCRIPT_PATH, START_DATE_UNIX, TRANSFORMATION, -} from "../rest/Rest.jsx"; +} from "../rest/Rest"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faEdit, faMugHot, faPlayCircle, faTrash } from "@fortawesome/free-solid-svg-icons"; import Moment from "react-moment"; import { Link } from "react-router-dom"; -import Layout from "../Layout.jsx"; +import Layout from "../Layout"; class MoveModuleModal extends React.Component { constructor(props) { diff --git a/src/components/modal/ScriptActionsModuleModal.jsx b/src/components/modal/ScriptActionsModuleModal.js similarity index 98% rename from src/components/modal/ScriptActionsModuleModal.jsx rename to src/components/modal/ScriptActionsModuleModal.js index d9b30ba..d810874 100644 --- a/src/components/modal/ScriptActionsModuleModal.jsx +++ b/src/components/modal/ScriptActionsModuleModal.js @@ -14,12 +14,12 @@ import { SCRIPT_PATH, START_DATE_UNIX, TRANSFORMATION, -} from "../rest/Rest.jsx"; +} from "../rest/Rest"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faEdit, faMugHot, faPlayCircle, faTrash } from "@fortawesome/free-solid-svg-icons"; import Moment from "react-moment"; import { Link } from "react-router-dom"; -import Layout from "../Layout.jsx"; +import Layout from "../Layout"; class ScriptActionsModuleModal extends React.Component { constructor(props) { diff --git a/src/components/modal/ScriptExecutionModal.jsx b/src/components/modal/ScriptExecutionModal.js similarity index 99% rename from src/components/modal/ScriptExecutionModal.jsx rename to src/components/modal/ScriptExecutionModal.js index bbbdf02..8563309 100644 --- a/src/components/modal/ScriptExecutionModal.jsx +++ b/src/components/modal/ScriptExecutionModal.js @@ -13,7 +13,7 @@ import { MODULE_VARIABLES, MODULE_VARIABLE_NAME, MODULE_VARIABLE_VALUE, -} from "../rest/Rest.jsx"; +} from "../rest/Rest"; import { faDownload, faMugHot } from "@fortawesome/free-solid-svg-icons"; import Moment from "react-moment"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; diff --git a/src/components/modal/ScriptOntologyModal.jsx b/src/components/modal/ScriptOntologyModal.js similarity index 98% rename from src/components/modal/ScriptOntologyModal.jsx rename to src/components/modal/ScriptOntologyModal.js index 3652c69..5c24ebd 100644 --- a/src/components/modal/ScriptOntologyModal.jsx +++ b/src/components/modal/ScriptOntologyModal.js @@ -14,12 +14,12 @@ import { SCRIPT_PATH, START_DATE_UNIX, TRANSFORMATION, -} from "../rest/Rest.jsx"; +} from "../rest/Rest"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faEdit, faMugHot, faPlayCircle, faPlusCircle, faTrash } from "@fortawesome/free-solid-svg-icons"; import Moment from "react-moment"; import { Link } from "react-router-dom"; -import Layout from "../Layout.jsx"; +import Layout from "../Layout"; class ScriptOntologyModal extends React.Component { constructor(props) { diff --git a/src/components/modal/ValidationReportModal.jsx b/src/components/modal/ValidationReportModal.js similarity index 99% rename from src/components/modal/ValidationReportModal.jsx rename to src/components/modal/ValidationReportModal.js index 399c697..932feb9 100644 --- a/src/components/modal/ValidationReportModal.jsx +++ b/src/components/modal/ValidationReportModal.js @@ -12,7 +12,7 @@ import { RULE_COMMENT, START_DATE_UNIX, TRANSFORMATION, -} from "../rest/Rest.jsx"; +} from "../rest/Rest"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faEdit, faMugHot, faPlayCircle, faTrash } from "@fortawesome/free-solid-svg-icons"; import Moment from "react-moment"; diff --git a/src/components/rest/Rest.jsx b/src/components/rest/Rest.js similarity index 100% rename from src/components/rest/Rest.jsx rename to src/components/rest/Rest.js diff --git a/src/components/sform/SFormsFunctionModal.jsx b/src/components/sform/SFormsFunctionModal.js similarity index 97% rename from src/components/sform/SFormsFunctionModal.jsx rename to src/components/sform/SFormsFunctionModal.js index 3742b9b..8b8e1de 100644 --- a/src/components/sform/SFormsFunctionModal.jsx +++ b/src/components/sform/SFormsFunctionModal.js @@ -2,10 +2,10 @@ import React from "react"; import SForms from "@kbss-cvut/s-forms"; import { Button, Modal } from "react-bootstrap"; -import { Rest } from "../rest/Rest.jsx"; +import { Rest } from "../rest/Rest"; import "@triply/yasgui/build/yasgui.min.css"; -import ErrorModal from "../modal/ErrorModal.jsx"; -import ScriptActionsModuleModal from "../modal/ScriptActionsModuleModal.jsx"; +import ErrorModal from "../modal/ErrorModal"; +import ScriptActionsModuleModal from "../modal/ScriptActionsModuleModal"; class SFormsFunctionModal extends React.Component { constructor(props) { diff --git a/src/components/sform/SFormsModal.jsx b/src/components/sform/SFormsModal.js similarity index 96% rename from src/components/sform/SFormsModal.jsx rename to src/components/sform/SFormsModal.js index e7a5557..41581e7 100644 --- a/src/components/sform/SFormsModal.jsx +++ b/src/components/sform/SFormsModal.js @@ -1,10 +1,10 @@ import React from "react"; import SForms from "@kbss-cvut/s-forms"; import { Button, Modal } from "react-bootstrap"; -import { Rest } from "../rest/Rest.jsx"; -import Loading from "../Loading.jsx"; +import { Rest } from "../rest/Rest"; +import Loading from "../Loading"; import "@triply/yasgui/build/yasgui.min.css"; -import ErrorModal from "../modal/ErrorModal.jsx"; +import ErrorModal from "../modal/ErrorModal"; class SFormsModal extends React.Component { constructor(props) { diff --git a/src/components/sform/ScriptInputOutputModal.jsx b/src/components/sform/ScriptInputOutputModal.js similarity index 99% rename from src/components/sform/ScriptInputOutputModal.jsx rename to src/components/sform/ScriptInputOutputModal.js index a920486..ab05e25 100644 --- a/src/components/sform/ScriptInputOutputModal.jsx +++ b/src/components/sform/ScriptInputOutputModal.js @@ -1,7 +1,7 @@ import React from "react"; import { Alert, Button, Form, Modal } from "react-bootstrap"; -import { Rest } from "../rest/Rest.jsx"; +import { Rest } from "../rest/Rest"; import Yasgui from "@triply/yasgui"; import "@triply/yasgui/build/yasgui.min.css"; import JSONPretty from "react-json-pretty"; diff --git a/src/components/spinner/Spinner.jsx b/src/components/spinner/Spinner.js similarity index 100% rename from src/components/spinner/Spinner.jsx rename to src/components/spinner/Spinner.js diff --git a/src/components/treebeard/Header.jsx b/src/components/treebeard/Header.js similarity index 100% rename from src/components/treebeard/Header.jsx rename to src/components/treebeard/Header.js diff --git a/src/components/treebeard/ScriptsTree.jsx b/src/components/treebeard/ScriptsTree.js similarity index 94% rename from src/components/treebeard/ScriptsTree.jsx rename to src/components/treebeard/ScriptsTree.js index a8c99cf..9c2c78c 100644 --- a/src/components/treebeard/ScriptsTree.jsx +++ b/src/components/treebeard/ScriptsTree.js @@ -1,14 +1,14 @@ import React, { Fragment } from "react"; import { includes } from "lodash"; -import styles from "./styles.jsx"; -import Header from "./Header.jsx"; +import styles from "./styles"; +import Header from "./Header"; import { Treebeard, decorators } from "react-treebeard"; -import { Rest } from "../rest/Rest.jsx"; +import { Rest } from "../rest/Rest"; import { withRouter } from "react-router-dom"; -import ScriptActionsModuleModal from "../modal/ScriptActionsModuleModal.jsx"; -import Loading from "../Loading.jsx"; -import ErrorModal from "../modal/ErrorModal.jsx"; +import ScriptActionsModuleModal from "../modal/ScriptActionsModuleModal"; +import Loading from "../Loading"; +import ErrorModal from "../modal/ErrorModal"; class ScriptsTree extends React.Component { constructor(props) { diff --git a/src/components/treebeard/styles.jsx b/src/components/treebeard/styles.js similarity index 100% rename from src/components/treebeard/styles.jsx rename to src/components/treebeard/styles.js diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..651ebbd --- /dev/null +++ b/src/index.js @@ -0,0 +1,10 @@ +import React from "react"; +import ReactDOM from "react-dom"; +import App from "./components/App"; + +import "./index.css"; +import "bootstrap/dist/css/bootstrap.css"; + +const render = (Component) => ReactDOM.render(, document.getElementById("root")); + +render(App); diff --git a/src/index.jsx b/src/index.jsx deleted file mode 100644 index f3a545a..0000000 --- a/src/index.jsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -import ReactDOM from "react-dom/client"; - -import App from "./components/App.jsx"; -import "./index.css"; -import "bootstrap/dist/css/bootstrap.css"; - -const root = ReactDOM.createRoot(document.getElementById("root")); -root.render();