Skip to content

Commit

Permalink
fix(Albums): Consistent (aria-)label and make icon only on small devices
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

[skip ci]
  • Loading branch information
susnux authored and backportbot[bot] committed Feb 2, 2024
1 parent 5f22b8b commit 79f2d85
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/views/Albums.vue
Expand Up @@ -31,12 +31,14 @@
:title="t('photos', 'Albums')"
:root-title="t('photos', 'Albums')"
@refresh="fetchAlbums">
<NcButton :aria-label="t('photos', 'Create a new album.')"
<NcButton :aria-label="isMobile ? t('photos', 'New album') : undefined"
@click="showAlbumCreationForm = true">
<template #icon>
<Plus />
<Plus :size="20" />
</template>
<template v-if="!isMobile" #default>
{{ t('photos', 'New album') }}
</template>
{{ t('photos', 'New album') }}
</NcButton>
</HeaderNavigation>

Expand All @@ -61,7 +63,9 @@

<NcModal v-if="showAlbumCreationForm"
@close="showAlbumCreationForm = false">
<h2 class="album-creation__heading">{{ t('photos', 'New album') }}</h2>
<h2 class="album-creation__heading">
{{ t('photos', 'New album') }}
</h2>
<AlbumForm @done="handleAlbumCreated" />
</NcModal>
</div>
Expand All @@ -72,7 +76,7 @@ import Plus from 'vue-material-design-icons/Plus.vue'
import FolderMultipleImage from 'vue-material-design-icons/FolderMultipleImage.vue'
import { generateUrl } from '@nextcloud/router'
import { NcModal, NcButton, NcEmptyContent } from '@nextcloud/vue'
import { NcModal, NcButton, NcEmptyContent, useIsSmallMobile } from '@nextcloud/vue'
import { translate, translatePlural } from '@nextcloud/l10n'
import { getCurrentUser } from '@nextcloud/auth'
Expand Down Expand Up @@ -113,6 +117,13 @@ export default {
FetchCollectionsMixin,
],
setup() {
const isMobile = useIsSmallMobile()
return {
isMobile,
}
},
data() {
return {
showAlbumCreationForm: false,
Expand Down

0 comments on commit 79f2d85

Please sign in to comment.