summaryrefslogtreecommitdiffstats
path: root/src/components/App/App.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/App/App.tsx')
-rw-r--r--src/components/App/App.tsx15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/components/App/App.tsx b/src/components/App/App.tsx
index 85119e6..2c8025d 100644
--- a/src/components/App/App.tsx
+++ b/src/components/App/App.tsx
@@ -1,5 +1,5 @@
1import * as React from "react"; 1import * as React from "react";
2import { ReactElement, useContext, useEffect } from "react"; 2import { ReactElement, useContext, useEffect, useState } from "react";
3 3
4import styles from "~/components/App/App.module.scss"; 4import styles from "~/components/App/App.module.scss";
5import RequestDetails from "~/components/RequestDetails/RequestDetails"; 5import RequestDetails from "~/components/RequestDetails/RequestDetails";
@@ -28,9 +28,9 @@ type ReadyStateMap = {
28}; 28};
29 29
30const statusIconMap: ReadyStateMap = { 30const statusIconMap: ReadyStateMap = {
31 [ReadyState.CONNECTING]: "🔴", 31 [ReadyState.CONNECTING]: "🟠",
32 [ReadyState.OPEN]: "🟢", 32 [ReadyState.OPEN]: "🟢",
33 [ReadyState.CLOSING]: "🔴", 33 [ReadyState.CLOSING]: "🟠",
34 [ReadyState.CLOSED]: "🔴", 34 [ReadyState.CLOSED]: "🔴",
35}; 35};
36 36
@@ -47,9 +47,9 @@ export default function App() {
47 useContext(ConnectionContext); 47 useContext(ConnectionContext);
48 48
49 useEffect(() => { 49 useEffect(() => {
50 const url = new URL(config?.url ?? "https://loading..."); 50 const url = new URL(config?.urls[0] ?? "https://loading...");
51 document.title = `${statusIconMap[readyState]} ${url.host} | TTUN`; 51 document.title = `${statusIconMap[readyState]} ${url.host} | TTUN`;
52 }, [readyState, config?.url]); 52 }, [readyState, config?.urls]);
53 53
54 const settingsMenu: (SettingsMenu | null)[] = [ 54 const settingsMenu: (SettingsMenu | null)[] = [
55 { 55 {
@@ -80,11 +80,6 @@ export default function App() {
80 </Navbar.Text> 80 </Navbar.Text>
81 </div> 81 </div>
82 <div className="d-flex"> 82 <div className="d-flex">
83 <Navbar.Text>
84 <a href={config.url} target="_blank">
85 {config.url}
86 </a>
87 </Navbar.Text>
88 <Navbar.Toggle aria-controls="settings" /> 83 <Navbar.Toggle aria-controls="settings" />
89 <Navbar.Collapse id="settings" className="ms-2" role="button"> 84 <Navbar.Collapse id="settings" className="ms-2" role="button">
90 <Nav> 85 <Nav>