@hackoregon/component-library
Version:
Official repo for Hack Oregon React component library
44 lines (35 loc) • 1.66 kB
JavaScript
function _templateObject2() {
var data = _taggedTemplateLiteral(["\n display: block;\n font-family: \"Roboto Condensed\", \"Helvetica Neue\", Helvetica, sans-serif;\n font-size: 14px;\n text-align: center;\n margin: 10px 0;\n\n @media (max-width: 640px) {\n text-align: left;\n }\n"]);
_templateObject2 = function _templateObject2() {
return data;
};
return data;
}
function _templateObject() {
var data = _taggedTemplateLiteral(["\n display: block;\n font-family: \"Roboto Condensed\", \"Helvetica Neue\", Helvetica, sans-serif;\n font-size: 21px;\n font-weight: bold;\n text-align: center;\n margin: 0;\n\n @media (max-width: 640px) {\n text-align: left;\n }\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
import React from "react";
import PropTypes from "prop-types";
import { css } from "emotion";
var titleStyle = css(_templateObject());
var subtitleStyle = css(_templateObject2());
var ChartTitle = function ChartTitle(_ref) {
var title = _ref.title,
subtitle = _ref.subtitle;
return title || subtitle ? React.createElement("figcaption", null, title ? React.createElement("h2", {
className: titleStyle
}, title) : null, subtitle ? React.createElement("h3", {
className: subtitleStyle
}, subtitle) : null) : null;
};
ChartTitle.propTypes = {
title: PropTypes.string,
subtitle: PropTypes.string
};
ChartTitle.defaultProps = {};
export default ChartTitle;