feat: add extra prop for message center text

This commit is contained in:
kolaente 2021-12-12 20:34:26 +01:00 committed by Dominik Pschenitschni
parent a1814ea29d
commit 1fc1c20c87
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
2 changed files with 21 additions and 3 deletions

View file

@ -1,18 +1,36 @@
<template> <template>
<div class="message-wrapper"> <div class="message-wrapper">
<div class="message" :class="variant"> <div class="message" :class="[variant, textAlignClass]">
<slot/> <slot/>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
defineProps({ import {computed} from 'vue'
const props = defineProps({
variant: { variant: {
type: String, type: String,
default: 'info', default: 'info',
}, },
textAlign: {
type: String,
default: 'left',
},
}) })
const textAlignClass = computed(() => {
switch (props.textAlign) {
case 'left':
return ''
case 'right':
return 'has-text-right'
case 'center':
return 'has-text-centered'
}
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<message variant="success" class="has-text-centered mb-4" v-if="confirmedEmailSuccess"> <message variant="success" text-align="center" class="mb-4" v-if="confirmedEmailSuccess">
{{ $t('user.auth.confirmEmailSuccess') }} {{ $t('user.auth.confirmEmailSuccess') }}
</message> </message>
<message variant="danger" v-if="errorMessage" class="mb-4"> <message variant="danger" v-if="errorMessage" class="mb-4">