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:
+58
@@ -0,0 +1,58 @@
|
||||
import React from "react";
|
||||
|
||||
import {
|
||||
Modifier,
|
||||
RuleData,
|
||||
StartingEquipmentSlotContract,
|
||||
TypeValueLookup,
|
||||
} from "@dndbeyond/character-rules-engine/es";
|
||||
|
||||
import StartingEquipmentRuleSlots from "../StartingEquipmentRuleSlots";
|
||||
import { StartingEquipmentRuleSlotSelection } from "../typings";
|
||||
|
||||
interface Props {
|
||||
slots: Array<StartingEquipmentSlotContract>;
|
||||
onRuleSlotSelection: (
|
||||
selections: Array<StartingEquipmentRuleSlotSelection>
|
||||
) => void;
|
||||
onRuleSelection: (
|
||||
slotIdx: number,
|
||||
ruleIdx: number,
|
||||
dataId: number | null
|
||||
) => void;
|
||||
activeRuleSlots: Array<number | null>;
|
||||
globalModifiers: Array<Modifier>;
|
||||
valueLookupByType: TypeValueLookup;
|
||||
ruleData: RuleData;
|
||||
}
|
||||
export default class StartingEquipmentSlots extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const {
|
||||
slots,
|
||||
activeRuleSlots,
|
||||
globalModifiers,
|
||||
valueLookupByType,
|
||||
ruleData,
|
||||
onRuleSelection,
|
||||
onRuleSlotSelection,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<div className="starting-equipment-slots">
|
||||
{slots.map((slot, slotIdx) => (
|
||||
<div className="starting-equipment-slot" key={slotIdx}>
|
||||
<StartingEquipmentRuleSlots
|
||||
ruleSlots={slot.ruleSlots ? slot.ruleSlots : []}
|
||||
onRuleSelection={onRuleSelection.bind(this, slotIdx)}
|
||||
onRuleSlotSelection={onRuleSlotSelection.bind(this, slotIdx)}
|
||||
activeIdx={activeRuleSlots[slotIdx]}
|
||||
globalModifiers={globalModifiers}
|
||||
valueLookupByType={valueLookupByType}
|
||||
ruleData={ruleData}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import StartingEquipmentSlots from "./StartingEquipmentSlots";
|
||||
|
||||
export default StartingEquipmentSlots;
|
||||
export { StartingEquipmentSlots };
|
||||
Reference in New Issue
Block a user