New source found from dndbeyond.com
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
||||
CollapsibleHeading,
|
||||
} from "@dndbeyond/character-components/es";
|
||||
import {
|
||||
CampaignUtils,
|
||||
CharacterTheme,
|
||||
Container,
|
||||
ContainerUtils,
|
||||
@@ -21,6 +20,7 @@ import {
|
||||
|
||||
import { ItemName } from "~/components/ItemName";
|
||||
import { NumberDisplay } from "~/components/NumberDisplay";
|
||||
import { ButtonWithMenu } from "~/subApps/sheet/components/Sidebar/components/ButtonWithMenu";
|
||||
|
||||
import CurrencyCollapsible from "../../../CharacterSheet/components/CurrencyCollapsible";
|
||||
import { CurrencyErrorTypeEnum } from "../../containers/panes/CurrencyPane/CurrencyPaneConstants";
|
||||
@@ -30,7 +30,6 @@ import { CustomItemCreator } from "../CustomItemCreator";
|
||||
import EquipmentShop from "../EquipmentShop";
|
||||
import ItemDetail from "../ItemDetail";
|
||||
import { ItemSlotManager } from "../ItemSlotManager";
|
||||
import { ThemeButtonWithMenu } from "../common/Button";
|
||||
|
||||
interface Props {
|
||||
currentContainer: Container;
|
||||
@@ -38,7 +37,6 @@ interface Props {
|
||||
onItemMove?: (item: Item, containerDefinitionKey: string) => void;
|
||||
onItemEquip?: (item: Item, uses: number) => void;
|
||||
ruleData: RuleData;
|
||||
proficiencyBonus: number;
|
||||
inventory: Array<Item>;
|
||||
containers: Array<Container>;
|
||||
shopOpenInitially?: boolean;
|
||||
@@ -68,7 +66,6 @@ export const ContainerActionsComponent: React.FC<Props> = ({
|
||||
ruleData,
|
||||
onItemMove,
|
||||
onItemEquip,
|
||||
proficiencyBonus,
|
||||
inventory,
|
||||
containers,
|
||||
shopOpenInitially = false,
|
||||
@@ -80,17 +77,6 @@ export const ContainerActionsComponent: React.FC<Props> = ({
|
||||
handleAmountSet,
|
||||
handleCurrencyChangeError,
|
||||
}) => {
|
||||
let showEquipmentShop = true;
|
||||
if (
|
||||
ContainerUtils.isShared(currentContainer) &&
|
||||
partyInfo &&
|
||||
CampaignUtils.isSharingStateInactive(
|
||||
CampaignUtils.getSharingState(partyInfo)
|
||||
)
|
||||
) {
|
||||
showEquipmentShop = false;
|
||||
}
|
||||
|
||||
let headerNode: React.ReactNode = (
|
||||
<CollapsibleHeaderContent
|
||||
heading={
|
||||
@@ -109,23 +95,21 @@ export const ContainerActionsComponent: React.FC<Props> = ({
|
||||
|
||||
return (
|
||||
<div className="ct-container-manager">
|
||||
{showEquipmentShop && (
|
||||
<Collapsible
|
||||
header="Add Items"
|
||||
initiallyCollapsed={!shopOpenInitially}
|
||||
overrideCollapsed={!shopOpenInitially}
|
||||
>
|
||||
<EquipmentShop
|
||||
limitAddToCurrentContainer={currentContainer}
|
||||
partyInfo={partyInfo}
|
||||
containers={containers}
|
||||
theme={theme}
|
||||
ruleData={ruleData}
|
||||
proficiencyBonus={proficiencyBonus}
|
||||
/>
|
||||
<CustomItemCreator containers={[currentContainer]} />
|
||||
</Collapsible>
|
||||
)}
|
||||
<Collapsible
|
||||
header="Add Items"
|
||||
initiallyCollapsed={!shopOpenInitially}
|
||||
overrideCollapsed={!shopOpenInitially}
|
||||
>
|
||||
<EquipmentShop
|
||||
limitAddToCurrentContainer={currentContainer}
|
||||
partyInfo={partyInfo}
|
||||
containers={containers}
|
||||
theme={theme}
|
||||
ruleData={ruleData}
|
||||
/>
|
||||
<CustomItemCreator containers={[currentContainer]} />
|
||||
</Collapsible>
|
||||
|
||||
{coinManager.canUseCointainers() && (
|
||||
<CurrencyCollapsible
|
||||
heading={`${ContainerUtils.getName(currentContainer)} Coin`}
|
||||
@@ -179,20 +163,15 @@ export const ContainerActionsComponent: React.FC<Props> = ({
|
||||
!isReadonly &&
|
||||
partyInfo &&
|
||||
inventoryManager.canMoveItem(item) ? (
|
||||
<ThemeButtonWithMenu
|
||||
<ButtonWithMenu
|
||||
variant="outline"
|
||||
placement="bottom-end"
|
||||
showSingleOption={true}
|
||||
containerEl={
|
||||
document.querySelector(
|
||||
".ct-sidebar__portal"
|
||||
) as HTMLElement
|
||||
}
|
||||
groupedOptions={ContainerUtils.getGroupedOptions(
|
||||
ItemUtils.getContainerDefinitionKey(item),
|
||||
containers,
|
||||
"Move To:",
|
||||
CampaignUtils.getSharingState(partyInfo)
|
||||
"Move To:"
|
||||
)}
|
||||
buttonStyle="outline"
|
||||
onSelect={(definitionKey) => {
|
||||
if (onItemMove) {
|
||||
onItemMove(item, definitionKey);
|
||||
@@ -200,7 +179,7 @@ export const ContainerActionsComponent: React.FC<Props> = ({
|
||||
}}
|
||||
>
|
||||
Move
|
||||
</ThemeButtonWithMenu>
|
||||
</ButtonWithMenu>
|
||||
) : null
|
||||
}
|
||||
/>
|
||||
@@ -212,7 +191,6 @@ export const ContainerActionsComponent: React.FC<Props> = ({
|
||||
ruleData={ruleData}
|
||||
showCustomize={false}
|
||||
showImage={false}
|
||||
proficiencyBonus={proficiencyBonus}
|
||||
/>
|
||||
</Collapsible>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user