From 7464b16de24df464b2abc4ada6a53861d180b2aa Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Thu, 24 May 2018 14:38:21 +0200 Subject: [PATCH] =?UTF-8?q?:wheelchair:=20am=C3=A9liore=20l'accessibilit?= =?UTF-8?q?=C3=A9=20de=20la=20page=20r=C3=A8gle=20et=20de=20la=20modale=20?= =?UTF-8?q?(navigation=20clavier=20++)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 ++ source/components/AttachDictionary.js | 6 ++--- source/components/Overlay.css | 8 ++++++- source/components/Overlay.js | 32 ++++++++++++++++++++------- source/components/SearchButton.js | 32 ++++++++++++++++----------- source/components/rule/Algorithm.css | 18 ++++++++++----- source/containers/Layout.css | 2 ++ yarn.lock | 16 ++++++++++++++ 8 files changed, 85 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index b31fd0d4b..80561f8a3 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,8 @@ "fantasy-tuples": "^1.0.0", "file-loader": "^1.1.11", "flow": "^0.2.3", + "focus-trap": "^2.4.5", + "focus-trap-react": "^3.1.2", "fuse.js": "^3.2.0", "global": "^4.3.2", "google-translate-api": "^2.3.0", diff --git a/source/components/AttachDictionary.js b/source/components/AttachDictionary.js index 71ac28081..e568944c7 100644 --- a/source/components/AttachDictionary.js +++ b/source/components/AttachDictionary.js @@ -1,7 +1,7 @@ +import marked from 'Engine/marked' import { path } from 'ramda' import React, { Component } from 'react' import ReactDOM from 'react-dom' -import marked from 'Engine/marked' import './Dictionary.css' import Overlay from './Overlay' @@ -35,9 +35,7 @@ export let AttachDictionary = dictionary => Decorated => /> {explanation && ( - this.setState({ term: null, explanation: null }) - }> + onClose={() => this.setState({ term: null, explanation: null })}>
-
{ - e.preventDefault() - e.stopPropagation() +
+ - {this.props.children} -
+
{ + e.preventDefault() + e.stopPropagation() + }}> + {children} + +
+
) } diff --git a/source/components/SearchButton.js b/source/components/SearchButton.js index 59d1c2069..f78c4ab05 100644 --- a/source/components/SearchButton.js +++ b/source/components/SearchButton.js @@ -1,16 +1,14 @@ +import withColours from 'Components/withColours' import React, { Component } from 'react' import { Trans, translate } from 'react-i18next' import { connect } from 'react-redux' -import './SearchButton.css' import Overlay from './Overlay' +import './SearchButton.css' import { SearchBar } from './pages/RulesList' -import withColours from 'Components/withColours' -@connect( - state => ({ - flatRules: state.flatRules - }) -) +@connect(state => ({ + flatRules: state.flatRules +})) @withColours @translate() export default class SearchButton extends Component { @@ -39,17 +37,25 @@ export default class SearchButton extends Component { return (
{this.state.visible ? ( - -

Chercher une règle

- + +

+ Chercher une règle +

+
) : (