Skip to content

Commit

Permalink
fix current warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
muni106 committed Aug 10, 2023
1 parent 8624237 commit f552e5c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
14 changes: 7 additions & 7 deletions src/components/Form/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ const Modal: React.FC<ModalProps> = ({ children, isOpen, closeModal }) => {
}
};

const handleEscPress = (e: KeyboardEvent) => {
if (e.key === 'Escape') {
closeModal();
}
};

React.useEffect(() => {
const handleEscPress = (e: KeyboardEvent) => {
if (e.key === 'Escape') {
closeModal();
}
};

if (isOpen) {
window.addEventListener('keydown', handleEscPress);
}

return () => {
window.removeEventListener('keydown', handleEscPress);
};
}, [isOpen]);
}, [isOpen, closeModal]);

if (!isOpen) {
return null;
Expand Down
6 changes: 3 additions & 3 deletions src/components/misc/FancyBackground.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect } from "react";
import { useEffect, useMemo } from "react";


const FancyBackground = (): JSX.Element => {
Expand All @@ -25,7 +25,7 @@ const FancyBackground = (): JSX.Element => {
return result;
};

const App: any = {};
const App: any = useMemo(() => [], []);

App.setup = function () {

Expand Down Expand Up @@ -335,7 +335,7 @@ const FancyBackground = (): JSX.Element => {
requestAnimationFrame(frame);
};
frame();
}, []);
}, [App]);



Expand Down
1 change: 1 addition & 0 deletions src/pages/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ const About = (): JSX.Element => {

<Heading as="h2" size="medium" color={colors.primary}>API Documentation</Heading>
<Section>
{/* eslint-disable-next-line*/}
<p>// Coming soon...</p>
</Section>

Expand Down
5 changes: 5 additions & 0 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const UserInputMain = styled.form`
z-index: 2;
`;

/*
const FindIpButton = styled.a`
margin: 0.5rem;
cursor: pointer;
Expand All @@ -46,6 +47,7 @@ const FindIpButton = styled.a`
color: ${colors.primary};
text-decoration: underline;
`;
*/

const ErrorMessage = styled.p`
color: ${colors.danger};
Expand Down Expand Up @@ -126,6 +128,8 @@ const Home = (): JSX.Element => {
if (!isError) setErrMsg('');
};


// eslint-disable-next-line
const findIpAddress = () => {
setUserInput('');
setPlaceholder('Looking up your IP...');
Expand All @@ -143,6 +147,7 @@ const Home = (): JSX.Element => {
});
};


const formSubmitEvent = (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
submit();
Expand Down
20 changes: 10 additions & 10 deletions src/pages/Results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const Results = (): JSX.Element => {
}
return newJobs;
});
}, []);
}, [startTime]);

const parseJson = (response: Response): Promise<any> => {
return new Promise((resolve) => {
Expand All @@ -147,15 +147,6 @@ const Results = (): JSX.Element => {
});
};

useEffect(() => {
if (!addressType || addressType === 'empt') {
setAddressType(determineAddressType(address || ''));
}
if (addressType === 'ipV4' && address) {
setIpAddress(address);
}
}, []);

const urlTypeOnly = ['url'] as AddressType[]; // Many jobs only run with these address types

const api = '/api';
Expand All @@ -170,6 +161,15 @@ const Results = (): JSX.Element => {
.then(res => res.ip),
});

useEffect(() => {
if (!addressType || addressType === 'empt') {
setAddressType(determineAddressType(address || ''));
}
if (addressType === 'ipV4' && address) {
setIpAddress(address);
}
}, [address, addressType, setIpAddress]);

// Fetch and parse SSL certificate info
const [sslResults, updateSslResults] = useMotherHook({
jobId: 'ssl',
Expand Down

0 comments on commit f552e5c

Please sign in to comment.