-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nav): move navigation to own component
Signed-off-by: Kai Henseler <[email protected]>
- Loading branch information
Showing
2 changed files
with
110 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<template> | ||
<div class="settings-navigation"> | ||
<ul class="app-navigation-entry"> | ||
<NcAppNavigationItem | ||
id="backButton" | ||
:name="t('simplesettings', 'Back to Files')" | ||
href="/"> | ||
<IconChevronLeft slot="icon" :size="24" /> | ||
</NcAppNavigationItem> | ||
<NcAppNavigationItem | ||
:name="t('simplesettings', 'Account Settings')" | ||
@click="scrollToElement('account')"> | ||
<IconAccount slot="icon" :size="20" /> | ||
</NcAppNavigationItem> | ||
<NcAppNavigationItem | ||
:name="t('simplesettings', 'Security & Privacy')" | ||
@click="scrollToElement('security')"> | ||
<IconLock slot="icon" :size="20" /> | ||
</NcAppNavigationItem> | ||
<NcAppNavigationItem | ||
:name="t('simplesettings', 'Help & Support')" | ||
@click="scrollToElement('help')"> | ||
<IconHeadset slot="icon" :size="20" /> | ||
</NcAppNavigationItem> | ||
</ul> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { translate as t } from '@nextcloud/l10n' | ||
import { defineComponent } from 'vue' | ||
import IconAccount from 'vue-material-design-icons/Account.vue' | ||
import IconLock from 'vue-material-design-icons/Lock.vue' | ||
import IconHeadset from 'vue-material-design-icons/Headset.vue' | ||
import IconChevronLeft from 'vue-material-design-icons/ChevronLeft.vue' | ||
// @ts-expect-error: Cannot find module or its corresponding type declarations. | ||
import NcAppNavigationItem from '@nextcloud/vue/dist/Components/NcAppNavigationItem.js' | ||
export default defineComponent({ | ||
name: 'Navigation', | ||
components: { | ||
IconAccount, | ||
IconLock, | ||
IconHeadset, | ||
IconChevronLeft, | ||
NcAppNavigationItem, | ||
}, | ||
methods: { | ||
scrollToElement(ref: string) { | ||
this.$emit('scroll-to', ref) | ||
}, | ||
t, | ||
}, | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
.settings-navigation { | ||
margin-left: 14px; | ||
margin-top: 24px; | ||
ul { | ||
#backButton { | ||
/* move the back button up and to the left */ | ||
margin-top: -8px; | ||
margin-left: -14px; | ||
} | ||
} | ||
} | ||
</style> |