feat: improve naming and styles

This commit is contained in:
Dominik Pschenitschni 2023-02-03 17:04:00 +01:00
parent 7cbf0acac5
commit eaeddda4e4
Signed by untrusted user: dpschen
GPG Key ID: B257AC0149F43A77
6 changed files with 41 additions and 48 deletions

View File

@ -1,6 +1,5 @@
<template> <template>
<ready> <ready>
<Update/>
<template v-if="authUser"> <template v-if="authUser">
<TheNavigation/> <TheNavigation/>
<content-auth/> <content-auth/>
@ -9,9 +8,13 @@
<no-auth-wrapper v-else> <no-auth-wrapper v-else>
<router-view/> <router-view/>
</no-auth-wrapper> </no-auth-wrapper>
<Notification/>
<keyboard-shortcuts v-if="keyboardShortcutsActive"/> <keyboard-shortcuts v-if="keyboardShortcutsActive"/>
<Teleport to="body">
<UpdateNotification/>
<Notification/>
</Teleport>
</ready> </ready>
</template> </template>
@ -22,13 +25,14 @@ import {useI18n} from 'vue-i18n'
import isTouchDevice from 'is-touch-device' import isTouchDevice from 'is-touch-device'
import Notification from '@/components/misc/notification.vue' import Notification from '@/components/misc/notification.vue'
import UpdateNotification from '@/components/home/UpdateNotification.vue'
import KeyboardShortcuts from '@/components/misc/keyboard-shortcuts/index.vue' import KeyboardShortcuts from '@/components/misc/keyboard-shortcuts/index.vue'
import TheNavigation from '@/components/home/TheNavigation.vue' import TheNavigation from '@/components/home/TheNavigation.vue'
import ContentAuth from '@/components/home/contentAuth.vue' import ContentAuth from '@/components/home/contentAuth.vue'
import ContentLinkShare from '@/components/home/contentLinkShare.vue' import ContentLinkShare from '@/components/home/contentLinkShare.vue'
import NoAuthWrapper from '@/components/misc/no-auth-wrapper.vue' import NoAuthWrapper from '@/components/misc/no-auth-wrapper.vue'
import Ready from '@/components/misc/ready.vue' import Ready from '@/components/misc/ready.vue'
import Update from '@/components/home/Update.vue'
import {setLanguage} from '@/i18n' import {setLanguage} from '@/i18n'
import AccountDeleteService from '@/services/accountDelete' import AccountDeleteService from '@/services/accountDelete'

View File

@ -1,7 +1,11 @@
<template> <template>
<div class="update-notification" v-if="updateAvailable"> <div class="update-notification" v-if="updateAvailable">
<p>{{ $t('update.available') }}</p> <p class="update-notification__message">{{ $t('update.available') }}</p>
<x-button @click="refreshApp()" :shadow="false" class="has-no-text-wrap"> <x-button
@click="refreshApp()"
:shadow="false"
:wrap="false"
>
{{ $t('update.do') }} {{ $t('update.do') }}
</x-button> </x-button>
</div> </div>
@ -42,40 +46,30 @@ function refreshApp() {
<style lang="scss" scoped> <style lang="scss" scoped>
.update-notification { .update-notification {
position: fixed;
// FIXME: We should prevent usage of z-index or
// at least define it centrally
// the highest z-index of a modal is .hint-modal with 4500
z-index: 5000;
bottom: 1rem;
inset-inline: 1rem;
max-width: max-content;
margin-inline: auto;
display: flex; display: flex;
align-items: center; align-items: center;
background: $warning; justify-content: space-between;
gap: 1rem;
padding: .5rem; padding: .5rem;
background: $warning;
border-radius: $radius; border-radius: $radius;
font-size: .9rem; font-size: .9rem;
color: var(--grey-900); color: var(--grey-900);
justify-content: space-between;
z-index: 10;
position: fixed;
bottom: 1rem;
width: 450px;
left: calc(50vw - 225px);
@media screen and (max-width: $tablet) {
position: fixed;
left: 1rem;
right: 1rem;
bottom: 1rem;
width: auto;
}
p {
text-align: center;
width: 100%;
}
> * + * {
margin-left: .5rem;
}
} }
:global(.dark) .update-notification { .update-notification__message {
color: var(--grey-200); width: 100%;
text-align: center;
} }
</style> </style>

View File

@ -224,9 +224,4 @@ labelStore.loadAllLabels()
position: relative; position: relative;
z-index: 1; z-index: 1;
} }
.is-touch .content-auth,
.content-auth.z-unset {
z-index: unset;
}
</style> </style>

View File

@ -8,17 +8,20 @@
'has-no-shadow': !shadow || variant === 'tertiary', 'has-no-shadow': !shadow || variant === 'tertiary',
} }
]" ]"
:style="{
'--button-white-space': wrap ? 'break-spaces' : 'nowrap',
}"
> >
<template v-if="icon"> <template v-if="icon">
<icon <icon
v-if="showIconOnly" v-if="showIconOnly"
:icon="icon" :icon="icon"
:style="{'color': iconColor !== '' ? iconColor : false}" :style="{'color': iconColor !== '' ? iconColor : undefined}"
/> />
<span class="icon is-small" v-else> <span class="icon is-small" v-else>
<icon <icon
:icon="icon" :icon="icon"
:style="{'color': iconColor !== '' ? iconColor : false}" :style="{'color': iconColor !== '' ? iconColor : undefined}"
/> />
</span> </span>
</template> </template>
@ -50,6 +53,7 @@ export interface ButtonProps extends BaseButtonProps {
iconColor?: string iconColor?: string
loading?: boolean loading?: boolean
shadow?: boolean shadow?: boolean
wrap?: boolean
} }
const { const {
@ -58,6 +62,7 @@ const {
iconColor = '', iconColor = '',
loading = false, loading = false,
shadow = true, shadow = true,
wrap = true,
} = defineProps<ButtonProps>() } = defineProps<ButtonProps>()
const variantClass = computed(() => BUTTON_TYPES_MAP[variant]) const variantClass = computed(() => BUTTON_TYPES_MAP[variant])
@ -67,7 +72,7 @@ const showIconOnly = computed(() => icon !== '' && typeof slots.default === 'und
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.button { :where(.button) {
transition: all $transition; transition: all $transition;
border: 0; border: 0;
text-transform: uppercase; text-transform: uppercase;
@ -77,7 +82,7 @@ const showIconOnly = computed(() => icon !== '' && typeof slots.default === 'und
min-height: $button-height; min-height: $button-height;
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-sm);
display: inline-flex; display: inline-flex;
white-space: break-spaces; white-space: var(--button-white-space);
&:hover { &:hover {
box-shadow: var(--shadow-md); box-shadow: var(--shadow-md);
@ -99,7 +104,6 @@ const showIconOnly = computed(() => icon !== '' && typeof slots.default === 'und
&.is-primary.is-outlined:hover { &.is-primary.is-outlined:hover {
color: var(--white); color: var(--white);
} }
} }
.is-small { .is-small {

View File

@ -915,7 +915,7 @@
} }
}, },
"update": { "update": {
"available": "There is an update for Vikunja available!", "available": "There is an update available!",
"do": "Update Now" "do": "Update Now"
}, },
"menu": { "menu": {

View File

@ -2,8 +2,4 @@
@media print { @media print {
display: none !important; display: none !important;
} }
} }
.has-no-text-wrap {
white-space: nowrap !important;
}