26 lines
482 B
JavaScript
26 lines
482 B
JavaScript
import React from "react"
|
|
import PropTypes from "prop-types"
|
|
|
|
export const Title = ({ title, xs }) => {
|
|
if (title === "") { return null; }
|
|
|
|
if (xs) {
|
|
return (<h5>{title}</h5>)
|
|
} else {
|
|
return (
|
|
<span>
|
|
<h2 className="d-none d-sm-block">{title}</h2>
|
|
<h4 className="d-block d-sm-none">{title}</h4>
|
|
</span>
|
|
);
|
|
}
|
|
}
|
|
Title.propTypes = {
|
|
title: PropTypes.string,
|
|
xs: PropTypes.bool,
|
|
};
|
|
Title.defaultProps = {
|
|
title: "",
|
|
xs: false,
|
|
};
|