From 51a2ac628822e96459b3d570eada953ac8927d43 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Wed, 19 Jan 2022 21:27:21 +0100 Subject: Added boostrap --- src/components/App/App.module.scss | 56 +----------------- src/components/App/App.tsx | 118 +++++++++++++++++++++++++++++-------- 2 files changed, 95 insertions(+), 79 deletions(-) (limited to 'src/components/App') diff --git a/src/components/App/App.module.scss b/src/components/App/App.module.scss index 2036eb9..9837cdf 100644 --- a/src/components/App/App.module.scss +++ b/src/components/App/App.module.scss @@ -1,55 +1,3 @@ -.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; -} - -.header { - font-size: 1.2em; - display: flex; - flex-flow: row nowrap; - align-items: center; - justify-content: space-between; - background: black; - color: white; - padding: 1em; - - a { - color: white; - } -} - -.sidebar { - width: calc((6 / 16) * 100%); - height: 100%; - grid-area: sidebar; - border-right: 1px solid black; - overflow-y: auto; - - li { - border-bottom: 1px solid gray; - } -} - -.details { - width: calc((10 / 16) * 100%); - overflow: hidden; - height: 100%; -} - -.noRequest, .noRequestSelected { - width: 100%; - height: 100%; - display: flex; - justify-content: center; - align-items: center; +.content { + flex: 1 0 auto; } diff --git a/src/components/App/App.tsx b/src/components/App/App.tsx index e361aa5..61f88f6 100644 --- a/src/components/App/App.tsx +++ b/src/components/App/App.tsx @@ -6,6 +6,8 @@ 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 classNames from "classnames"; interface Config { url: string @@ -50,29 +52,59 @@ export default function App() { ), [selectedRequestIndex, calls]); return config && ( -
-
- {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

    -
    - ) - } -
+ <> + + + + {statusMap[readyState]} TTUN + + + {config.url} + + + + -
+ + + + + { + 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 ? ( @@ -83,8 +115,44 @@ 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