Finished intl block
This commit is contained in:
parent
77e3ff68b7
commit
cc24fe936c
4 changed files with 46 additions and 16 deletions
|
|
@ -1,11 +1,28 @@
|
||||||
|
/* eslint-disable no-unused-vars */
|
||||||
|
import { useState, useEffect } from 'react';
|
||||||
import ScanBlock from './ScanBlock';
|
import ScanBlock from './ScanBlock';
|
||||||
import Table from './Table';
|
import Table from './Table';
|
||||||
import { getIntl } from './main';
|
import { getIntl } from './main';
|
||||||
|
import { ReactComponent as CheckCircle } from '../images/checkCircle.svg';
|
||||||
|
|
||||||
const DateBlock = () => (
|
const DateBlock = () => (
|
||||||
<ScanBlock>
|
<ScanBlock>
|
||||||
<h1>Intl</h1>
|
<h1>Intl</h1>
|
||||||
<Table type="navigator" data={getIntl()} />
|
<div className="tableWrap">
|
||||||
|
<table>
|
||||||
|
{Object.entries(Intl.DateTimeFormat().resolvedOptions()).map((item) => (
|
||||||
|
<tbody key={item[0]}>
|
||||||
|
<tr>
|
||||||
|
<td>{item[0]}</td>
|
||||||
|
<td>{item[1]}</td>
|
||||||
|
<td>
|
||||||
|
<CheckCircle className="circleButton" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
))}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<b>Explanation:</b> JavaScript can be used to find information about your
|
<b>Explanation:</b> JavaScript can be used to find information about your
|
||||||
hardware. This information can be used to create a fingerprint.
|
hardware. This information can be used to create a fingerprint.
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,12 @@ const OtherBlock = () => {
|
||||||
<td>{adBlockDetected ? 'True' : 'False'}</td>
|
<td>{adBlockDetected ? 'True' : 'False'}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Timezone offset</td>
|
||||||
|
<td>{new Date().getTimezoneOffset()}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Battery level</td>
|
<td>Battery level</td>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ const TableRow = ({ item }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr className={issues ? 'issue' : ''}>
|
<tr className={issues ? 'issue' : ''}>
|
||||||
<td>{item.title}</td>
|
<td>{item.key}</td>
|
||||||
<td>{item.value}</td>
|
<td>{item.value}</td>
|
||||||
<td>
|
<td>
|
||||||
{issues ? (
|
{issues ? (
|
||||||
|
|
|
||||||
|
|
@ -286,13 +286,6 @@ const getScreen = () => [
|
||||||
// issues: [],
|
// issues: [],
|
||||||
// });
|
// });
|
||||||
|
|
||||||
const getCalendar = () => ({
|
|
||||||
key: 'calendar',
|
|
||||||
title: 'Calendar',
|
|
||||||
value: Intl.DateTimeFormat().resolvedOptions().calendar,
|
|
||||||
issues: [],
|
|
||||||
});
|
|
||||||
|
|
||||||
const getTimezone = () => ({
|
const getTimezone = () => ({
|
||||||
key: 'timezone',
|
key: 'timezone',
|
||||||
title: 'Timezone',
|
title: 'Timezone',
|
||||||
|
|
@ -300,14 +293,21 @@ const getTimezone = () => ({
|
||||||
issues: [],
|
issues: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
// const getTimezoneOffset = () => ({
|
const getHourCycle = () => ({
|
||||||
// key: 'timezoneOffset',
|
key: 'hourCycle',
|
||||||
// title: 'Timezone offset',
|
title: 'Hour cycle',
|
||||||
// value: new Date().getTimezoneOffset(),
|
value: Intl.DateTimeFormat().resolvedOptions().hourCycle,
|
||||||
// issues: [],
|
issues: [],
|
||||||
// });
|
});
|
||||||
|
|
||||||
const getIntl = () => [getCalendar(), getTimezone()];
|
const getCalendar = () => ({
|
||||||
|
key: 'calendar',
|
||||||
|
title: 'Calendar',
|
||||||
|
value: Intl.DateTimeFormat().resolvedOptions().calendar,
|
||||||
|
issues: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
const getIntl = () => [getTimezone(), getHourCycle(), getCalendar()];
|
||||||
|
|
||||||
const detectTor = () => {
|
const detectTor = () => {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
|
|
@ -322,6 +322,13 @@ const detectTor = () => {
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// const getTimezoneOffset = () => ({
|
||||||
|
// key: 'timezoneOffset',
|
||||||
|
// title: 'Timezone offset',
|
||||||
|
// value: new Date().getTimezoneOffset(),
|
||||||
|
// issues: [],
|
||||||
|
// });
|
||||||
|
|
||||||
// const getTor = () => ({
|
// const getTor = () => ({
|
||||||
// key: 'tor',
|
// key: 'tor',
|
||||||
// title: 'Tor browser',
|
// title: 'Tor browser',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue