spaCy/website/src/components/readnext.js
Marcus Blättermann 49237f05a6
Fix aria-hidden element (#12163)
* Rename CSS class to make use more clear

* Rename component prop to improve code readability

* Fix `aria-hidden` directly on a link element

This link wouldn't have been clickable by screenreaders

* Refactor component

This removes a unnessary `div` and a duplicate link

Co-authored-by: Ines Montani <ines@ines.io>
2023-01-24 14:44:47 +01:00

28 lines
687 B
JavaScript

import React from 'react'
import PropTypes from 'prop-types'
import Icon from './icon'
import Link from './link'
import { Label } from './typography'
import classes from '../styles/readnext.module.sass'
export default function ReadNext({ title, to }) {
return (
<Link to={to} noLinkLayout className={classes.root}>
<span>
<Label>Read next</Label>
{title}
</span>
<span className={classes.icon}>
<Icon name="arrowright" aria-hidden="true" />
</span>
</Link>
)
}
ReadNext.propTypes = {
title: PropTypes.string.isRequired,
to: PropTypes.string.isRequired,
}