diff --git a/client/components/SkipLink.jsx b/client/components/SkipLink.jsx new file mode 100644 index 0000000000..13f472d1a2 --- /dev/null +++ b/client/components/SkipLink.jsx @@ -0,0 +1,35 @@ +import React, { useState } from 'react'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; +import { useTranslation } from 'react-i18next'; + +const SkipLink = ({ targetId, text }) => { + const [focus, setFocus] = useState(false); + const { t } = useTranslation(); + const handleFocus = () => { + setFocus(true); + }; + + const handleBlur = () => { + setFocus(false); + }; + const linkClasses = classNames('skip_link', { focus }); + + return ( + + {t(`SkipLink.${text}`)} + + ); +}; + +SkipLink.propTypes = { + targetId: PropTypes.string.isRequired, + text: PropTypes.string.isRequired +}; + +export default SkipLink; diff --git a/client/index.jsx b/client/index.jsx index 62b6cb1342..6c2e2e40b7 100644 --- a/client/index.jsx +++ b/client/index.jsx @@ -9,6 +9,7 @@ import Routing from './routes'; import ThemeProvider from './modules/App/components/ThemeProvider'; import Loader from './modules/App/components/loader'; import './i18n'; +import SkipLink from './components/SkipLink'; require('./styles/main.scss'); @@ -23,6 +24,7 @@ const App = () => ( + diff --git a/client/modules/IDE/components/Header/Toolbar.jsx b/client/modules/IDE/components/Header/Toolbar.jsx index f61f56ed0e..5ebdbdafea 100644 --- a/client/modules/IDE/components/Header/Toolbar.jsx +++ b/client/modules/IDE/components/Header/Toolbar.jsx @@ -61,6 +61,7 @@ const Toolbar = (props) => {