-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(NcAppNavigationSettingsButton): add settings button for App Navi…
…gation Signed-off-by: Grigorii K. Shartsev <[email protected]>
- Loading branch information
Showing
4 changed files
with
77 additions
and
28 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
55 changes: 55 additions & 0 deletions
55
src/components/NcAppNavigationSettingsButton/NcAppNavigationSettingsButton.vue
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,55 @@ | ||
<!-- | ||
- SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
- SPDX-License-Identifier: AGPL-3.0-or-later | ||
--> | ||
|
||
<docs> | ||
The component to be used as a settings button in the `<NcAppNavigation>` to open `<NcAppSettingsDialog>`. | ||
</docs> | ||
|
||
<template> | ||
<div class="app-navigation-settings-button"> | ||
<NcButton class="app-navigation-settings-button__button" | ||
type="tertiary" | ||
alignment="start" | ||
wide | ||
@click.stop="emit('click', $event)"> | ||
<template #icon> | ||
<IconCog :size="20" /> | ||
</template> | ||
<span class="app-navigation-settings-button__text"> | ||
{{ name }} | ||
</span> | ||
</NcButton> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { t } from '../../l10n.js' | ||
import NcButton from '../NcButton/index.js' | ||
import IconCog from 'vue-material-design-icons/Cog.vue' | ||
defineProps({ | ||
/** | ||
* The name of the settings button. For example, "Files Settings" or "Talk Settings". | ||
*/ | ||
name: { | ||
type: String, | ||
required: false, | ||
default: t('Settings'), | ||
}, | ||
}) | ||
const emit = defineEmits(['click']) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.app-navigation-settings-button { | ||
padding: var(--default-grid-baseline); | ||
&__text { | ||
// Make the settings button less presentative, like app navigation items | ||
font-weight: normal; | ||
} | ||
} | ||
</style> |
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,6 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
export { default } from './NcAppNavigationSettingsButton.vue' |
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