Added no issues message

This commit is contained in:
z0ccc 2021-09-09 17:17:48 -04:00
parent e660655864
commit 2a4b4c4453
4 changed files with 26 additions and 16 deletions

View file

@ -7,10 +7,10 @@ import {
checkNavigatorProperties,
checkWebWorker,
checkScreenProperties,
getBrowser,
getUserAgentData,
} from './main';
const PredictionBlock = () => {
const OtherBlock = () => {
const [firstRender, setfirstRender] = useState(true);
const [workerData, setWorkerData] = useState('');
const [userAgent, setUserAgent] = useState();
@ -29,12 +29,13 @@ const PredictionBlock = () => {
return (
<ScanBlock>
<h1>Data</h1>
<h1>Other</h1>
{userAgent && (
<div className="boxWrap">
<div className="newline">
{/* <Table type="screen" data={getUserAgentData()} /> */}
{/* <div className="newline">
{getBrowser(userAgent.browser.name)} {userAgent.browser.version}
</div>
</div> */}
<div className="newline">
{userAgent.os.name} {userAgent.os.versionName}
</div>
@ -48,4 +49,4 @@ const PredictionBlock = () => {
);
};
export default PredictionBlock;
export default OtherBlock;

View file

@ -1,5 +1,5 @@
/* eslint-disable no-unused-vars */
import PredictionBlock from './PredictionBlock';
import OtherBlock from './OtherBlock';
import NavigatorBlock from './NavigatorBlock';
import ScreenBlock from './ScreenBlock';
import FingerprintBlock from './FingerprintBlock';
@ -12,7 +12,7 @@ import FiltersBlock from './FiltersBlock';
const ScanBlocks = () => (
<>
<PredictionBlock />
<OtherBlock />
<ScreenBlock />
<NavigatorBlock />
{/* <LocationBlock />

View file

@ -29,6 +29,8 @@ const TableRow = ({ item }) => {
<td>{item.title}</td>
<td>{item.value}</td>
<td>
{issues ? (
<>
{item.issues.map((ele, index) => (
<div className="newline" key={index}>
{ele}
@ -37,6 +39,10 @@ const TableRow = ({ item }) => {
<div className="newline">
{workerData && <>{`Did not match web worker (${workerData})`}</>}
</div>
</>
) : (
'No issues'
)}
</td>
</tr>
);

View file

@ -9,6 +9,7 @@ export {
getScreen,
checkScreenProperties,
getBrowser,
getUserAgentData,
};
const getDeviceMemory = () => ({
@ -278,6 +279,8 @@ const getScreen = () => [
getColorDepth(),
];
const getUserAgentData = () => [getBrowser()];
// sorts plugins object into comma separated list
const sortPlugins = (data) => {
const { length } = data;