From 78fa2fcfcde0f459650fc013b96620f3de596269 Mon Sep 17 00:00:00 2001 From: Joseph Chamochumbi Date: Fri, 3 Jul 2020 15:35:43 +0200 Subject: [PATCH 01/25] feat: break into smaller bundles based on pages --- package.json | 1 - src/App.js | 86 +++----- src/components/HexapodPlot.js | 36 +++- src/components/PoseTable.js | 73 +++---- src/components/generic/SmallWidgets.js | 3 +- src/components/pages/LandingPage.js | 22 +- src/components/vars.js | 11 +- src/index.css | 1 + src/loadables.js | 55 +++++ src/routes.js | 52 +++++ yarn.lock | 287 +------------------------ 11 files changed, 222 insertions(+), 405 deletions(-) create mode 100644 src/loadables.js create mode 100644 src/routes.js diff --git a/package.json b/package.json index da0d069..41f2677 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "react-dom": "^16.13.1", "react-ga": "^3.0.0", "react-icons": "^3.10.0", - "react-markdown": "^4.3.1", "react-plotly.js": "^2.4.0", "react-router-dom": "^5.2.0", "react-scripts": "3.4.1", diff --git a/src/App.js b/src/App.js index 7fe7174..557f5fa 100644 --- a/src/App.js +++ b/src/App.js @@ -1,9 +1,9 @@ import React from "react" -import { BrowserRouter as Router, Route, Switch } from "react-router-dom" +import { BrowserRouter as Router } from "react-router-dom" import ReactGA from "react-ga" import { VirtualHexapod, getNewPlotParams } from "./hexapod" import * as defaults from "./templates" -import { SECTION_NAMES, PATHS } from "./components/vars" +import { SECTION_NAMES } from "./components/vars" import { PoseTable, Nav, @@ -12,12 +12,8 @@ import { DimensionsWidget, AlertBox, } from "./components" -import { - ForwardKinematicsPage, - InverseKinematicsPage, - LandingPage, - LegPatternPage, -} from "./components/pages" + +import Routes from "./routes" ReactGA.initialize("UA-170794768-1", { //debug: true, @@ -169,61 +165,35 @@ class App extends React.Component { ) - /* * * * * * * * * * * * * * - * Pages - * * * * * * * * * * * * * */ - - showPage = () => ( - - - - - - - - - - - - - - - ) - /* * * * * * * * * * * * * * * Layout * * * * * * * * * * * * * */ - render = () => ( - -