From 72a676a6cecf5e10fc582808d292cb9d018068e8 Mon Sep 17 00:00:00 2001 From: Martin Blech <78768+martinblech@users.noreply.github.com> Date: Sun, 22 Jan 2023 14:49:43 -0800 Subject: [PATCH 01/23] Basic router setup Root maps to the existing App, which now has a couple of ugly links to the new /wand and /buttons routes. --- web/package.json | 1 + web/src/App.tsx | 7 +++++++ web/src/Root.tsx | 41 +++++++++++++++++++++++++++++++++++++++++ web/src/index.tsx | 21 ++++++++++++++++++--- web/yarn.lock | 20 ++++++++++++++++++++ 5 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 web/src/Root.tsx diff --git a/web/package.json b/web/package.json index 8ba0ef27..7ce5f5ea 100644 --- a/web/package.json +++ b/web/package.json @@ -18,6 +18,7 @@ "node-sass": "^7.0.1", "react": "^18.0.0", "react-dom": "^18.0.0", + "react-router-dom": "^6.7.0", "react-scripts": "5.0.1", "react-select": "^5.4.0", "reconnecting-websocket": "^4.4.0", diff --git a/web/src/App.tsx b/web/src/App.tsx index a63c5538..7832e36d 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,5 +1,6 @@ import React from "react"; import _ from "lodash"; +import { Link } from "react-router-dom"; import { ConnectionStatus } from "./ConnectionStatus"; import { DevicesStatus } from "./DevicesStatus"; import { LightsSimulator } from "./LightsSimulator"; @@ -222,6 +223,12 @@ export class App extends React.Component { WarroLight + +