Make context menu look nicer and handle rendering using v-if #58
1 changed files with 9 additions and 3 deletions
|
@ -148,13 +148,19 @@ console.log("media links:", mediaLinks);
|
|||
// showHover.value = !showHover.value;
|
||||
//}
|
||||
|
||||
const menuItems = [
|
||||
{ name: "Reply", callback: () => { if (messageElement.value) replyToMessage(messageElement.value, props) } }
|
||||
const menuItems: ContextMenuItem[] = [
|
||||
{ name: "Reply", icon: "lucide:reply", callback: () => { if (messageElement.value) replyToMessage(messageElement.value, props) } }
|
||||
]
|
||||
|
||||
console.log("me:", props.me);
|
||||
if (props.author?.uuid == props.me.uuid) {
|
||||
menuItems.push({ name: "Edit", callback: () => { if (messageElement.value) editMessage(messageElement.value, props) } });
|
||||
// Inserts "edit" option at index 1 (below the "reply" option)
|
||||
menuItems.splice(1, 0, { name: "Edit", icon: "lucide:square-pen", callback: () => { if (messageElement.value) editMessage(messageElement.value, props) } });
|
||||
}
|
||||
|
||||
if (props.author?.uuid == props.me.uuid /* || check message delete permission*/) {
|
||||
// Inserts "edit" option at index 2 (below the "edit" option)
|
||||
menuItems.splice(2, 0, { name: "Delete", icon: "lucide:trash", callback: () => {} });
|
||||
}
|
||||
|
||||
function getDayDifference(date1: Date, date2: Date) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue