fix some bugs

This commit is contained in:
Olivier Gagnon
2021-10-03 21:33:48 -04:00
parent 1a749505e7
commit ab2ffb112f
13 changed files with 85 additions and 14 deletions
+4 -1
View File
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react";
import { EventEmitter } from "../../utils/EventEmitter";
import { Modal } from "../../ui/React/Modal";
import Typography from "@mui/material/Typography";
import Box from "@mui/material/Box";
export const AlertEvents = new EventEmitter<[string | JSX.Element]>();
@@ -41,7 +42,9 @@ export function AlertManager(): React.ReactElement {
<>
{alerts.length > 0 && (
<Modal open={true} onClose={close}>
<Typography>{alerts[0].text}</Typography>
<Box>
<Typography>{alerts[0].text}</Typography>
</Box>
</Modal>
)}
</>
+1 -1
View File
@@ -6,6 +6,6 @@ export function dialogBoxCreate(txt: string | JSX.Element): void {
if (typeof txt !== "string") {
AlertEvents.emit(txt);
} else {
AlertEvents.emit(<pre dangerouslySetInnerHTML={{ __html: txt }} />);
AlertEvents.emit(<span dangerouslySetInnerHTML={{ __html: txt }} />);
}
}
+2 -2
View File
@@ -147,10 +147,10 @@ function LogWindow(props: IProps): React.ReactElement {
</Box>
</Paper>
<Paper>
<Box maxHeight="25vh" overflow="scroll">
<Box maxHeight="25vh" overflow="scroll" sx={{ overflowWrap: "break-word" }}>
{props.script.logs.map(
(line: string, i: number): JSX.Element => (
<Typography key={i} style={{ whiteSpace: "pre-line" }}>
<Typography key={i}>
{line}
<br />
</Typography>