Skip to content

Commit 56c64b0

Browse files
Saqib AshrafSaqib Ashraf
Saqib Ashraf
authored and
Saqib Ashraf
committed
change function to inline html command
1 parent 646606c commit 56c64b0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

components/SystemAlerts/SystemAlert.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
*
2020
*/
2121

22+
import { AlertDef } from '@/components/SystemAlerts/types';
2223
import { default as theme } from '@/components/theme';
2324
import { Error as ErrorIcon, Info, Warning } from '@/components/theme/icons';
2425
import Dismiss from '@/components/theme/icons/dismiss';
2526
import { css } from '@emotion/react';
2627
import React from 'react';
27-
import { AlertDef } from '@/components/SystemAlerts/types';
2828

2929
type Props = {
3030
alert: AlertDef;
@@ -55,8 +55,6 @@ const AlertVariants = {
5555
export const SystemAlert: React.FC<Props> = ({ alert, onClose }) => {
5656
const { backgroundColor, icon, textColor, outline } = AlertVariants[alert.level];
5757

58-
const createMarkup = (msg: string) => ({ __html: msg });
59-
6058
return (
6159
<div
6260
css={css`
@@ -96,7 +94,7 @@ export const SystemAlert: React.FC<Props> = ({ alert, onClose }) => {
9694
margin-bottom: 8px;
9795
${theme.typography.regular};
9896
`}
99-
dangerouslySetInnerHTML={createMarkup(alert.message)}
97+
dangerouslySetInnerHTML={{ __html: alert.message }}
10098
/>
10199
)}
102100
</div>

0 commit comments

Comments
 (0)