mirror of
https://github.com/Lissy93/web-check.git
synced 2025-01-24 23:28:36 +01:00
commit
361c65348d
@ -57,13 +57,13 @@ const Modal: React.FC<ModalProps> = ({ children, isOpen, closeModal }) => {
|
||||
}
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
const handleEscPress = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') {
|
||||
closeModal();
|
||||
}
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
if (isOpen) {
|
||||
window.addEventListener('keydown', handleEscPress);
|
||||
}
|
||||
@ -71,7 +71,7 @@ const Modal: React.FC<ModalProps> = ({ children, isOpen, closeModal }) => {
|
||||
return () => {
|
||||
window.removeEventListener('keydown', handleEscPress);
|
||||
};
|
||||
}, [isOpen]);
|
||||
}, [isOpen, closeModal]);
|
||||
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useMemo } from "react";
|
||||
|
||||
|
||||
const FancyBackground = (): JSX.Element => {
|
||||
@ -25,7 +25,7 @@ const FancyBackground = (): JSX.Element => {
|
||||
return result;
|
||||
};
|
||||
|
||||
const App: any = {};
|
||||
const App: any = useMemo(() => [], []);
|
||||
|
||||
App.setup = function () {
|
||||
|
||||
@ -335,7 +335,7 @@ const FancyBackground = (): JSX.Element => {
|
||||
requestAnimationFrame(frame);
|
||||
};
|
||||
frame();
|
||||
}, []);
|
||||
}, [App]);
|
||||
|
||||
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -38,6 +38,7 @@ const UserInputMain = styled.form`
|
||||
z-index: 2;
|
||||
`;
|
||||
|
||||
/*
|
||||
const FindIpButton = styled.a`
|
||||
margin: 0.5rem;
|
||||
cursor: pointer;
|
||||
@ -46,6 +47,7 @@ const FindIpButton = styled.a`
|
||||
color: ${colors.primary};
|
||||
text-decoration: underline;
|
||||
`;
|
||||
*/
|
||||
|
||||
const ErrorMessage = styled.p`
|
||||
color: ${colors.danger};
|
||||
@ -126,6 +128,8 @@ const Home = (): JSX.Element => {
|
||||
if (!isError) setErrMsg('');
|
||||
};
|
||||
|
||||
|
||||
// eslint-disable-next-line
|
||||
const findIpAddress = () => {
|
||||
setUserInput('');
|
||||
setPlaceholder('Looking up your IP...');
|
||||
@ -143,6 +147,7 @@ const Home = (): JSX.Element => {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const formSubmitEvent = (event: FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
submit();
|
||||
|
@ -132,7 +132,7 @@ const Results = (): JSX.Element => {
|
||||
}
|
||||
return newJobs;
|
||||
});
|
||||
}, []);
|
||||
}, [startTime]);
|
||||
|
||||
const parseJson = (response: Response): Promise<any> => {
|
||||
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 api = '/api';
|
||||
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user