Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
+56
@@ -0,0 +1,56 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { Tooltip } from "@dndbeyond/character-common-components/es";
|
||||
import {
|
||||
CharacterTheme,
|
||||
Constants,
|
||||
} from "@dndbeyond/character-rules-engine/es";
|
||||
|
||||
import {
|
||||
ModifiedProficiencyDoubleSvg,
|
||||
ProficiencyDoubleSvg,
|
||||
} from "../../../Svg";
|
||||
|
||||
interface Props {
|
||||
isModified: boolean;
|
||||
className: string;
|
||||
theme?: CharacterTheme;
|
||||
}
|
||||
|
||||
export default class TwiceProficiencyIcon extends React.PureComponent<Props> {
|
||||
static defaultProps = {
|
||||
isModified: false,
|
||||
className: "",
|
||||
};
|
||||
|
||||
render() {
|
||||
const { isModified, className, theme } = this.props;
|
||||
|
||||
let IconComponent: React.ComponentType<any> = isModified
|
||||
? ModifiedProficiencyDoubleSvg
|
||||
: ProficiencyDoubleSvg;
|
||||
|
||||
let classNames: Array<string> = ["ddbc-twice-proficiency-icon", className];
|
||||
if (isModified) {
|
||||
classNames.push("ddbc-twice-proficiency-icon--modified");
|
||||
}
|
||||
let secondaryFill;
|
||||
if (theme?.isDarkMode) {
|
||||
secondaryFill = isModified
|
||||
? Constants.CharacterColorEnum.DARKMODE_TEXT
|
||||
: theme?.themeColor;
|
||||
}
|
||||
|
||||
return (
|
||||
<Tooltip title="Expertise" isDarkMode={theme?.isDarkMode}>
|
||||
<span className={classNames.join(" ")}>
|
||||
<IconComponent
|
||||
className="ddbc-twice-proficiency-icon__inner"
|
||||
fillColor={theme?.isDarkMode ? theme.themeColor : undefined}
|
||||
secondaryFillColor={secondaryFill}
|
||||
/>
|
||||
</span>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import TwiceProficiencyIcon from "./TwiceProficiencyIcon";
|
||||
|
||||
export default TwiceProficiencyIcon;
|
||||
export { TwiceProficiencyIcon };
|
||||
Reference in New Issue
Block a user