Skip to content

Commit 752bfdb

Browse files
committed
(props) add responsiveBreakpoint
1 parent 27da115 commit 752bfdb

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,24 @@ You can import it as a custom component:
8080

8181
## Props API
8282

83-
| Prop | Type | Required | Default |
84-
| ------------------ | ---------------- | -------- | ------- |
85-
| height | String | - | 600px |
86-
| currentUserId (1) | [String, Number] | true | - |
87-
| rooms | Array | - | [ ] |
88-
| loadingRooms (2) | Boolean | - | false |
89-
| messages | Array | - | [ ] |
90-
| messagesLoaded (3) | Boolean | - | false |
91-
| menuActions (4) | Array | - | [ ] |
92-
| messageActions (5) | Array | - | (4) |
93-
| showAddRoom | Boolean | - | true |
94-
| showFiles | Boolean | - | true |
95-
| showEmojis | Boolean | - | true |
96-
| showReactionEmojis | Boolean | - | true |
97-
| textMessages (6) | Object | - | null |
98-
| theme (7) | Sring | - | light |
99-
| styles (8) | Object | - | (8) |
83+
| Prop | Type | Required | Default |
84+
| ------------------------ | ---------------- | -------- | ------- |
85+
| height | String | - | 600px |
86+
| currentUserId (1) | [String, Number] | true | - |
87+
| rooms | Array | - | [ ] |
88+
| loadingRooms (2) | Boolean | - | false |
89+
| messages | Array | - | [ ] |
90+
| messagesLoaded (3) | Boolean | - | false |
91+
| menuActions (4) | Array | - | [ ] |
92+
| messageActions (5) | Array | - | (4) |
93+
| showAddRoom | Boolean | - | true |
94+
| showFiles | Boolean | - | true |
95+
| showEmojis | Boolean | - | true |
96+
| showReactionEmojis | Boolean | - | true |
97+
| textMessages (6) | Object | - | null |
98+
| responsiveBreakpoint (7) | Number | - | 900 |
99+
| theme (8) | Sring | - | light |
100+
| styles (9) | Object | - | (9) |
100101

101102
(1) `currentUserId` is required to display UI and trigger actions according to the user using the chat (ex: messages position on the right, etc.)
102103

@@ -177,9 +178,11 @@ textMessages="{
177178
}"
178179
```
179180

180-
(7) `theme` can be used to change the chat theme. Currently, only `light` and `dark` are available.
181+
(7) `responsiveBreakpoint` can be used to collapse the rooms list on the left when then viewport size goes below the specified width
181182

182-
(8) `styles` can be used to customize your own theme. Ex:
183+
(8) `theme` can be used to change the chat theme. Currently, only `light` and `dark` are available.
184+
185+
(9) `styles` can be used to customize your own theme. Ex:
183186

184187
```javascript
185188
styles="{

src/ChatWindow/ChatWindow.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default {
6363
height: { type: String, default: '600px' },
6464
theme: { type: String, default: 'light' },
6565
styles: { type: Object, default: () => ({}) },
66+
responsiveBreakpoint: { type: Number, default: 900 },
6667
textMessages: { type: Object, default: null },
6768
currentUserId: { type: [String, Number], default: '' },
6869
rooms: { type: Array, default: () => [] },
@@ -89,7 +90,6 @@ export default {
8990
return {
9091
room: {},
9192
showRoomsList: true,
92-
mobileBreakpoint: 700,
9393
isMobile: false
9494
}
9595
},
@@ -151,7 +151,7 @@ export default {
151151
152152
methods: {
153153
updateResponsive() {
154-
this.isMobile = window.innerWidth < this.mobileBreakpoint
154+
this.isMobile = window.innerWidth < this.responsiveBreakpoint
155155
this.showRoomsList = !this.isMobile
156156
},
157157
toggleRoomsList() {

0 commit comments

Comments
 (0)