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/Details/Details.module.scss | 66 -------- src/components/Details/Details.tsx | 237 ++++++++++------------------- 2 files changed, 78 insertions(+), 225 deletions(-) (limited to 'src/components/Details') diff --git a/src/components/Details/Details.module.scss b/src/components/Details/Details.module.scss index 32197f0..146b5d8 100644 --- a/src/components/Details/Details.module.scss +++ b/src/components/Details/Details.module.scss @@ -16,69 +16,3 @@ flex-shrink: 1; overflow-y: auto; } - -.summary { - font-size: 2em; -} - -.tabs { - display: flex; - border-bottom: 1px solid black; - - &:last-child { - flex-grow: 1; - } -} - -.tab { - background-color: white; - border: none; - border-top: 1px solid black; - border-right: 1px solid black; - border-radius: 0; - color: black; - font-size: 1.2em; - padding: 0.5em; - - &.selected { - background-color: black; - color: white; - } -} - -.emptySpace { - flex-grow: 1; - display: flex; - justify-content: flex-end; - align-items: center; - font-size: 1.2em; - padding: 0.5em; -} - -.resend { - margin-left: 1em; -} - -.headers { - display: grid; - grid-template-columns: auto 1fr; - border: 1px solid black; - margin: 1em; - overflow-x: auto; - - h2 { - grid-column: 1/ span 2; - background-color: black; - color: white; - padding: 0.5em; - } - - > div { - line-break: auto; - padding: 0.5em; - - &:nth-of-type(4n), &:nth-of-type(4n - 1) { - background-color: lightgray; - } - } -} diff --git a/src/components/Details/Details.tsx b/src/components/Details/Details.tsx index c96aa7b..d4bb07a 100644 --- a/src/components/Details/Details.tsx +++ b/src/components/Details/Details.tsx @@ -1,25 +1,11 @@ import * as React from "react"; -import { - RequestPayload, - RequestResponse, - ResponsePayload -} from "~hooks/useRequests"; -import {useCallback, useEffect, useMemo, useState} from "react"; +import {useCallback, useMemo, useState} from "react"; +import {RequestResponse} from "~hooks/useRequests"; import styles from "./Details.module.scss"; import RequestSummary from "../RequestSummary/RequestSummary"; -import classNames from 'classnames'; import Content from "../Content/Content"; import {getHost} from "../../utils"; -import { - Button, - Card, - Col, - Container, - Nav, - NavItem, - Row, - Table -} from "react-bootstrap"; +import {Button, Card, Col, Container, Nav, Row, Table} from "react-bootstrap"; interface TimingProps { @@ -99,147 +85,80 @@ export default function Details({ requestResponse }: DetailsProps) { ), [requestResponse]); return ( - <> - - - - - - - - - - - - - - - - - - - { - tab === 'headers' && ( - <> - - { - requestResponse.response && ( - - ) - } - - ) - } - { - tab === 'request' && ( - - ) - } - { - tab === 'response' && requestResponse.response !== undefined && ( - - ) - } - - - - //
- //
- // - //
- // - // - // - // - //
- // - // - //
- //
- //
- //
- // { - // tab === 'headers' && ( - // <> - // - // { - // requestResponse.response && ( - // - // ) - // } - // - // ) - // } - // { - // tab === 'request' && ( - // - // ) - // } - // { - // tab === 'response' && requestResponse.response !== undefined && ( - // - // ) - // } - //
- //
+
+
+ + + + + + + + + + + + + + + + +
+
+ { + tab === 'headers' && ( + <> + + { + requestResponse.response && ( + + ) + } + + ) + } + { + tab === 'request' && ( + + ) + } + { + tab === 'response' && requestResponse.response !== undefined && ( + + ) + } +
+
) } -- cgit v1.2.3