New source found from dndbeyond.com
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import * as React from "react";
|
||||
import { PureComponent, PropsWithChildren, ReactNode } from "react";
|
||||
import JsxParser from "react-jsx-parser";
|
||||
|
||||
import { Tooltip } from "@dndbeyond/character-common-components/es";
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
|
||||
import { HtmlContent } from "~/components/HtmlContent";
|
||||
|
||||
interface Props {
|
||||
interface Props extends PropsWithChildren {
|
||||
snippetData: SnippetData;
|
||||
levelScale?: LevelScaleContract | null;
|
||||
classLevel?: number | null;
|
||||
@@ -24,7 +24,7 @@ interface Props {
|
||||
theme?: CharacterTheme;
|
||||
proficiencyBonus: number;
|
||||
}
|
||||
export default class Snippet extends React.PureComponent<Props> {
|
||||
export default class Snippet extends PureComponent<Props> {
|
||||
static defaultProps = {
|
||||
className: "",
|
||||
parseSnippet: true,
|
||||
@@ -113,13 +113,13 @@ export default class Snippet extends React.PureComponent<Props> {
|
||||
classNames.push("ddbc-snippet--dark-mode");
|
||||
}
|
||||
|
||||
let contentNode: React.ReactNode;
|
||||
let contentNode: ReactNode;
|
||||
if (typeof children === "string") {
|
||||
if (parseSnippet) {
|
||||
contentNode = (
|
||||
<JsxParser
|
||||
className="ddbc-snippet__content"
|
||||
components={{ Tooltip }}
|
||||
components={{ Tooltip: Tooltip as any }}
|
||||
jsx={this.convertSnippetToHtml(children)}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user