Skip to content

Commit 3b57c81

Browse files
committed
(props) add showAddRoom
1 parent 4b20fc0 commit 3b57c81

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ You can import it as a custom component:
8787
| messagesLoaded (3) | Boolean | - | false |
8888
| menuActions (4) | Array | - | [ ] |
8989
| messageActions (5) | Array | - | (4) |
90+
| showAddRoom | Boolean | - | true |
9091
| showFiles | Boolean | - | true |
9192
| showEmojis | Boolean | - | true |
9293
| showReactionEmojis | Boolean | - | true |

src/ChatWindow/ChatWindow.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:loadingRooms="loadingRooms"
77
:room="room"
88
:textMessages="t"
9+
:showAddRoom="showAddRoom"
910
:showRoomsList="showRoomsList"
1011
:isMobile="isMobile"
1112
@fetchRoom="fetchRoom"
@@ -73,6 +74,7 @@ export default {
7374
{ name: 'deleteMessage', title: 'Delete Message', onlyMe: true }
7475
]
7576
},
77+
showAddRoom: { type: Boolean, default: true },
7678
showFiles: { type: Boolean, default: true },
7779
showEmojis: { type: Boolean, default: true },
7880
showReactionEmojis: { type: Boolean, default: true },

src/ChatWindow/RoomsList.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
autocomplete="off"
1515
@input="searchRoom"
1616
/>
17-
<div class="svg-button" @click="addRoom">
17+
<div v-if="showAddRoom" class="svg-button add-icon" @click="addRoom">
1818
<svg-icon name="add" />
1919
</div>
2020
</div>
@@ -75,6 +75,7 @@ export default {
7575
props: {
7676
textMessages: { type: Object, required: true },
7777
showRoomsList: { type: Boolean, required: true },
78+
showAddRoom: { type: Boolean, required: true },
7879
isMobile: { type: Boolean, required: true },
7980
rooms: { type: Array, required: true },
8081
loadingRooms: { type: Boolean, required: true },
@@ -147,11 +148,14 @@ export default {
147148
}
148149
}
149150
151+
.add-icon {
152+
margin-left: 20px;
153+
}
154+
150155
input {
151156
background: var(--chat-bg-color-input);
152157
color: var(--chat-color);
153158
border-radius: 4px;
154-
margin-right: 20px;
155159
width: 100%;
156160
font-size: 15px;
157161
outline: 0;

0 commit comments

Comments
 (0)