mirror of
https://github.com/Lissy93/web-check.git
synced 2025-04-30 12:24:27 +02:00
fix current warnings
This commit is contained in:
parent
8624237760
commit
f552e5cb69
@ -57,13 +57,13 @@ const Modal: React.FC<ModalProps> = ({ children, isOpen, closeModal }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
const handleEscPress = (e: KeyboardEvent) => {
|
const handleEscPress = (e: KeyboardEvent) => {
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
closeModal();
|
closeModal();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
window.addEventListener('keydown', handleEscPress);
|
window.addEventListener('keydown', handleEscPress);
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ const Modal: React.FC<ModalProps> = ({ children, isOpen, closeModal }) => {
|
|||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener('keydown', handleEscPress);
|
window.removeEventListener('keydown', handleEscPress);
|
||||||
};
|
};
|
||||||
}, [isOpen]);
|
}, [isOpen, closeModal]);
|
||||||
|
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
|
|
||||||
|
|
||||||
const FancyBackground = (): JSX.Element => {
|
const FancyBackground = (): JSX.Element => {
|
||||||
@ -25,7 +25,7 @@ const FancyBackground = (): JSX.Element => {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
const App: any = {};
|
const App: any = useMemo(() => [], []);
|
||||||
|
|
||||||
App.setup = function () {
|
App.setup = function () {
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ const FancyBackground = (): JSX.Element => {
|
|||||||
requestAnimationFrame(frame);
|
requestAnimationFrame(frame);
|
||||||
};
|
};
|
||||||
frame();
|
frame();
|
||||||
}, []);
|
}, [App]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -172,6 +172,7 @@ const About = (): JSX.Element => {
|
|||||||
|
|
||||||
<Heading as="h2" size="medium" color={colors.primary}>API Documentation</Heading>
|
<Heading as="h2" size="medium" color={colors.primary}>API Documentation</Heading>
|
||||||
<Section>
|
<Section>
|
||||||
|
{/* eslint-disable-next-line*/}
|
||||||
<p>// Coming soon...</p>
|
<p>// Coming soon...</p>
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ const UserInputMain = styled.form`
|
|||||||
z-index: 2;
|
z-index: 2;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
/*
|
||||||
const FindIpButton = styled.a`
|
const FindIpButton = styled.a`
|
||||||
margin: 0.5rem;
|
margin: 0.5rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -46,6 +47,7 @@ const FindIpButton = styled.a`
|
|||||||
color: ${colors.primary};
|
color: ${colors.primary};
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
`;
|
`;
|
||||||
|
*/
|
||||||
|
|
||||||
const ErrorMessage = styled.p`
|
const ErrorMessage = styled.p`
|
||||||
color: ${colors.danger};
|
color: ${colors.danger};
|
||||||
@ -126,6 +128,8 @@ const Home = (): JSX.Element => {
|
|||||||
if (!isError) setErrMsg('');
|
if (!isError) setErrMsg('');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
const findIpAddress = () => {
|
const findIpAddress = () => {
|
||||||
setUserInput('');
|
setUserInput('');
|
||||||
setPlaceholder('Looking up your IP...');
|
setPlaceholder('Looking up your IP...');
|
||||||
@ -143,6 +147,7 @@ const Home = (): JSX.Element => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const formSubmitEvent = (event: FormEvent<HTMLFormElement>) => {
|
const formSubmitEvent = (event: FormEvent<HTMLFormElement>) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
submit();
|
submit();
|
||||||
|
@ -132,7 +132,7 @@ const Results = (): JSX.Element => {
|
|||||||
}
|
}
|
||||||
return newJobs;
|
return newJobs;
|
||||||
});
|
});
|
||||||
}, []);
|
}, [startTime]);
|
||||||
|
|
||||||
const parseJson = (response: Response): Promise<any> => {
|
const parseJson = (response: Response): Promise<any> => {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
@ -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 urlTypeOnly = ['url'] as AddressType[]; // Many jobs only run with these address types
|
||||||
|
|
||||||
const api = '/api';
|
const api = '/api';
|
||||||
@ -170,6 +161,15 @@ const Results = (): JSX.Element => {
|
|||||||
.then(res => res.ip),
|
.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
|
// Fetch and parse SSL certificate info
|
||||||
const [sslResults, updateSslResults] = useMotherHook({
|
const [sslResults, updateSslResults] = useMotherHook({
|
||||||
jobId: 'ssl',
|
jobId: 'ssl',
|
||||||
|
Loading…
Reference in New Issue
Block a user