Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi-sl committed Aug 9, 2024
1 parent 9757751 commit 334b95c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 deletions.
23 changes: 7 additions & 16 deletions src/Components/Import/ImportHAR.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@ import { useDropzone } from 'react-dropzone';

import { useNetwork } from './../../state/network/Context';
import Styles from './ImportHAR.styles.scss';
import Button from './../Common/Button';
import IconUpload from '../../icons/IconImport';
import ImportHarButton from '../Actions/ImportHarButton';

const DROP_FILE_CONFIG = {
accept: '.har',
multiple: false,
};

const ImportHar = ({
showButton,
className,
}) => {
const ImportHar = ({ showButton }) => {
const { actions } = useNetwork();
const { updateErrorMessage } = actions;

Expand Down Expand Up @@ -48,25 +43,21 @@ const ImportHar = ({
return (
<div {...getRootProps()}>
<input {...getInputProps()} />
{showButton ?
(<ImportHarButton />) :
(
<p className={Styles['drag-drop']}>
Drag and drop HAR file here, or click to select
file
</p>
)}
{showButton ? <ImportHarButton /> : (
<p className={Styles['drag-drop']}>
Drag and drop HAR file here, or click to select
file
</p>
)}
</div>
);
};

ImportHar.propTypes = {
className: PropTypes.string,
showButton: PropTypes.bool,
};

ImportHar.defaultProps = {
className: null,
showButton: true,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ exports[`ImportHAR renders without crashing 1`] = `
scrollTimeStamp={null}
>
<ImportHar
className={null}
showButton={true}
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ exports[`FilterContainer renders without crashing 1`] = `
</Tooltip>
</ResetButton>
<ImportHar
className={null}
showButton={true}
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ exports[`MainContainer renders without crashing 1`] = `
</Tooltip>
</ResetButton>
<ImportHar
className={null}
showButton={true}
>
<div
Expand Down Expand Up @@ -525,7 +524,6 @@ exports[`MainContainer renders without crashing 1`] = `
<NetworkTableContainer>
<section>
<ImportHar
className={null}
showButton={false}
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ exports[`NetworkTableContainer renders without crashing 1`] = `
<NetworkTableContainer>
<section>
<ImportHar
className={null}
showButton={false}
>
<div
Expand Down

0 comments on commit 334b95c

Please sign in to comment.