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:
+50
@@ -0,0 +1,50 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { Tooltip } from "@dndbeyond/character-common-components/es";
|
||||
import {
|
||||
CharacterTheme,
|
||||
Constants,
|
||||
} from "@dndbeyond/character-rules-engine/es";
|
||||
|
||||
import { ProficiencySvg, ModifiedProficiencySvg } from "../../../Svg";
|
||||
|
||||
interface Props {
|
||||
isModified: boolean;
|
||||
className: string;
|
||||
theme?: CharacterTheme;
|
||||
}
|
||||
|
||||
export default class ProficiencyIcon extends React.PureComponent<Props> {
|
||||
static defaultProps = {
|
||||
isModified: false,
|
||||
className: "",
|
||||
};
|
||||
|
||||
render() {
|
||||
const { isModified, className, theme } = this.props;
|
||||
|
||||
let IconComponent: React.ComponentType<any> = isModified
|
||||
? ModifiedProficiencySvg
|
||||
: ProficiencySvg;
|
||||
let classNames: Array<string> = ["ddbc-proficiency-icon", className];
|
||||
|
||||
if (isModified) {
|
||||
classNames.push("ddbc-proficiency-icon--modified");
|
||||
}
|
||||
|
||||
return (
|
||||
<Tooltip title="Proficiency" isDarkMode={theme?.isDarkMode}>
|
||||
<IconComponent
|
||||
className={classNames.join(" ")}
|
||||
fillColor={
|
||||
theme?.isDarkMode && !isModified
|
||||
? theme.themeColor
|
||||
: theme?.isDarkMode
|
||||
? Constants.CharacterColorEnum.DARKMODE_TEXT
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import ProficiencyIcon from "./ProficiencyIcon";
|
||||
|
||||
export default ProficiencyIcon;
|
||||
export { ProficiencyIcon };
|
||||
Reference in New Issue
Block a user