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;
flex-shrink: 0;
}
.namespaces-list.loader-container.is-loading {
min-height: calc(100vh - #{$navbar-height + 1.5rem + 1rem + 1.5rem});
}
</style>

View file

@ -3,4 +3,3 @@
@import "list";
@import "task";
@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>
<div class="content namespaces-list loader-container" :class="{'is-loading': loading}">
<x-button :to="{name: 'namespace.create'}" class="new-namespace" icon="plus">
{{ $t('namespace.create.title') }}
</x-button>
<div class="content loader-container" :class="{'is-loading': loading}">
<div class="create-buttons">
<fancycheckbox v-model="showArchived" @change="saveShowArchivedState">
{{ $t('namespace.showArchived') }}
</fancycheckbox>
<div>
<x-button :to="{name: 'filters.create'}" class="new-namespace" icon="filter">
{{ $t('filters.create.title') }}
</x-button>
<fancycheckbox class="show-archived-check" v-model="showArchived" @change="saveShowArchivedState">
{{ $t('namespace.showArchived') }}
</fancycheckbox>
<x-button :to="{name: 'namespace.create'}" class="new-namespace" icon="plus">
{{ $t('namespace.create.title') }}
</x-button>
</div>
</div>
<p class="has-text-centered has-text-grey mt-4 is-italic" v-if="namespaces.length === 0">
{{ $t('namespace.noneAvailable') }}
@ -103,23 +107,7 @@ export default {
</script>
<style lang="scss" scoped>
.namespaces-list {
.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 {
.namespace {
&:not(:last-child) {
margin-bottom: 1rem;
}
@ -144,6 +132,33 @@ export default {
display: flex;
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>