diff --git a/frontend/package.json b/frontend/package.json index dc9fcb2..a08508e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -69,6 +69,7 @@ "@types/styled-components": "4.1.18", "husky": "^3.0.0", "lint-staged": "^9.2.0", + "react-axe": "^3.2.0", "tslint": "^5.18.0", "tslint-config-security": "^1.16.0", "tslint-eslint-rules": "^5.4.0", diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index 9258cb2..02366bc 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -385,7 +385,11 @@ class SidebarImpl extends React.Component { private renderRobotsTxtState = () => { return ( 🤖} + icon={ + + 🤖 + + } title="No data" description="This instance was not crawled because its robots.txt did not allow us to." /> diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 09a7ed6..d73f70b 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -29,3 +29,9 @@ ReactDOM.render( , document.getElementById("root") as HTMLElement ); + +if (process.env.NODE_ENV !== "production") { + // tslint:disable-next-line:no-var-requires + const axe = require("react-axe"); + axe(React, ReactDOM, 5000); +} diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 1e395df..204a699 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -2093,6 +2093,11 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== +axe-core@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-3.3.0.tgz#3b32d7e54390d89ff4891b20394d33ad7a192776" + integrity sha512-54XaTd2VB7A6iBnXMUG2LnBOI7aRbnrVxC5Tz+rVUwYl9MX/cIJc/Ll32YUoFIE/e9UKWMZoQenQu9dFrQyZCg== + axobject-query@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" @@ -8831,6 +8836,14 @@ react-app-polyfill@^1.0.1: regenerator-runtime "0.13.2" whatwg-fetch "3.0.0" +react-axe@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/react-axe/-/react-axe-3.2.0.tgz#d17427e5d54d6c4561e74ad9cf8c1839e411bde3" + integrity sha512-2KlO2wZq58+GSFP4oWA2ZjU1ggbXdDLJc7tMUXUXkE4NVQ3FftdYtb7qNR+x1nTLeuVYiH4nH4hzIz9vQZ/Chw== + dependencies: + axe-core "^3.0.0" + requestidlecallback "^0.3.0" + react-dev-utils@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-9.0.1.tgz#5c03d85a0b2537d0c46af7165c24a7dfb274bef2" @@ -9306,6 +9319,11 @@ request@^2.87.0, request@^2.88.0: tunnel-agent "^0.6.0" uuid "^3.3.2" +requestidlecallback@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/requestidlecallback/-/requestidlecallback-0.3.0.tgz#6fb74e0733f90df3faa4838f9f6a2a5f9b742ac5" + integrity sha1-b7dOBzP5DfP6pIOPn2oqX5t0KsU= + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"