mirror of
https://github.com/XFox111/my-website.git
synced 2026-04-22 07:28:01 +03:00
chore(ui): pre-wrap for alert message
This commit is contained in:
@@ -21,4 +21,9 @@
|
|||||||
{
|
{
|
||||||
@include body1Stronger;
|
@include body1Stronger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.message
|
||||||
|
{
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,15 +26,15 @@ const AlertMessage: React.FC = async () =>
|
|||||||
if (!response.ok || !alertText)
|
if (!response.ok || !alertText)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
const title: string = alertText.split("\n", 1)[0];
|
const title: string = alertText.split("\n", 1)[0].trim();
|
||||||
const message: string = alertText.substring(title.length);
|
const message: string = alertText.substring(title.length + 1).trim();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div role="alert" className={ cls.alertBox } aria-label={ alertText }>
|
<div role="alert" className={ cls.alertBox } aria-label={ alertText }>
|
||||||
<ChatWarningRegular className={ cls.icon } />
|
<ChatWarningRegular className={ cls.icon } />
|
||||||
<div>
|
<div>
|
||||||
<p className={ cls.title }>{ title }</p>
|
<p className={ cls.title }>{ title }</p>
|
||||||
<p dangerouslySetInnerHTML={ { __html: message } } />
|
<p className={ cls.message } dangerouslySetInnerHTML={ { __html: message } } />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user