MetaPhase-Consulting/State-TalentMAP

View on GitHub
src/Components/PageTitle/PageTitle.jsx

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import PropTypes from 'prop-types';

const propTypes = {
  pageTitle: PropTypes.string.isRequired,
  srOnly: PropTypes.bool,
};

const defaultProps = {
  srOnly: false,
};

const PageTitle = ({ pageTitle, srOnly }) => (
  <h1 className={srOnly ? 'sr-only' : ''} id="page-title" tabIndex="-1">{pageTitle}</h1>
);

PageTitle.propTypes = propTypes;

PageTitle.defaultProps = defaultProps;

export default PageTitle;