Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
greg's feedback
Browse files Browse the repository at this point in the history
andreadelrio committed Apr 7, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 12eb136 commit c96b3cc
Showing 8 changed files with 23 additions and 29 deletions.
10 changes: 5 additions & 5 deletions src-docs/src/views/comment/comment.tsx
Original file line number Diff line number Diff line change
@@ -43,15 +43,15 @@ export default () => (
username="janed"
event="added a comment"
actions={copyAction}
timestamp="Jan 1, 2020">
timestamp="on Jan 1, 2020">
{body}
</EuiComment>
<EuiComment
username="juanab"
type="update"
actions={copyAction}
event="pushed incident X0Z235"
timestamp="Jan 3, 2020"
timestamp="on Jan 3, 2020"
timelineIcon={
<EuiAvatar
imageUrl="https://source.unsplash.com/64x64/?woman"
@@ -64,7 +64,7 @@ export default () => (
username="pancho1"
type="update"
event="edited case"
timestamp="Jan 9, 2020"
timestamp="on Jan 9, 2020"
/>
<EuiComment
actions={copyAction}
@@ -88,14 +88,14 @@ export default () => (
</EuiFlexItem>
</EuiFlexGroup>
}
timestamp="Jan 11, 2020"
timestamp="on Jan 11, 2020"
timelineIcon="tag"
/>
<EuiComment
username="elohar"
event="added a comment"
actions={copyAction}
timestamp="Jan 14, 2020"
timestamp="on Jan 14, 2020"
timelineIcon={<EuiAvatar size="l" name="Eloha" />}>
{longBody}
</EuiComment>
2 changes: 1 addition & 1 deletion src-docs/src/views/comment/comment_example.js
Original file line number Diff line number Diff line change
@@ -160,7 +160,7 @@ export const CommentExample = {
<Link to="/display/avatar">
<strong>EuiAvatar</strong>
</Link>
). It is recommended not to use an element larger that 40x40.
). It is recommended not to use an element larger than 40x40.
</li>
</ol>
</div>
9 changes: 3 additions & 6 deletions src-docs/src/views/comment/comment_types.tsx
Original file line number Diff line number Diff line change
@@ -21,23 +21,20 @@ const bodyUpdate = (

export default () => (
<div>
<EuiComment
username="andred"
event="added a comment"
timestamp="Jan 1, 2020">
<EuiComment username="andred" event="added a comment" timestamp="yesteday">
{body}
</EuiComment>
<EuiComment
username="luisg"
type="update"
event="edited case"
timestamp="Jan 3, 2020"
timestamp="22 hours ago"
/>
<EuiComment
username="milal"
type="update"
event="edited case"
timestamp="Jan 4, 2020">
timestamp="6 hours ago">
{bodyUpdate}
</EuiComment>
</div>
1 change: 0 additions & 1 deletion src/components/comment/__snapshots__/comment.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -178,7 +178,6 @@ exports[`EuiComment props timestamp is rendered 1`] = `
<div
class="euiCommentEvent__headerTimestamp"
>
on
<time>
21 days ago
</time>
Original file line number Diff line number Diff line change
@@ -71,7 +71,6 @@ exports[`EuiCommentEvent props timestamp is rendered 1`] = `
<div
class="euiCommentEvent__headerTimestamp"
>
on
<time>
21 days ago
</time>
6 changes: 2 additions & 4 deletions src/components/comment/comment_event.tsx
Original file line number Diff line number Diff line change
@@ -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<HTMLDivElement> & {
/**
* Author of the comment. Display a small icon or avatar with it if needed.
*/
@@ -59,7 +58,6 @@ export const EuiCommentEvent: FunctionComponent<EuiCommentEventProps> = ({
<div className="euiCommentEvent__headerEvent">{event}</div>
{timestamp ? (
<div className="euiCommentEvent__headerTimestamp">
<EuiI18n token="euiCommentEvent.onDate" default="on" />{' '}
<time>{timestamp}</time>
</div>
) : (
19 changes: 10 additions & 9 deletions src/components/comment/comment_timeline.tsx
Original file line number Diff line number Diff line change
@@ -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<HTMLDivElement> & {
/**
* 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',
4 changes: 2 additions & 2 deletions src/components/comment/index.ts
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit c96b3cc

Please sign in to comment.