Skip to content

Commit

Permalink
feat: Fix nesting for Stored mana field + Fix label of Unlock conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
msarcev committed Jan 17, 2024
1 parent 751c6ea commit c3b67fd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
14 changes: 7 additions & 7 deletions client/src/app/components/nova/OutputView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ const OutputView: React.FC<OutputViewProps> = ({ outputId, output, showCopyAmoun
)}
</React.Fragment>
)}
{output.type === OutputType.Basic ||
{(output.type === OutputType.Basic ||
output.type === OutputType.Account ||
output.type === OutputType.Anchor ||
(output.type === OutputType.Nft && (
<React.Fragment>
<div className="card--label">Stored mana:</div>
<div className="card--value row">{(output as BasicOutput).mana?.toString()}</div>
</React.Fragment>
))}
output.type === OutputType.Nft) && (
<React.Fragment>
<div className="card--label">Stored mana:</div>
<div className="card--value row">{(output as BasicOutput).mana?.toString()}</div>
</React.Fragment>
)}
{output.type === OutputType.Delegation && (
<React.Fragment>
<div className="card--label">Delegated amount:</div>
Expand Down
25 changes: 18 additions & 7 deletions client/src/app/components/nova/UnlockConditionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,33 @@ const UnlockConditionView: React.FC<UnlockConditionViewProps> = ({ unlockConditi
};

function getUnlockConditionTypeName(type: UnlockConditionType): string {
let name = null;

switch (type) {
case UnlockConditionType.Address:
return "Address";
name = "Address";
break;
case UnlockConditionType.StorageDepositReturn:
return "Storage deposit return";
name = "Storage Deposit Return";
break;
case UnlockConditionType.Timelock:
return "Timelock";
name = "Timelock";
break;
case UnlockConditionType.Expiration:
return "Expiration";
name = "Expiration";
break;
case UnlockConditionType.GovernorAddress:
return "Governor address";
name = "Governor Address";
break;
case UnlockConditionType.StateControllerAddress:
return "State controller address";
name = "State Controller Address";
break;
case UnlockConditionType.ImmutableAccountAddress:
return "Immutable account address";
name = "Immutable Account Address";
break;
}

return name !== null ? `${name} Unlock Condition` : "Unknown Unlock condition";
}

export default UnlockConditionView;

0 comments on commit c3b67fd

Please sign in to comment.