You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `AttachmentPreviewList` compontent displays a preview of the attachments uploaded to a message. Users can delete attachments using the preview component, or retry upload if it failed previously.
10
+
11
+
**Example 1** - attachment previews
12
+
13
+
<imgsrc={Screenshot}width="1000" />
14
+
15
+
## Basic Usage
16
+
17
+
A typical use case for the `AttachmentPreviewList` component would be to use in your custom components that will completely override the message input component.
The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. The following actions are supported: [flag](https://getstream.io/chat/docs/javascript/moderation/?language=javascript). The following actions are accepted by the component, but not yet implemented: edit, delete or pin message and mute sender.
9
+
The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. The following actions are supported:
10
+
11
+
| Name | Description | Necessary channel capability |
Currently it is not possible to provide a custom component for message edit.
52
+
:::
53
+
54
+
:::important
55
+
The `MessageActionBox` component doesn't check if the user has the necessary capabilities to perform a given aciton, it is done by the [`MessageList`](./message-list.mdx/#enabledmessageactions) component.
The `MessageInput` component displays an input where users can type their messages and upload files, and sends the message to the active channel.
7
+
The `MessageInput` component displays an input where users can type their messages and upload files, and sends the message to the active channel. The component can be used to compose new messages or update existing ones.
8
8
9
9
## Customization
10
10
@@ -20,7 +20,31 @@ If you want to create your own message input, here is how to use it:
20
20
```
21
21
22
22
:::note
23
-
If you want to create your own message input, you can use the [`ChannelService`](../services/channel.mdx) to send messages.
23
+
If you want to create your own message input, you can use the following building blocks:
24
+
25
+
### Send and update messages
26
+
27
+
You can use [`ChannelService`](../services/channel.mdx) to send and update messages.
28
+
29
+
### File uploads
30
+
31
+
You can use the [`AttachmentService`](../services/attachment.mdx) to manage file uploads.
32
+
33
+
If more than one message input component can exist on your chat UI you should provide the `AttachmentService` on the component level:
34
+
35
+
```typescript
36
+
@Component({
37
+
selector: 'custom-message-input',
38
+
templateUrl: './message-input.component.html',
39
+
styles: [],
40
+
providers: [AttachmentService],
41
+
})
42
+
```
43
+
44
+
:::
45
+
46
+
:::important
47
+
Currently it is not possible to provide a custom component for message edit in the [`MessageActionsBox`](./message-actions.mdx) component. Please consider this limitation when creating your own custom message input.
24
48
:::
25
49
26
50
## Inputs
@@ -29,22 +53,46 @@ If you want to create your own message input, you can use the [`ChannelService`]
29
53
30
54
If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).
31
55
32
-
| Type | Default |
33
-
| ------- | ------- |
34
-
| boolean | true |
56
+
If value not provided, it is set from the [`MessageInputConfigService`](../services/message-input-config.mdx).
57
+
58
+
| Type |
59
+
| ------- |
60
+
| boolean |
35
61
36
62
### acceptedFileTypes
37
63
38
64
You can narrow the accepted file types by providing the [accepted types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept). By default every file type is accepted.
39
65
40
-
| Type | Default |
41
-
| ---------- | --------- |
42
-
|`string[]`| undefined |
66
+
If value not provided, it is set from the [`MessageInputConfigService`](../services/message-input-config.mdx).
67
+
68
+
| Type |
69
+
| ---------- |
70
+
|`string[]`|
43
71
44
72
### isMultipleFileUploadEnabled
45
73
46
74
If true, users can select multiple files to upload.
47
75
48
-
| Type | Default |
49
-
| ------- | ------- |
50
-
| boolean | true |
76
+
If value not provided, it is set from the [`MessageInputConfigService`](../services/message-input-config.mdx).
0 commit comments