Skip to content

Commit 86bdbc5

Browse files
committed
(docs) update readme
1 parent bd180f0 commit 86bdbc5

File tree

2 files changed

+49
-7
lines changed

2 files changed

+49
-7
lines changed

README.md

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- Customizeable
1616
- Backend agnostic
1717
- Images, files & emojis
18+
- Dark mode
1819
- Firestore example
1920

2021
## [Demo](https://antoine92190.github.io/vue-advanced-chat)
@@ -44,7 +45,7 @@ yarn add --save vue-advanced-chat
4445

4546
You can import it as a custom component:
4647

47-
```html
48+
```javascript
4849
<template>
4950
<chat-window :rooms="rooms" :messages="messages" />
5051
</template>
@@ -81,15 +82,17 @@ You can import it as a custom component:
8182
| showFiles | Boolean | - | true |
8283
| showEmojis | Boolean | - | true |
8384
| textMessages (4) | Object | - | null |
85+
| theme (5) | Sring | - | light |
86+
| colors (6) | Object | - | (6) |
8487

85-
(1) `loadingRooms` is must be used to show/hide a spinner icon while rooms are loading
88+
(1) `loadingRooms` can be used to show/hide a spinner icon while rooms are loading
8689

8790
(2) `messagesLoaded` must be manually set to `true` when all messages of a conversation have been loaded. Meaning the user cannot scroll on top anymore
8891

8992
(3) `menuActions` can be used to display your own buttons when clicking the vertical dots icon inside a room.<br>
9093
You can then use the [menuActionHandler](#events-api) event to call your own action after clicking a button. Ex:
9194

92-
```html
95+
```javascript
9396
menuActions="[
9497
{
9598
name: 'inviteUser',
@@ -108,7 +111,7 @@ menuActions="[
108111

109112
(4) `textMessages` can be used to replace default texts. Ex:
110113

111-
```html
114+
```javascript
112115
textMessages="{
113116
MESSAGE_DELETED: 'Ce message a été supprimé',
114117
MESSAGES_EMPTY: 'Aucun message',
@@ -118,13 +121,51 @@ textMessages="{
118121
}"
119122
```
120123

124+
(5) `theme` can be used to change the chat theme. Currently, only `light` and `dark` are available.
125+
126+
(6) `colors` can be use to create your own theme. Ex:
127+
128+
```javascript
129+
colors="{
130+
headerBg: '#fff',
131+
sidemenuBg: '#fff',
132+
sidemenuBgHover: '#f6f6f6',
133+
sidemenuBgActive: '#e5effa',
134+
sidemenuColorActive: '#1976d2',
135+
menuBg: '#fff',
136+
menuBgHover: '#f6f6f6',
137+
messagesBg: '#f8f9fa',
138+
textColorDark: '#0a0a0a',
139+
textColor: '#0a0a0a',
140+
inputBg: '#fff',
141+
iconsColor: {
142+
search: '#9ca6af',
143+
add: '#1976d2',
144+
menu: '#0a0a0a',
145+
close: '#9ca6af',
146+
closeImage: '#fff',
147+
file: '#1976d2',
148+
paperclip: '#1976d2',
149+
closeOutline: '#1976d2',
150+
send: '#1976d2',
151+
sendDisabled: '#9ca6af',
152+
emoji: '#1976d2',
153+
document: '#1976d2',
154+
pencil: '#1976d2',
155+
pencilEdited: '#9e9e9e',
156+
trash: '#f44336',
157+
checkmark: '#0696c7'
158+
}
159+
}"
160+
```
161+
121162
## Props data structure
122163

123164
Your props must follow a specific structure to display rooms and messages correctly:
124165

125166
### Rooms prop
126167

127-
```html
168+
```javascript
128169
rooms="[
129170
{
130171
roomId: 1,
@@ -148,7 +189,7 @@ rooms="[
148189
Message objects are rendered differently depending on their type. Currently, only text, emoji and file types are supported.<br>
149190
Each message object has a `sender_id` field which can have the value 'me' or the id of the corresponding agent.
150191

151-
```html
192+
```javascript
152193
messages="[
153194
{
154195
content: 'message 1',
@@ -194,7 +235,7 @@ menuActionHandler({ roomId, action }) {
194235
case 'deleteRoom':
195236
// call a method to delete the room
196237
}
197-
},
238+
}
198239
```
199240

200241
(3) All file params contain: `{ blob, localURL, name, size, type }`

src/ChatWindow/RoomsList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export default {
138138
139139
input {
140140
background: var(--chat-color-input);
141+
color: var(--chat-color);
141142
border-radius: 4px;
142143
margin: 0 10px;
143144
}

0 commit comments

Comments
 (0)