From 539ffe78b5482876129904e8ddcb207e8d9238a4 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Mon, 19 Sep 2022 15:02:42 -0400 Subject: [PATCH] incoporate react-router-dom; start skeleton for registration/verification (#50) --- ui/package-lock.json | 59 ++++++++++++++++++++++++++++++++++++++++++++ ui/package.json | 3 ++- ui/src/App.js | 2 +- ui/src/Register.js | 7 ++++++ ui/src/index.js | 15 ++++++++++- 5 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 ui/src/Register.js diff --git a/ui/package-lock.json b/ui/package-lock.json index f9c9107d..6fa742a7 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -19,6 +19,7 @@ "react-data-table-component": "^7.5.2", "react-dom": "^18.2.0", "react-flow-renderer": "^10.3.12", + "react-router-dom": "^6.4.0", "react-scripts": "5.0.1", "styled-components": "^5.3.5" } @@ -3479,6 +3480,14 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@remix-run/router": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.0.tgz", + "integrity": "sha512-SCR1cxRSMNKjaVYptCzBApPDqGwa3FGdjVHc+rOToocNPHQdIYLZBfv/3f+KvYuXDkUGVIW9IAzmPNZDRL1I4A==", + "engines": { + "node": ">=14" + } + }, "node_modules/@rollup/plugin-babel": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", @@ -14291,6 +14300,35 @@ "node": ">=0.10.0" } }, + "node_modules/react-router": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.0.tgz", + "integrity": "sha512-B+5bEXFlgR1XUdHYR6P94g299SjrfCBMmEDJNcFbpAyRH1j1748yt9NdDhW3++nw1lk3zQJ6aOO66zUx3KlTZg==", + "dependencies": { + "@remix-run/router": "1.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": ">=16.8" + } + }, + "node_modules/react-router-dom": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.0.tgz", + "integrity": "sha512-4Aw1xmXKeleYYQ3x0Lcl2undHR6yMjXZjd9DKZd53SGOYqirrUThyUb0wwAX5VZAyvSuzjNJmZlJ3rR9+/vzqg==", + "dependencies": { + "react-router": "6.4.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, "node_modules/react-scripts": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-5.0.1.tgz", @@ -19383,6 +19421,11 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz", "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==" }, + "@remix-run/router": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.0.tgz", + "integrity": "sha512-SCR1cxRSMNKjaVYptCzBApPDqGwa3FGdjVHc+rOToocNPHQdIYLZBfv/3f+KvYuXDkUGVIW9IAzmPNZDRL1I4A==" + }, "@rollup/plugin-babel": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", @@ -27094,6 +27137,22 @@ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", "integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==" }, + "react-router": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.0.tgz", + "integrity": "sha512-B+5bEXFlgR1XUdHYR6P94g299SjrfCBMmEDJNcFbpAyRH1j1748yt9NdDhW3++nw1lk3zQJ6aOO66zUx3KlTZg==", + "requires": { + "@remix-run/router": "1.0.0" + } + }, + "react-router-dom": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.0.tgz", + "integrity": "sha512-4Aw1xmXKeleYYQ3x0Lcl2undHR6yMjXZjd9DKZd53SGOYqirrUThyUb0wwAX5VZAyvSuzjNJmZlJ3rR9+/vzqg==", + "requires": { + "react-router": "6.4.0" + } + }, "react-scripts": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-5.0.1.tgz", diff --git a/ui/package.json b/ui/package.json index c498a698..e471d9e8 100644 --- a/ui/package.json +++ b/ui/package.json @@ -14,6 +14,7 @@ "react-data-table-component": "^7.5.2", "react-dom": "^18.2.0", "react-flow-renderer": "^10.3.12", + "react-router-dom": "^6.4.0", "react-scripts": "5.0.1", "styled-components": "^5.3.5" }, @@ -41,5 +42,5 @@ "last 1 safari version" ] }, - "proxy": "http://localhost:18080" + "proxy": "https://api.zrok.io" } diff --git a/ui/src/App.js b/ui/src/App.js index 71616431..63d5f531 100644 --- a/ui/src/App.js +++ b/ui/src/App.js @@ -3,7 +3,7 @@ import Logout from './Logout'; import Network from './Network'; import Token from './Token'; import Version from './Version'; -import {useEffect, useState} from "react"; +import { useEffect, useState } from 'react'; const App = () => { const [user, setUser] = useState(); diff --git a/ui/src/Register.js b/ui/src/Register.js new file mode 100644 index 00000000..8288535f --- /dev/null +++ b/ui/src/Register.js @@ -0,0 +1,7 @@ +const Register = () => { + return ( +

Register!

+ ) +} + +export default Register; \ No newline at end of file diff --git a/ui/src/index.js b/ui/src/index.js index caf013df..188b962f 100644 --- a/ui/src/index.js +++ b/ui/src/index.js @@ -2,12 +2,25 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; +import Register from "./Register"; import * as gateway from "./api/gateway"; +import {createBrowserRouter, RouterProvider} from "react-router-dom"; + +const router = createBrowserRouter([ + { + path: "/", + element: , + }, + { + path: "/register", + element: , + } +]); const root = ReactDOM.createRoot(document.getElementById('root')); root.render( - + );