-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Copy pathactivityitempersonas.stories.tsx
147 lines (144 loc) · 3.76 KB
/
activityitempersonas.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import * as React from 'react';
import { ActivityItem, IActivityItemProps, Link, mergeStyleSets } from '@fluentui/react';
import { TestImages } from '@fluentui/example-data';
const classNames = mergeStyleSets({
exampleRoot: {
marginTop: '20px',
},
nameText: {
fontWeight: 'bold',
},
});
export const ActivityItemPersonaExample: React.FunctionComponent = () => {
const activityItemExamples: (IActivityItemProps & { key: string | number })[] = [
{
key: 1,
activityDescription: [
<Link
key={1}
className={classNames.nameText}
onClick={() => {
alert('A name was clicked.');
}}
>
Jack Howden
</Link>,
<span key={2}> renamed </span>,
<span key={3} className={classNames.nameText}>
DocumentTitle.docx
</span>,
],
activityPersonas: [{ imageUrl: TestImages.personaMale }],
comments: 'Hello, this is the text of my basic comment!',
timeStamp: '23m ago',
},
{
key: 2,
activityDescription: [
<Link
key={1}
className={classNames.nameText}
onClick={() => {
alert('A name was clicked.');
}}
>
Javiera Márquez
</Link>,
<span key={2}> and </span>,
<Link
key={3}
className={classNames.nameText}
onClick={() => {
alert('A name was clicked.');
}}
>
Amelia Povalіy
</Link>,
<span key={4}> edited </span>,
<Link
key={5}
className={classNames.nameText}
onClick={() => {
alert('A document was clicked.');
}}
>
SpreadsheetTitle.xlsx
</Link>,
],
activityPersonas: [{ imageInitials: 'JM', text: 'Javiera Márquez' }, { imageUrl: TestImages.personaFemale }],
timeStamp: '9:27 am',
},
{
key: 3,
activityDescription: [
<Link
key={1}
className={classNames.nameText}
onClick={() => {
alert('A name was clicked.');
}}
>
Robert Larsson
</Link>,
<span key={2}> and </span>,
<Link
key={3}
className={classNames.nameText}
onClick={() => {
alert('A name was clicked.');
}}
>
2 others
</Link>,
<span key={4}> commented </span>,
],
activityPersonas: [
{ imageInitials: 'RL', text: 'Robert Larsson' },
{ imageUrl: TestImages.personaMale },
{ imageUrl: TestImages.personaFemale },
],
timeStamp: '3 days ago',
},
{
key: 4,
activityDescription: [
<Link
key={1}
className={classNames.nameText}
onClick={() => {
alert('A name was clicked.');
}}
>
Jin Cheng
</Link>,
<span key={2}> and </span>,
<Link
key={3}
className={classNames.nameText}
onClick={() => {
alert('A name was clicked.');
}}
>
5 others
</Link>,
<span key={4}> edited this file</span>,
],
activityPersonas: [
{ imageInitials: 'JC', text: 'Jin Cheng' },
{ imageUrl: TestImages.personaMale },
{ imageInitials: 'AL', text: 'Annie Lindqvist' },
{ imageUrl: TestImages.personaFemale },
{ imageUrl: TestImages.personaMale },
{ imageUrl: TestImages.personaMale },
],
timeStamp: 'August 3, 2017',
},
];
return (
<div>
{activityItemExamples.map((item: { key: string | number }) => (
<ActivityItem {...item} key={item.key} className={classNames.exampleRoot} />
))}
</div>
);
};