Allow html in bubble alerts

This commit is contained in:
Bill 2022-03-16 05:22:58 -04:00
parent 6394b9d2f4
commit ef3b094a7c

View File

@ -10,6 +10,8 @@ export interface NotificationDefaultBubbleViewProps extends LayoutNotificationBu
export const NotificationDefaultBubbleView: FC<NotificationDefaultBubbleViewProps> = props =>
{
const { item = null, close = null, ...rest } = props;
const htmlText = item.message.replace(/\r\n|\r|\n/g, '<br />');
return (
<LayoutNotificationBubbleView close={ close } gap={ 2 } alignItems="center" { ...rest }>
@ -17,7 +19,7 @@ export const NotificationDefaultBubbleView: FC<NotificationDefaultBubbleViewProp
{ (item.iconUrl && item.iconUrl.length) &&
<img className="no-select" src={ item.iconUrl } alt="" /> }
</Flex>
<Text wrap variant="white">{ item.message }</Text>
<Text wrap variant="white" dangerouslySetInnerHTML={ { __html: htmlText } } />
</LayoutNotificationBubbleView>
);
}