-
Notifications
You must be signed in to change notification settings - Fork 112
/
ChatLogExamples.ts
313 lines (301 loc) · 8.84 KB
/
ChatLogExamples.ts
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
export const basicInboundMessage = `
const BasicMessage = () => {
return (
<ChatLog>
<ChatMessage variant='inbound'>
<ChatBubble>
Ahoy!
</ChatBubble>
</ChatMessage>
</ChatLog>
);
};
render(
<BasicMessage />
)`.trim();
export const basicOutboundMessage = `
const BasicMessage = () => {
return (
<ChatLog>
<ChatMessage variant='outbound'>
<ChatBubble>
Howdy!
</ChatBubble>
</ChatMessage>
</ChatLog>
);
};
render(
<BasicMessage />
)`.trim();
export const inboundMessageMeta = `
const MessageWithMeta = () => {
return (
<ChatLog>
<ChatMessage variant='inbound'>
<ChatBubble>
Hello, what can I help you with?
</ChatBubble>
<ChatMessageMeta aria-label="said by Gibby Radki 4 minutes ago">
<ChatMessageMetaItem>
<Avatar name="Gibby Radki" size="sizeIcon20" />
Gibby Radki ・ 4 minutes ago
</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
</ChatLog>
);
};
render(
<MessageWithMeta />
)`.trim();
export const outboundMessageMeta = `
const MessageWithMeta = () => {
return (
<ChatLog>
<ChatMessage variant='outbound'>
<ChatBubble>
Will this presentation be recorded?
</ChatBubble>
<ChatMessageMeta aria-label="said by you at 4:27 PM">
<ChatMessageMetaItem>
4:27 PM
</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
</ChatLog>
);
};
render(
<MessageWithMeta />
)`.trim();
export const inboundMessageAttachment = `
const MessageWithAttachment = () => {
return (
<ChatLog>
<ChatMessage variant='inbound'>
<ChatBubble>
<ChatAttachment attachmentIcon={<DownloadIcon color="colorTextIcon" decorative />}>
<ChatAttachmentLink href="#">receipt.pdf</ChatAttachmentLink>
<ChatAttachmentDescription>9 MB</ChatAttachmentDescription>
</ChatAttachment>
</ChatBubble>
</ChatMessage>
</ChatLog>
);
};
render(
<MessageWithAttachment />
)`.trim();
export const outboundMessageAttachment = `
const MessageWithAttachment = () => {
return (
<ChatLog>
<ChatMessage variant='outbound'>
<ChatBubble>
<ChatAttachment attachmentIcon={<DownloadIcon color="colorTextIcon" decorative />}>
<ChatAttachmentLink href="#">document-FINAL.doc</ChatAttachmentLink>
<ChatAttachmentDescription>123 MB</ChatAttachmentDescription>
</ChatAttachment>
</ChatBubble>
</ChatMessage>
</ChatLog>
);
};
render(
<MessageWithAttachment />
)
`.trim();
export const inboundComplexMessage = `
const ComplexMessage = () => {
return (
<ChatLog>
<ChatMessage variant='inbound'>
<ChatBubble>
I have a copy of the receipt, can you print it?
</ChatBubble>
<ChatBubble>
<ChatAttachment attachmentIcon={<DownloadIcon color="colorTextIcon" decorative />}>
<ChatAttachmentLink href="#">receipt.pdf</ChatAttachmentLink>
<ChatAttachmentDescription>9 MB</ChatAttachmentDescription>
</ChatAttachment>
</ChatBubble>
<ChatMessageMeta aria-label="said by Gibby Radki at 11:27 AM">
<ChatMessageMetaItem>
<Avatar name="Gibby Radki" size="sizeIcon20" />
Gibby Radki ・ 11:27 AM
</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
</ChatLog>
);
};
render(
<ComplexMessage />
)`.trim();
export const outboundComplexMessage = `
const ComplexMessage = () => {
return (
<ChatLog>
<ChatMessage variant='outbound'>
<ChatBubble>
Here is the document:
</ChatBubble>
<ChatBubble>
<ChatAttachment attachmentIcon={<DownloadIcon color="colorTextIcon" decorative />}>
<ChatAttachmentLink href="#">document-FINAL.doc</ChatAttachmentLink>
<ChatAttachmentDescription>123 MB</ChatAttachmentDescription>
</ChatAttachment>
</ChatBubble>
<ChatMessageMeta aria-label="said by you at 11:27 AM">
<ChatMessageMetaItem>11:27 AM</ChatMessageMetaItem>
</ChatMessageMeta>
<ChatMessageMeta aria-label="(read)">
<ChatMessageMetaItem>Read</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
</ChatLog>
);
};
render(
<ComplexMessage />
)
`.trim();
export const basicChatEvent = `
const BasicChatEvent = () => {
return (
<ChatLog>
<ChatEvent>
<strong>Gibby Radki</strong> has joined the chat ・ 11:56 AM
</ChatEvent>
</ChatLog>
);
};
render(
<BasicChatEvent />
)
`.trim();
export const basicChatBookend = `
const ChatStartedBookend = () => {
return (
<ChatLog>
<ChatBookend>
<ChatBookendItem>Today</ChatBookendItem>
<ChatBookendItem>
<strong>Chat Started</strong> ・ 3:34pm
</ChatBookendItem>
</ChatBookend>
</ChatLog>
);
};
render(
<ChatStartedBookend />
)
`.trim();
export const kitchenSink = `
const SampleChat = () => {
return (
<Box maxHeight='size40'>
<ChatLog>
<ChatBookend>
<ChatBookendItem>Yesterday</ChatBookendItem>
<ChatBookendItem>
<strong>Chat Started</strong>・3:34 PM
</ChatBookendItem>
</ChatBookend>
<ChatEvent>
<strong>Gibby Radki</strong> has joined the chat・3:34 PM
</ChatEvent>
<ChatMessage variant='inbound'>
<ChatBubble>
Hello, what can I help you with?
</ChatBubble>
<ChatMessageMeta aria-label="said by Gibby Radki at 3:35 PM">
<ChatMessageMetaItem>
<Avatar name="Gibby Radki" size="sizeIcon20" />
Gibby Radki ・ 3:35 PM
</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
<ChatMessage variant='outbound'>
<ChatBubble>
Hi! What is your return policy?
</ChatBubble>
<ChatMessageMeta aria-label="said by you at 3:35 PM">
<ChatMessageMetaItem>3:35 PM</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
<ChatMessage variant='inbound'>
<ChatBubble>
You have 30 days to send your items back. Here is the full policy if you would like to read more.
</ChatBubble>
<ChatBubble>
<ChatAttachment attachmentIcon={<DownloadIcon color="colorTextIcon" decorative />}>
<ChatAttachmentLink href="#">RETURN_POLICY.pdf</ChatAttachmentLink>
<ChatAttachmentDescription>17 MB</ChatAttachmentDescription>
</ChatAttachment>
</ChatBubble>
<ChatMessageMeta aria-label="said by Gibby Radki at 3:37 PM">
<ChatMessageMetaItem>
<Avatar name="Gibby Radki" size="sizeIcon20" />
Gibby Radki ・ 3:37 PM
</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
<ChatMessage variant='outbound'>
<ChatBubble>
Thank you
</ChatBubble>
<ChatMessageMeta aria-label="said by you at 3:40 PM">
<ChatMessageMetaItem>3:40 PM</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
<ChatBookend>
<ChatBookendItem>Today</ChatBookendItem>
</ChatBookend>
<ChatMessage variant='outbound'>
<ChatBubble>
I have shipped the item back, how long will it take to get the refund?
</ChatBubble>
<ChatMessageMeta aria-label="said by you at 11:27 AM">
<ChatMessageMetaItem>11:27 AM</ChatMessageMetaItem>
</ChatMessageMeta>
<ChatMessageMeta aria-label="(read)">
<ChatMessageMetaItem>Read</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
<ChatMessage variant='inbound'>
<ChatBubble>
You should recieve the refund within 10 days.
</ChatBubble>
<ChatMessageMeta aria-label="said by Gibby Radki at 11:29 AM">
<ChatMessageMetaItem>
<Avatar name="Gibby Radki" size="sizeIcon20" />
Gibby Radki ・ 11:29 AM
</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
<ChatMessage variant='inbound'>
<ChatBubble>
Do you need help with anything else?
</ChatBubble>
<ChatMessageMeta aria-label="said by Gibby Radki at 11:36 AM">
<ChatMessageMetaItem>
<Avatar name="Gibby Radki" size="sizeIcon20" />
Gibby Radki ・ 11:36 AM
</ChatMessageMetaItem>
</ChatMessageMeta>
</ChatMessage>
<ChatBookend>
<ChatBookendItem>
<strong>Chat Ended</strong>・11:45 AM
</ChatBookendItem>
</ChatBookend>
</ChatLog>
</Box>
);
};
render(
<SampleChat />
)
`.trim();