mirror of
https://github.com/explosion/spaCy.git
synced 2025-12-31 22:13:40 +03:00
* 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>
28 lines
687 B
JavaScript
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,
|
|
}
|