mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-19 13:55:19 +00:00
moveToInbox action + actions array in bulkActions component
This commit is contained in:
@@ -3,15 +3,26 @@
|
||||
<span v-if="!allAreSelected && numberSelected > 0">-</span> <!-- later on this minus sign will be in the checkbox, as it is in gmail -->
|
||||
<input type="checkbox" :checked="allAreSelected" @click="bulkSelect">
|
||||
|
||||
<button @click="emailSelection.markRead()" :disabled="Array.from(emailSelection.emails).every(e => e.read)">
|
||||
<button @click="emailSelection.markRead()"
|
||||
:disabled="Array.from(emailSelection.emails).every(e => e.read)"
|
||||
v-if="actions.includes('markRead')">
|
||||
Mark Read
|
||||
</button>
|
||||
<button @click="emailSelection.markUnread()" :disabled="Array.from(emailSelection.emails).every(e => !e.read)">
|
||||
<button @click="emailSelection.markUnread()"
|
||||
:disabled="Array.from(emailSelection.emails).every(e => !e.read)"
|
||||
v-if="actions.includes('markUnread')">
|
||||
Mark Unread
|
||||
</button>
|
||||
<button @click="emailSelection.archive()" :disabled="numberSelected == 0">
|
||||
<button @click="emailSelection.archive()"
|
||||
:disabled="numberSelected == 0"
|
||||
v-if="actions.includes('archive')">
|
||||
Archive
|
||||
</button>
|
||||
<button @click="emailSelection.moveToInbox()"
|
||||
:disabled="numberSelected == 0"
|
||||
v-if="actions.includes('moveToInbox')">
|
||||
Move to Inbox
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -42,6 +53,10 @@
|
||||
emails: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
actions: {
|
||||
type: Array,
|
||||
default: ['markRead', 'markUnread']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<h1>VMail Archives</h1>
|
||||
|
||||
<BulkActionBar :emails="archivedEmails" />
|
||||
<BulkActionBar :emails="archivedEmails" :actions="['markRead', 'markUnread', 'moveToInbox']" />
|
||||
|
||||
<MailTable :emails="archivedEmails" />
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<h1>VMail Inbox</h1>
|
||||
|
||||
<BulkActionBar :emails="inboxEmails" />
|
||||
<BulkActionBar :emails="inboxEmails" :actions="['markRead', 'markUnread', 'archive']" />
|
||||
|
||||
<MailTable :emails="inboxEmails" />
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user