Skip to content

Commit

Permalink
Merge pull request #2299 from nextcloud/backport/2290/stable28
Browse files Browse the repository at this point in the history
[stable28] Do not mess with `@nextcloud/vue` styles and fix navigation header a11y
  • Loading branch information
susnux authored Feb 3, 2024
2 parents 6dd8530 + 9750a3f commit 7a70eae
Show file tree
Hide file tree
Showing 26 changed files with 65 additions and 72 deletions.
4 changes: 2 additions & 2 deletions js/photos-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-main.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-public.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_views_AlbumContent_vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-src_views_AlbumContent_vue.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_views_Albums_vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-src_views_Albums_vue.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_views_Folders_vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-src_views_Folders_vue.js.map

Large diffs are not rendered by default.

44 changes: 13 additions & 31 deletions src/components/HeaderNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,45 +179,32 @@ export default {
}
</script>

<style lang="scss">
:root {
--photos-navigation-height: 64px;
// header height - button size
--photos-navigation-spacing: calc((var(--photos-navigation-height) - 44px) / 2);
}

// Properly position the navigation toggle button
button.app-navigation-toggle {
// App-navigation have a 4px margin top
top: 0 !important;
right: calc(var(--photos-navigation-height) * -1) !important;
margin: var(--photos-navigation-spacing) !important;
}

</style>

<style lang="scss" scoped>
.photos-navigation {
position: sticky;
z-index: 20;
top: 0;
display: flex;
// We need to wrap on small devices for accessibility
flex-wrap: wrap;
gap: calc(2 * var(--app-navigation-padding));
align-items: center;
justify-content: start;
width: 100%;
min-height: var(--photos-navigation-height);
padding: 15px var(--photos-navigation-height) 0 var(--photos-navigation-height);
// Ensure to not overlap with app navigation toggle
padding-inline: calc(var(--default-clickable-area) + 2 * var(--app-navigation-padding)) var(--app-navigation-padding);
// Align with app navigation toggle
padding-block: var(--app-navigation-padding);
background: var(--color-main-background);

&__back {
// Above the navigation menu
position: absolute !important;
left: 0;
margin: var(--photos-navigation-spacing) !important;
// Replaces the app navigation button
position: fixed !important;
left: var(--app-navigation-padding);
}

&__title {
max-width: 45%;
margin-right: calc(2 * var(--photos-navigation-spacing));
display: flex;
flex-direction: column;

Expand All @@ -226,7 +213,6 @@ button.app-navigation-toggle {
font-weight: 700;
font-size: 20px;
line-height: 44px;
margin: 0 0 0 calc(2 * var(--app-navigation-padding, 8px) + 44px);
}

&__main, &__sub {
Expand All @@ -236,19 +222,15 @@ button.app-navigation-toggle {
}
}

&__content {
max-width: 50%;
}

&__loader {
margin-left: 32px;
margin-inline-start: 32px;
}

&__content-right {
display: flex;
align-items: center;
justify-content: center;
margin-left: auto;
margin-inline-start: auto;
}
}

Expand Down
21 changes: 16 additions & 5 deletions src/views/Albums.vue
Original file line number Diff line number Diff line change
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 7a70eae

Please sign in to comment.