From b7ea99a9f589031155b6b65a2daf208dc52d217e Mon Sep 17 00:00:00 2001 From: Liraz Yehezkel Date: Tue, 27 Apr 2021 17:14:20 +0300 Subject: [PATCH] Clean warnings --- ui/src/components/HarEntryViewer/HAREntrySections.tsx | 4 ++-- ui/src/components/HarEntryViewer/HAREntryViewer.tsx | 9 +++------ ui/src/components/HarPage.tsx | 6 +++--- ui/src/components/Tabs.tsx | 4 ++-- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ui/src/components/HarEntryViewer/HAREntrySections.tsx b/ui/src/components/HarEntryViewer/HAREntrySections.tsx index 35684805d..ede3ca572 100644 --- a/ui/src/components/HarEntryViewer/HAREntrySections.tsx +++ b/ui/src/components/HarEntryViewer/HAREntrySections.tsx @@ -11,7 +11,7 @@ interface HAREntryViewLineProps { } const HAREntryViewLine: React.FC = ({label, value}) => { - return label && value && + return (label && value && {label} = ({label, value}) => { displayIconOnMouseOver={true} /> - || null; + ) || null; } diff --git a/ui/src/components/HarEntryViewer/HAREntryViewer.tsx b/ui/src/components/HarEntryViewer/HAREntryViewer.tsx index 64240088d..d0f13425d 100644 --- a/ui/src/components/HarEntryViewer/HAREntryViewer.tsx +++ b/ui/src/components/HarEntryViewer/HAREntryViewer.tsx @@ -2,13 +2,11 @@ import React, {useState} from 'react'; import styles from './HAREntryViewer.module.sass'; import Tabs from "../Tabs"; import {HAREntryTableSection, HAREntryBodySection} from "./HAREntrySections"; -import useToggle from "../../hooks/use-toggle"; const MIME_TYPE_KEY = 'mimeType'; - const HAREntryDisplay: React.FC = ({entry, isCollapsed: initialIsCollapsed, isResponseMocked}) => { - const {request, response, timings: {receive}} = entry; + const {request, response} = entry; const { url, postData} = request; const TABS = [ @@ -20,14 +18,13 @@ const HAREntryDisplay: React.FC = ({entry, isCollapsed: initialIsCollapsed, ]; const [currentTab, setCurrentTab] = useState(TABS[0].tab); - const [isCollapsed, toggleCollapsed] = useToggle(initialIsCollapsed); return
- {!isCollapsed &&
+ {!initialIsCollapsed &&
- {url} + {url}
{ currentTab === TABS[0].tab && diff --git a/ui/src/components/HarPage.tsx b/ui/src/components/HarPage.tsx index a71b482d9..276a9219f 100644 --- a/ui/src/components/HarPage.tsx +++ b/ui/src/components/HarPage.tsx @@ -1,11 +1,11 @@ import React, {useEffect, useState} from "react"; -import {HarFilters} from "./HarFilters"; +// import {HarFilters} from "./HarFilters"; import {HarEntriesList} from "./HarEntriesList"; -import {Box, makeStyles} from "@material-ui/core"; +import {makeStyles} from "@material-ui/core"; import "./style/HarPage.sass"; import styles from './style/HarEntriesList.module.sass'; import {HAREntryDetailed} from "./HarEntryDetailed"; -import {HarPaging} from "./HarPaging"; +// import {HarPaging} from "./HarPaging"; const useLayoutStyles = makeStyles(() => ({ details: { diff --git a/ui/src/components/Tabs.tsx b/ui/src/components/Tabs.tsx index 56cafd654..b78cdbe64 100644 --- a/ui/src/components/Tabs.tsx +++ b/ui/src/components/Tabs.tsx @@ -75,7 +75,7 @@ const Tabs: React.FC = ({classes={}, tabs, currentTab, onChange, leftAlig return
{tabs.filter((tab) => !tab.hidden).map(({tab, disabled, disabledMessage, highlight, badge}, index) => { const active = currentTab === tab; - const tabLink = !disabled && onChange(tab)} @@ -83,7 +83,7 @@ const Tabs: React.FC = ({classes={}, tabs, currentTab, onChange, leftAlig {tab} {React.isValidElement(badge) && badge} - ; + ; return {disabled && disabledMessage ? {tabLink} : tabLink}