Sha256: 48b6d3056e466fb3dd3c1ebd0d4169b43dcf38f1f1b25d0b2701ddda2f938738
Contents?: true
Size: 788 Bytes
Versions: 4
Compression:
Stored size: 788 Bytes
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { spacing } from '../utilities/spacing.js' type TitleProps = { className?: String, children?: Array<React.ReactNode> | React.ReactNode, dark?: Boolean, size?: 1 | 2 | 3 | 4, text?: String, tag?: "h1" | "h2" | "h3", } const tagCSS = ({ dark = false, size = 3 }) => { let css = '' css += `_${size}` css += dark === true ? '_dark' : '' return css } const Title = (props: TitleProps) => { const { children, className, tag = 'h3', text } = props const Tag = `${tag}` return ( <Tag className={classnames( `pb_title_kit${tagCSS(props)}`, className, spacing(props), )} > {text || children} </Tag> ) } export default Title
Version data entries
4 entries across 4 versions & 1 rubygems