mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-06-24 17:11:43 +00:00
added mark as read option to server menu
This commit is contained in:
parent
390b42066b
commit
2cff82a2b0
3 changed files with 47 additions and 3 deletions
|
|
@ -144,7 +144,7 @@ export default {
|
||||||
|
|
||||||
.tabs {
|
.tabs {
|
||||||
display: flex;
|
display: flex;
|
||||||
color: white;
|
color: rgba(255, 255, 255, 0.7);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: rgba(0, 0, 0, 0.2);
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
|
@ -165,6 +165,12 @@ export default {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
.tab:hover{
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.tab.selected {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
.tab .material-icons {
|
.tab .material-icons {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,14 @@
|
||||||
<div class="material-icons">developer_board</div>
|
<div class="material-icons">developer_board</div>
|
||||||
<div class="name">Copy ID</div>
|
<div class="name">Copy ID</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
class="item"
|
||||||
|
:class="{ disabled: !channelNotifications.length }"
|
||||||
|
@click="markAsReadButton"
|
||||||
|
>
|
||||||
|
<div class="material-icons">markunread_mailbox</div>
|
||||||
|
<div class="name">Mark As Read</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -68,6 +76,16 @@ export default {
|
||||||
copyServerID() {
|
copyServerID() {
|
||||||
this.closeMenu();
|
this.closeMenu();
|
||||||
this.$clipboard(this.contextDetails.serverID);
|
this.$clipboard(this.contextDetails.serverID);
|
||||||
|
},
|
||||||
|
markAsReadButton() {
|
||||||
|
if (!this.channelNotifications.length) return;
|
||||||
|
this.closeMenu();
|
||||||
|
for (let index = 0; index < this.channelNotifications.length; index++) {
|
||||||
|
const notification = this.channelNotifications[index];
|
||||||
|
this.$socket.client.emit("notification:dismiss", {
|
||||||
|
channelID: notification.channelID
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -123,6 +141,18 @@ export default {
|
||||||
permissions.MANAGE_ROLES.value |
|
permissions.MANAGE_ROLES.value |
|
||||||
permissions.ADMIN.value;
|
permissions.ADMIN.value;
|
||||||
return containsPerm(this.myRolePermissions, adminPermsFlags);
|
return containsPerm(this.myRolePermissions, adminPermsFlags);
|
||||||
|
},
|
||||||
|
serverChannelIds() {
|
||||||
|
const channelIds = this.$store.getters["servers/channelsIDs"][
|
||||||
|
this.contextDetails.serverID
|
||||||
|
];
|
||||||
|
return channelIds;
|
||||||
|
},
|
||||||
|
channelNotifications() {
|
||||||
|
const notifications = this.$store.getters.notifications;
|
||||||
|
return notifications.filter(n =>
|
||||||
|
this.serverChannelIds.includes(n.channelID)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -137,7 +167,7 @@ export default {
|
||||||
backdrop-filter: blur(5px);
|
backdrop-filter: blur(5px);
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
color: white;
|
color: rgba(255, 255, 255, 0.7);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
@ -155,9 +185,15 @@ export default {
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
background: rgba(255, 255, 255, 0.2);
|
background: rgba(255, 255, 255, 0.2);
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
&.warn {
|
&.warn {
|
||||||
color: rgb(255, 59, 59);
|
color: rgb(255, 59, 59);
|
||||||
}
|
}
|
||||||
|
&.disabled {
|
||||||
|
cursor: default;
|
||||||
|
background: transparent;
|
||||||
|
color: rgba(255, 255, 255, 0.4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ export default {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.friend {
|
.friend {
|
||||||
color: white;
|
color: rgba(255, 255, 255, 0.7);
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
|
|
@ -166,9 +166,11 @@ export default {
|
||||||
|
|
||||||
.friend:hover {
|
.friend:hover {
|
||||||
background-color: rgba(0, 0, 0, 0.2);
|
background-color: rgba(0, 0, 0, 0.2);
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
.friend.selected {
|
.friend.selected {
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
background-color: rgba(0, 0, 0, 0.4);
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
.profile-picture {
|
.profile-picture {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue