Skip to content

Commit f6c139e

Browse files
committed
Storybook - Create simple storybook for EuiCommentEvent to demonstrate the color toggling
1 parent e0a2a4e commit f6c139e

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
import React from 'react';
10+
import type { Meta, StoryObj } from '@storybook/react';
11+
12+
import { EuiCommentEvent, EuiCommentEventProps } from './comment_event';
13+
import { EuiText } from '../text';
14+
import { EuiButtonIcon } from '../button';
15+
16+
const meta: Meta<EuiCommentEventProps> = {
17+
title: 'EuiCommentEvent',
18+
component: EuiCommentEvent,
19+
args: {
20+
username: 'janed',
21+
},
22+
};
23+
24+
export default meta;
25+
type Story = StoryObj<EuiCommentEventProps>;
26+
27+
export const Playground: Story = {
28+
args: {
29+
event: 'added a comment',
30+
eventIcon: 'faceHappy',
31+
eventIconAriaLabel: 'Happy face comment icon',
32+
timestamp: 'on Jan 1, 2020',
33+
children: (
34+
<EuiText size="s">
35+
<p>
36+
Far out in the uncharted backwaters of the unfashionable end of the
37+
western spiral arm of the Galaxy lies a small unregarded yellow sun.
38+
</p>
39+
</EuiText>
40+
),
41+
actions: (
42+
<EuiButtonIcon
43+
title="Custom action"
44+
aria-label="Custom action"
45+
color="text"
46+
iconType="copy"
47+
/>
48+
),
49+
},
50+
};

0 commit comments

Comments
 (0)