import * as React from 'react'; import styled from 'styled-components'; import { Link } from '../components/link'; import { HeaderSizes, Styles } from '../types'; import { colors } from '../utils/colors'; export interface AnchorTitleProps { title: string | React.ReactNode; id: string; headerSize: HeaderSizes; shouldShowAnchor: boolean; isDisabled: boolean; } export interface AnchorTitleState {} const styles: Styles = { h1: { fontSize: '1.875em', }, h2: { fontSize: '1.5em', fontWeight: 400, }, h3: { fontSize: '1.17em', }, }; interface AnchorIconProps { shouldShowAnchor: boolean; } const AnchorIcon = styled.i < AnchorIconProps > ` opacity: ${props => (props.shouldShowAnchor ? 1 : 0)}; &:hover { opacity: ${props => (props.shouldShowAnchor ? 0.6 : 0)}; } font-size: 20px; transform: rotate(45deg); cursor: pointer; `; export class AnchorTitle extends React.Component { public static defaultProps: Partial = { isDisabled: false, }; public render(): React.ReactNode { return (
{this.props.title}
{!this.props.isDisabled && ( )}
); } }