From 2f27e222add9bf10b55971ab915ac411e81d24f0 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Sun, 23 Jan 2022 19:25:56 +0100 Subject: Rewritten ui to use boostrap --- src/components/App/App.module.scss | 35 +++++++++- src/components/App/App.tsx | 127 ++++++++++++++----------------------- 2 files changed, 81 insertions(+), 81 deletions(-) (limited to 'src/components/App') diff --git a/src/components/App/App.module.scss b/src/components/App/App.module.scss index 9837cdf..088a4f6 100644 --- a/src/components/App/App.module.scss +++ b/src/components/App/App.module.scss @@ -1,3 +1,34 @@ -.content { - flex: 1 0 auto; +.app { + display: flex; + flex-flow: column nowrap; + grid-template-rows: auto 1fr; + height: 100vh; + overflow: hidden; +} + +.main { + display: flex; + flex-flow: row nowrap; + flex-grow: 1; + overflow: hidden; +} + +.sidebar { + width: calc((6 / 16) * 100%); + height: 100%; + overflow-y: auto; +} + +.details { + width: calc((10 / 16) * 100%); + overflow: hidden; + height: 100%; +} + +.noRequest, .noRequestSelected { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; } diff --git a/src/components/App/App.tsx b/src/components/App/App.tsx index 61f88f6..cb82abc 100644 --- a/src/components/App/App.tsx +++ b/src/components/App/App.tsx @@ -1,12 +1,15 @@ import * as React from "react"; -import useRequests, {RequestResponse, ReadyState} from "../../hooks/useRequests"; import {useEffect, useMemo, useState} from "react"; +import useRequests, { + ReadyState, + RequestResponse +} from "../../hooks/useRequests"; import styles from './App.module.scss'; import Details from "../Details/Details"; import RequestSummary from "../RequestSummary/RequestSummary"; import {getHost} from "../../utils"; -import {Container, Navbar, Col, Row, Nav, ListGroup} from "react-bootstrap"; +import {Container, ListGroup, Navbar} from "react-bootstrap"; import classNames from "classnames"; interface Config { @@ -52,11 +55,12 @@ export default function App() { ), [selectedRequestIndex, calls]); return config && ( - <> +
@@ -67,44 +71,45 @@ export default function App() { - - - - - - { - calls.length > 0 - ? ( - calls.slice(0).reverse().map((requestResponse, index) => { - const selected = selectedRequestIndex === calls.length - index - 1; - return ( - setSelectedRequestIndex(calls.length - index - 1)} - key={`request-${index}`} - className={classNames({ - 'bg-primary': selected, - 'text-light': selected, - 'border-bottom': true - })} - > - - - ) - }) - ) - : ( -
-

No requests

-
- ) - } -
- - +
+ + { + calls.length > 0 + ? ( + calls.slice(0).reverse().map((requestResponse, index) => { + const selected = selectedRequestIndex === calls.length - index - 1; + return ( + setSelectedRequestIndex(calls.length - index - 1)} + key={`request-${index}`} + className={classNames({ + 'bg-primary': selected, + 'text-light': selected, + 'border-bottom': true + })} + > + + + ) + }) + ) + : ( +
+

No requests

+
+ ) + } +
+
{ selectedRequest !== null ? ( @@ -115,44 +120,8 @@ export default function App() {
) } - - - - //
- //
- // {statusMap[readyState]} TTUN - // {config.url} - //
- //
- //
    - // { - // calls.length > 0 - // ? calls.slice(0).reverse().map((requestResponse, index) => ( - //
  • setSelectedRequestIndex(calls.length - index - 1)} key={`request-${index}`}> - // - //
  • - // )) - // : ( - //
    - //

    No requests

    - //
    - // ) - // } - //
- // - //
- // { - // selectedRequest !== null - // ? ( - //
- // ) : ( - //
- //

Select a request to inspect it

- //
- // ) - // } - //
- //
- //
+
+ + ); } -- cgit v1.2.3