From 6e17948e10dd8b40b718155b55f8ec153ae7f7d4 Mon Sep 17 00:00:00 2001 From: Theo Date: Thu, 11 Apr 2019 14:44:52 +0100 Subject: [PATCH] `EuiTitle` code review fix --- src/components/title/title.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/title/title.tsx b/src/components/title/title.tsx index 7312c79dd090..6345efd6c2e6 100644 --- a/src/components/title/title.tsx +++ b/src/components/title/title.tsx @@ -1,6 +1,6 @@ import React, { FunctionComponent, ReactElement } from 'react'; import classNames from 'classnames'; -import { keysOf } from '../common'; +import { CommonProps, keysOf } from '../common'; const titleSizeToClassNameMap = { xxxs: 'euiTitle--xxxsmall', @@ -21,14 +21,16 @@ const textTransformToClassNameMap = { export const TEXT_TRANSFORM = keysOf(textTransformToClassNameMap); export type EuiTitleTextTransform = keyof typeof textTransformToClassNameMap; -export interface EuiTitleProps { - children: ReactElement; - className?: string; - size?: EuiTitleSize; - textTransform?: EuiTitleTextTransform; -} +export type EuiTitleProps = FunctionComponent< + CommonProps & { + children: ReactElement; + className?: string; + size?: EuiTitleSize; + textTransform?: EuiTitleTextTransform; + } +>; -export const EuiTitle: FunctionComponent = ({ +export const EuiTitle: EuiTitleProps = ({ size = 'm', children, className,