diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-01-30 13:33:25 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-01-30 13:33:25 +0100 |
commit | 1640996d0680250776f572da0605b312da8f12aa (patch) | |
tree | 2871ff4749e2242c351ea3f4d84c88da2150f976 /src/views/Contacts.vue | |
parent | b25ed37cae3595eb243af3bb037c5ab2ca122fb8 (diff) |
Update main components
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/views/Contacts.vue')
-rw-r--r-- | src/views/Contacts.vue | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/src/views/Contacts.vue b/src/views/Contacts.vue index 4e99bb27..887274e7 100644 --- a/src/views/Contacts.vue +++ b/src/views/Contacts.vue @@ -22,15 +22,25 @@ --> <template> - <div id="content" class="app-contacts"> + <app-content app-name="contacts"> <!-- new-contact-button + navigation + settings --> - <app-navigation :menu="menu"> + <template slot="navigation" :class="{'icon-loading': loading}"> + <!-- new-contact-button --> + <app-navigation-new v-if="!loading" button-id="new-contact-button" :text="t('contacts','New contact')" + button-class="icon-add" :disabled="!defaultAddressbook" @click="newContact" /> + + <!-- groups list --> + <ul v-if="!loading" id="groups-list"> + <app-navigation-item v-for="item in menu" :key="item.key" :item="item" /> + </ul> + <!-- settings --> - <settings-section v-if="!loading" slot="settings-content" /> - </app-navigation> + <app-navigation-settings v-if="!loading"> + <settings-section /> + </app-navigation-settings> + </template> - <!-- main content --> - <div id="app-content"> + <template slot="content"> <!-- go back to list when in details mode --> <div v-if="selectedContact && isMobile" id="app-details-toggle" class="icon-confirm" tabindex="0" @click="showList" /> @@ -46,11 +56,17 @@ <contact-details :loading="loading" :contact-key="selectedContact" /> </template> </div> - </div> - </div> + </template> + </app-content> </template> <script> +import { + AppContent, + AppNavigationItem, + AppNavigationNew, + AppNavigationSettings +} from 'nextcloud-vue' import moment from 'moment' import download from 'downloadjs' @@ -68,6 +84,10 @@ export default { name: 'Contacts', components: { + AppContent, + AppNavigationItem, + AppNavigationNew, + AppNavigationSettings, SettingsSection, ContactsList, ContactDetails, @@ -173,23 +193,7 @@ export default { // building the main menu menu() { - if (this.loading) { - return { - id: 'groups-list', - loading: true - } - } - return { - id: 'groups-list', - new: { - id: 'new-contact-button', - text: t('contacts', 'New contact'), - icon: 'icon-add', - action: this.newContact, - disabled: this.defaultAddressbook === undefined - }, - items: this.allGroup.concat(this.groupsMenu) - } + return this.allGroup.concat(this.groupsMenu) }, // default group for every contacts |