mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 09:43:54 +01:00
Fix lit files, reallow html alerts
This commit is contained in:
parent
88e2cdf09c
commit
dc59a10e19
@ -1,3 +1,4 @@
|
||||
import React from "react";
|
||||
import { Literatures } from "./Literatures";
|
||||
import { dialogBoxCreate } from "../ui/React/DialogBox";
|
||||
|
||||
@ -7,5 +8,5 @@ export function showLiterature(fn: string): void {
|
||||
return;
|
||||
}
|
||||
const txt = `<i>${litObj.title}</i><br><br>${litObj.txt}`;
|
||||
dialogBoxCreate(txt);
|
||||
dialogBoxCreate(txt, true);
|
||||
}
|
@ -1778,7 +1778,7 @@ const base: InternalAPI<NS> = {
|
||||
(ctx: NetscriptContext) =>
|
||||
(_message: unknown): void => {
|
||||
const message = helpers.string(ctx, "message", _message);
|
||||
dialogBoxCreate(message);
|
||||
dialogBoxCreate(message, true);
|
||||
},
|
||||
toast:
|
||||
(ctx: NetscriptContext) =>
|
||||
|
@ -3,6 +3,14 @@ import { AlertEvents } from "./AlertManager";
|
||||
import React from "react";
|
||||
import { Typography } from "@mui/material";
|
||||
|
||||
export function dialogBoxCreate(txt: string | JSX.Element): void {
|
||||
AlertEvents.emit(typeof txt === "string" ? <Typography component="span">{txt}</Typography> : txt);
|
||||
export function dialogBoxCreate(txt: string | JSX.Element, html = false): void {
|
||||
AlertEvents.emit(
|
||||
typeof txt !== "string" ? (
|
||||
txt
|
||||
) : html ? (
|
||||
<div dangerouslySetInnerHTML={{ __html: txt }}></div>
|
||||
) : (
|
||||
<Typography component="span">{txt}</Typography>
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user