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:
+43
@@ -0,0 +1,43 @@
|
||||
import React from "react";
|
||||
|
||||
import { Constants } from "@dndbeyond/character-rules-engine/es";
|
||||
|
||||
import { VehicleDisplayTypeComponentLookup } from "../../../utils/Component";
|
||||
import VehicleBlockShellCapInfernal from "../VehicleBlockShellCapInfernal";
|
||||
import VehicleBlockShellCapShip from "../VehicleBlockShellCapShip";
|
||||
|
||||
interface Props {
|
||||
displayType: Constants.VehicleConfigurationDisplayTypeEnum;
|
||||
invertY: boolean;
|
||||
invertX: boolean;
|
||||
}
|
||||
export default class VehicleBlockShellCap extends React.PureComponent<Props> {
|
||||
static defaultProps = {
|
||||
invertX: false,
|
||||
invertY: false,
|
||||
};
|
||||
|
||||
render() {
|
||||
const { displayType, ...restProps } = this.props;
|
||||
|
||||
let lookup: VehicleDisplayTypeComponentLookup = {
|
||||
[Constants.VehicleConfigurationDisplayTypeEnum.SHIP]:
|
||||
VehicleBlockShellCapShip,
|
||||
[Constants.VehicleConfigurationDisplayTypeEnum.INFERNAL_WAR_MACHINE]:
|
||||
VehicleBlockShellCapInfernal,
|
||||
[Constants.VehicleConfigurationDisplayTypeEnum.SPELLJAMMER]:
|
||||
VehicleBlockShellCapShip,
|
||||
};
|
||||
|
||||
//sets Ship style as default
|
||||
let CapComponent: React.ComponentType<any> = VehicleBlockShellCapShip;
|
||||
|
||||
if (lookup.hasOwnProperty(displayType)) {
|
||||
CapComponent = lookup[displayType];
|
||||
}
|
||||
|
||||
return (
|
||||
<CapComponent className="ct-vehicle-block__shell-cap" {...restProps} />
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import VehicleBlockShellCap from "./VehicleBlockShellCap";
|
||||
|
||||
export default VehicleBlockShellCap;
|
||||
export { VehicleBlockShellCap };
|
||||
Reference in New Issue
Block a user