Update badge titles, and status

This commit is contained in:
2022-12-29 23:55:11 +01:00
parent d86732c9b3
commit 6de05e91aa

View File

@@ -5,6 +5,7 @@
[BadgeType.INFO]: '⏳', [BadgeType.INFO]: '⏳',
[BadgeType.PENDING]: '📦', [BadgeType.PENDING]: '📦',
[BadgeType.WARNING]: '⚠️', [BadgeType.WARNING]: '⚠️',
[BadgeType.REFUNDED]: '🪷',
[BadgeType.SUCCESS]: '✓', [BadgeType.SUCCESS]: '✓',
[BadgeType.ERROR]: 'X' [BadgeType.ERROR]: 'X'
}; };
@@ -12,8 +13,12 @@
export let title = 'Info'; export let title = 'Info';
export let type: BadgeType = BadgeType.INFO; export let type: BadgeType = BadgeType.INFO;
if (title === 'CONFIRMED') { if (title === 'CONFIRMED' || title === 'succeeded') {
type = BadgeType.SUCCESS; type = BadgeType.SUCCESS;
} else if (title === 'CANCELLED') {
type = BadgeType.ERROR;
} else if (title === 'REFUNDED') {
type = BadgeType.REFUNDED;
} }
$: icon = badgeIcons[type]; $: icon = badgeIcons[type];
@@ -21,7 +26,7 @@
</script> </script>
<div class="{badgeClass}"> <div class="{badgeClass}">
<span>{title}</span> <span>{title?.toLowerCase()}</span>
<span class="icon">{icon}</span> <span class="icon">{icon}</span>
</div> </div>
@@ -36,27 +41,32 @@
color: rgb(84, 89, 105); color: rgb(84, 89, 105);
margin: 0.2rem; margin: 0.2rem;
> span {
text-transform: capitalize;
}
.icon { .icon {
margin-left: 0.3rem; margin-left: 0.3rem;
font-size: 0.8rem; font-size: 0.8rem;
} }
&.success { &.SUCCESS {
background-color: rgb(215, 247, 194); background-color: rgb(215, 247, 194);
color: rgb(0, 105, 8); color: rgb(0, 105, 8);
} }
&.error { &.ERROR {
background-color: rgb(255, 231, 242); background-color: rgb(255, 231, 242);
color: rgb(179, 9, 60); color: rgb(179, 9, 60);
} }
&.warning { &.WARNING,
&.REFUNDED {
background-color: rgb(252, 237, 185); background-color: rgb(252, 237, 185);
color: rgb(168, 44, 0); color: rgb(168, 44, 0);
} }
&.pending { &.PENDING {
background-color: lightblue; background-color: lightblue;
color: darkslateblue; color: darkslateblue;
} }