Add golden glow for new badges and badge received toast notification

New unseen badges pulse with a gold glow instead of a flat green
background. When a badge is received, a bubble notification appears
with the badge image, name, and a "Wear" button that opens inventory.
This commit is contained in:
Life
2026-04-04 13:55:29 +02:00
parent 73ee9c7603
commit 020db83870
5 changed files with 59 additions and 3 deletions
@@ -0,0 +1,38 @@
import { FC } from 'react';
import { LocalizeText, NotificationBubbleItem, OpenUrl } from '../../../../api';
import { Flex, LayoutNotificationBubbleView, LayoutNotificationBubbleViewProps, Text } from '../../../../common';
export interface NotificationBadgeReceivedBubbleViewProps extends LayoutNotificationBubbleViewProps
{
item: NotificationBubbleItem;
}
export const NotificationBadgeReceivedBubbleView: FC<NotificationBadgeReceivedBubbleViewProps> = props =>
{
const { item = null, onClose = null, ...rest } = props;
return (
<LayoutNotificationBubbleView className="flex-col" fadesOut={ false } onClose={ onClose } { ...rest }>
<Flex alignItems="center" gap={ 2 } className="mb-2">
<Flex center className="w-[50px] h-[50px] shrink-0">
{ item.iconUrl && <img alt="" className="no-select" src={ item.iconUrl } /> }
</Flex>
<Flex column gap={ 0 }>
<Text bold variant="white">{ LocalizeText('notification.badge.received') }</Text>
<Text variant="white" small>{ item.message }</Text>
</Flex>
</Flex>
<Flex alignItems="center" justifyContent="end" gap={ 2 }>
<button
className="btn btn-success w-full btn-sm"
type="button"
onClick={ () => { OpenUrl(item.linkUrl); onClose(); } }>
{ LocalizeText('inventory.badges.wearbadge') }
</button>
<span className="underline cursor-pointer text-nowrap" onClick={ onClose }>
{ LocalizeText('notifications.button.later') }
</span>
</Flex>
</LayoutNotificationBubbleView>
);
};