You've already forked AstralRinth
forked from didirus/AstralRinth
fix: notice btns not matching colour of notice + gap issue (#4823)
* feat: improve notices * fix: bottom gap for notices * fix: lint * fix: lint
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-if="filteredNotices.length > 0"
|
v-if="filteredNotices.length > 0"
|
||||||
class="experimental-styles-within relative mx-auto flex w-full min-w-0 max-w-[1280px] flex-col gap-3 px-6"
|
class="experimental-styles-within relative mx-auto mb-4 flex w-full min-w-0 max-w-[1280px] flex-col gap-3 px-6"
|
||||||
>
|
>
|
||||||
<ServerNotice
|
<ServerNotice
|
||||||
v-for="notice in filteredNotices"
|
v-for="notice in filteredNotices"
|
||||||
|
|||||||
@@ -18,12 +18,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template #actions>
|
<template #actions>
|
||||||
<ButtonStyled v-if="dismissable" circular>
|
<ButtonStyled v-if="dismissable" :color="NOTICE_TYPE_BTN[level]">
|
||||||
<button
|
<button
|
||||||
v-tooltip="formatMessage(messages.dismiss)"
|
v-tooltip="formatMessage(messages.dismiss)"
|
||||||
@click="() => (preview ? {} : emit('dismiss'))"
|
@click="() => (preview ? {} : emit('dismiss'))"
|
||||||
>
|
>
|
||||||
<XIcon />
|
<XIcon /> Dismiss
|
||||||
</button>
|
</button>
|
||||||
</ButtonStyled>
|
</ButtonStyled>
|
||||||
</template>
|
</template>
|
||||||
@@ -91,6 +91,12 @@ const NOTICE_TYPE: Record<string, 'info' | 'warning' | 'critical'> = {
|
|||||||
critical: 'critical',
|
critical: 'critical',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const NOTICE_TYPE_BTN: Record<string, 'blue' | 'orange' | 'red'> = {
|
||||||
|
info: 'blue',
|
||||||
|
warn: 'orange',
|
||||||
|
critical: 'red',
|
||||||
|
}
|
||||||
|
|
||||||
const heading = computed(() => NOTICE_HEADINGS[props.level] ?? messages.info)
|
const heading = computed(() => NOTICE_HEADINGS[props.level] ?? messages.info)
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
Reference in New Issue
Block a user