Reset styles for html changelogs in getUpdateText

Adds an optional sxProps to the DialogBox component.
This commit is contained in:
Martin Fournier
2022-01-25 08:16:48 -05:00
parent c4ddb5ef64
commit 8a2cad6c4a
2 changed files with 19 additions and 2 deletions
+4 -2
View File
@@ -1,11 +1,13 @@
import { AlertEvents } from "./AlertManager";
import React from "react";
import { SxProps } from "@mui/system";
import { Typography } from "@mui/material";
export function dialogBoxCreate(txt: string | JSX.Element): void {
export function dialogBoxCreate(txt: string | JSX.Element, styles?: SxProps): void {
if (typeof txt !== "string") {
AlertEvents.emit(txt);
} else {
AlertEvents.emit(<span dangerouslySetInnerHTML={{ __html: txt }} />);
AlertEvents.emit(<Typography component="span" sx={styles} dangerouslySetInnerHTML={{ __html: txt }} />);
}
}