forked from profectus/Profectus
Add showAmount boolean to buyable displays
This commit is contained in:
parent
78ac7957dd
commit
409b3bbac4
1 changed files with 14 additions and 13 deletions
|
@ -26,6 +26,7 @@ export type BuyableDisplay =
|
||||||
title?: CoercableComponent;
|
title?: CoercableComponent;
|
||||||
description: CoercableComponent;
|
description: CoercableComponent;
|
||||||
effectDisplay?: CoercableComponent;
|
effectDisplay?: CoercableComponent;
|
||||||
|
showAmount?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface BuyableOptions {
|
export interface BuyableOptions {
|
||||||
|
@ -170,15 +171,6 @@ export function createBuyable<T extends BuyableOptions>(
|
||||||
const Title = coerceComponent(currDisplay.title || "", "h3");
|
const Title = coerceComponent(currDisplay.title || "", "h3");
|
||||||
const Description = coerceComponent(currDisplay.description);
|
const Description = coerceComponent(currDisplay.description);
|
||||||
const EffectDisplay = coerceComponent(currDisplay.effectDisplay || "");
|
const EffectDisplay = coerceComponent(currDisplay.effectDisplay || "");
|
||||||
const amountDisplay =
|
|
||||||
unref(genericBuyable.purchaseLimit) === Decimal.dInf ? (
|
|
||||||
<>Amount: {formatWhole(genericBuyable.amount.value)}</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
Amount: {formatWhole(genericBuyable.amount.value)} /{" "}
|
|
||||||
{formatWhole(unref(genericBuyable.purchaseLimit))}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
|
@ -188,10 +180,19 @@ export function createBuyable<T extends BuyableOptions>(
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
<Description />
|
<Description />
|
||||||
<div>
|
{currDisplay.showAmount === false ? null : (
|
||||||
<br />
|
<div>
|
||||||
{amountDisplay}
|
<br />
|
||||||
</div>
|
{unref(genericBuyable.purchaseLimit) === Decimal.dInf ? (
|
||||||
|
<>Amount: {formatWhole(genericBuyable.amount.value)}</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
Amount: {formatWhole(genericBuyable.amount.value)} /{" "}
|
||||||
|
{formatWhole(unref(genericBuyable.purchaseLimit))}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{currDisplay.effectDisplay ? (
|
{currDisplay.effectDisplay ? (
|
||||||
<div>
|
<div>
|
||||||
<br />
|
<br />
|
||||||
|
|
Loading…
Reference in a new issue