mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
CodingContractPopup now correctly displays innerHTML, desc should be changed to return jsx though.
This commit is contained in:
@@ -107,10 +107,10 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
|||||||
{
|
{
|
||||||
desc: (n: number): string => {
|
desc: (n: number): string => {
|
||||||
return ["It is possible write four as a sum in exactly four different ways:\n\n",
|
return ["It is possible write four as a sum in exactly four different ways:\n\n",
|
||||||
" 3 + 1\n",
|
" 3 + 1\n",
|
||||||
" 2 + 2\n",
|
" 2 + 2\n",
|
||||||
" 2 + 1 + 1\n",
|
" 2 + 1 + 1\n",
|
||||||
" 1 + 1 + 1 + 1\n\n",
|
" 1 + 1 + 1 + 1\n\n",
|
||||||
`How many different ways can the number ${n} be written as a sum of at least`,
|
`How many different ways can the number ${n} be written as a sum of at least`,
|
||||||
"two positive integers?"].join(" ");
|
"two positive integers?"].join(" ");
|
||||||
},
|
},
|
||||||
@@ -142,17 +142,17 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
|||||||
}
|
}
|
||||||
d += ["\nHere is an example of what spiral order should be:",
|
d += ["\nHere is an example of what spiral order should be:",
|
||||||
"\nExample:",
|
"\nExample:",
|
||||||
" [\n",
|
" [\n",
|
||||||
" [1, 2, 3],\n",
|
" [1, 2, 3],\n",
|
||||||
" [4, 5, 6],\n",
|
" [4, 5, 6],\n",
|
||||||
" [7, 8, 9]\n",
|
" [7, 8, 9]\n",
|
||||||
" ] should result in [1, 2, 3, 6, 9, 8 ,7, 4, 5]\n\n",
|
" ] should result in [1, 2, 3, 6, 9, 8 ,7, 4, 5]\n\n",
|
||||||
"Note that the matrix will not always be square:\n",
|
"Note that the matrix will not always be square:\n",
|
||||||
" [\n",
|
" [\n",
|
||||||
" [1, 2, 3, 4]\n",
|
" [1, 2, 3, 4]\n",
|
||||||
" [5, 6, 7, 8]\n",
|
" [5, 6, 7, 8]\n",
|
||||||
" [9, 10, 11, 12]\n",
|
" [9, 10, 11, 12]\n",
|
||||||
" ] should result in [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7"].join(" ");
|
" ] should result in [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7"].join(" ");
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export class CodingContractPopup extends React.Component<IProps, IState>{
|
|||||||
const contractType: CodingContractType = CodingContractTypes[this.props.c.type];
|
const contractType: CodingContractType = CodingContractTypes[this.props.c.type];
|
||||||
let description = [];
|
let description = [];
|
||||||
for (const [i, value] of contractType.desc(this.props.c.data).split('\n').entries())
|
for (const [i, value] of contractType.desc(this.props.c.data).split('\n').entries())
|
||||||
description.push(<span key={i}>{value}<br/></span>);
|
description.push(<span key={i} dangerouslySetInnerHTML={{__html: value+'<br />'}}></span>);
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<CopyableText value={this.props.c.type} tag={ClickableTag.Tag_h1} />
|
<CopyableText value={this.props.c.type} tag={ClickableTag.Tag_h1} />
|
||||||
|
|||||||
Reference in New Issue
Block a user