diff --git a/src-docs/src/views/comment/comment.tsx b/src-docs/src/views/comment/comment.tsx index 7cf8fd35442..e4260300150 100644 --- a/src-docs/src/views/comment/comment.tsx +++ b/src-docs/src/views/comment/comment.tsx @@ -43,7 +43,7 @@ export default () => ( username="janed" event="added a comment" actions={copyAction} - timestamp="Jan 1, 2020"> + timestamp="on Jan 1, 2020"> {body} ( type="update" actions={copyAction} event="pushed incident X0Z235" - timestamp="Jan 3, 2020" + timestamp="on Jan 3, 2020" timelineIcon={ ( username="pancho1" type="update" event="edited case" - timestamp="Jan 9, 2020" + timestamp="on Jan 9, 2020" /> ( } - timestamp="Jan 11, 2020" + timestamp="on Jan 11, 2020" timelineIcon="tag" /> }> {longBody} diff --git a/src-docs/src/views/comment/comment_example.js b/src-docs/src/views/comment/comment_example.js index 43619aee12e..c112a2b91cd 100644 --- a/src-docs/src/views/comment/comment_example.js +++ b/src-docs/src/views/comment/comment_example.js @@ -160,7 +160,7 @@ export const CommentExample = { EuiAvatar - ). It is recommended not to use an element larger that 40x40. + ). It is recommended not to use an element larger than 40x40. diff --git a/src-docs/src/views/comment/comment_types.tsx b/src-docs/src/views/comment/comment_types.tsx index c8bd4721b15..2d9557719a7 100644 --- a/src-docs/src/views/comment/comment_types.tsx +++ b/src-docs/src/views/comment/comment_types.tsx @@ -21,23 +21,20 @@ const bodyUpdate = ( export default () => (
- + {body} + timestamp="6 hours ago"> {bodyUpdate}
diff --git a/src/components/comment/__snapshots__/comment.test.tsx.snap b/src/components/comment/__snapshots__/comment.test.tsx.snap index aadec40c48c..52ab2e550b4 100644 --- a/src/components/comment/__snapshots__/comment.test.tsx.snap +++ b/src/components/comment/__snapshots__/comment.test.tsx.snap @@ -178,7 +178,6 @@ exports[`EuiComment props timestamp is rendered 1`] = `
- on diff --git a/src/components/comment/__snapshots__/comment_event.test.tsx.snap b/src/components/comment/__snapshots__/comment_event.test.tsx.snap index ef8230a37df..d614313b717 100644 --- a/src/components/comment/__snapshots__/comment_event.test.tsx.snap +++ b/src/components/comment/__snapshots__/comment_event.test.tsx.snap @@ -71,7 +71,6 @@ exports[`EuiCommentEvent props timestamp is rendered 1`] = `
- on diff --git a/src/components/comment/comment_event.tsx b/src/components/comment/comment_event.tsx index 9bfaedd80ef..4005b66f980 100644 --- a/src/components/comment/comment_event.tsx +++ b/src/components/comment/comment_event.tsx @@ -1,10 +1,9 @@ -import React, { FunctionComponent, ReactNode } from 'react'; +import React, { FunctionComponent, HTMLAttributes, ReactNode } from 'react'; import { CommonProps, keysOf } from '../common'; import classNames from 'classnames'; -import { EuiI18n } from '../i18n'; export type EuiCommentEventProps = CommonProps & - CommonProps & { + HTMLAttributes & { /** * Author of the comment. Display a small icon or avatar with it if needed. */ @@ -59,7 +58,6 @@ export const EuiCommentEvent: FunctionComponent = ({
{event}
{timestamp ? (
- {' '}
) : ( diff --git a/src/components/comment/comment_timeline.tsx b/src/components/comment/comment_timeline.tsx index cbf58138788..2f1252f646d 100644 --- a/src/components/comment/comment_timeline.tsx +++ b/src/components/comment/comment_timeline.tsx @@ -1,15 +1,16 @@ -import React, { FunctionComponent, ReactNode } from 'react'; +import React, { FunctionComponent, HTMLAttributes, ReactNode } from 'react'; import { CommonProps, keysOf } from '../common'; import classNames from 'classnames'; -import { EuiIcon } from '../icon'; +import { EuiIcon, IconType } from '../icon'; -export type EuiCommentTimelineProps = CommonProps & { - /** - * Main icon that accompanies the comment. The default is `user` for regular comments and `dot` for update comments. To customize, pass a `string` as an `EuiIcon['type']` or any `ReactNode`. - */ - timelineIcon?: ReactNode | string; - type?: EuiCommentType; -}; +export type EuiCommentTimelineProps = CommonProps & + HTMLAttributes & { + /** + * Main icon that accompanies the comment. The default is `user` for regular comments and `dot` for update comments. To customize, pass a `string` as an `EuiIcon['type']` or any `ReactNode`. + */ + timelineIcon?: ReactNode | IconType; + type?: EuiCommentType; + }; const typeToClassNameMap = { regular: 'euiCommentTimeline__icon--regular', diff --git a/src/components/comment/index.ts b/src/components/comment/index.ts index 5a1c059f78b..23f3dc8bdb5 100644 --- a/src/components/comment/index.ts +++ b/src/components/comment/index.ts @@ -1,5 +1,5 @@ -export { EuiComment } from './comment'; +export { EuiComment, EuiCommentProps } from './comment'; -export { EuiCommentEvent } from './comment_event'; +export { EuiCommentEvent, EuiCommentType } from './comment_event'; export { EuiCommentTimeline } from './comment_timeline';