fix: namespace new buttons on mobile

This commit is contained in:
kolaente 2021-12-29 21:27:24 +01:00 committed by Dominik Pschenitschni
parent 9d3ef30be6
commit 964fdeb2e8
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
4 changed files with 66 additions and 52 deletions

View file

@ -555,4 +555,8 @@ $vikunja-nav-selected-width: 0.4rem;
width: 32px; width: 32px;
flex-shrink: 0; flex-shrink: 0;
} }
.namespaces-list.loader-container.is-loading {
min-height: calc(100vh - #{$navbar-height + 1.5rem + 1rem + 1.5rem});
}
</style> </style>

View file

@ -3,4 +3,3 @@
@import "list"; @import "list";
@import "task"; @import "task";
@import "tasks"; @import "tasks";
@import "namespaces";

View file

@ -1,4 +0,0 @@
// FIXME: used in navigation.vue and in ListNamespaces.vue
.namespaces-list.loader-container.is-loading {
min-height: calc(100vh - #{$navbar-height + 1.5rem + 1rem + 1.5rem});
}

View file

@ -1,15 +1,19 @@
<template> <template>
<div class="content namespaces-list loader-container" :class="{'is-loading': loading}"> <div class="content loader-container" :class="{'is-loading': loading}">
<x-button :to="{name: 'namespace.create'}" class="new-namespace" icon="plus"> <div class="create-buttons">
{{ $t('namespace.create.title') }} <fancycheckbox v-model="showArchived" @change="saveShowArchivedState">
</x-button> {{ $t('namespace.showArchived') }}
</fancycheckbox>
<div>
<x-button :to="{name: 'filters.create'}" class="new-namespace" icon="filter"> <x-button :to="{name: 'filters.create'}" class="new-namespace" icon="filter">
{{ $t('filters.create.title') }} {{ $t('filters.create.title') }}
</x-button> </x-button>
<x-button :to="{name: 'namespace.create'}" class="new-namespace" icon="plus">
<fancycheckbox class="show-archived-check" v-model="showArchived" @change="saveShowArchivedState"> {{ $t('namespace.create.title') }}
{{ $t('namespace.showArchived') }} </x-button>
</fancycheckbox> </div>
</div>
<p class="has-text-centered has-text-grey mt-4 is-italic" v-if="namespaces.length === 0"> <p class="has-text-centered has-text-grey mt-4 is-italic" v-if="namespaces.length === 0">
{{ $t('namespace.noneAvailable') }} {{ $t('namespace.noneAvailable') }}
@ -103,23 +107,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.namespaces-list { .namespace {
.button.new-namespace {
float: right;
margin-left: 1rem;
@media screen and (max-width: $mobile) {
float: none;
width: 100%;
margin-bottom: 1rem;
}
}
.show-archived-check {
margin-bottom: 1rem;
}
.namespace {
&:not(:last-child) { &:not(:last-child) {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
@ -144,6 +132,33 @@ export default {
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
} }
}
.create-buttons {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: .5rem;
@media screen and (max-width: $tablet) {
width: 100%;
flex-direction: column;
}
> * {
@media screen and (max-width: $tablet) {
margin-bottom: .5rem;
}
}
.new-namespace {
margin-left: 1rem;
@media screen and (max-width: $tablet) {
width: 100%;
margin-left: 0;
margin-bottom: .5rem;
}
} }
} }
</style> </style>