-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Improve displaying payloads on Block page (#983)
* feat: Add infra to support OutputPage (nova) * feat: add block page for nova * fix: Add initial Block page structure * fix: Add initial Block page structure * feat: Add View for tagged data payload and signed transaction payload * fix: add block payload section and transaction helper * feat: add block transaction metadata tab * fix: format * fix: add max burned mana * fix: improve block with transaction payload * fix: improve validation block * fix: improve candidacy announcement and block page title * fix: lint * fix: remove nested transaction from block payload section * fix: insantiate block using Plain Instance to a class in useBlock --------- Co-authored-by: Mario Sarcevic <[email protected]> Co-authored-by: Begoña Álvarez de la Cruz <[email protected]>
- Loading branch information
1 parent
3d63185
commit 0520137
Showing
5 changed files
with
219 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { | ||
BlockIssuanceCreditContextInput, | ||
CommitmentContextInput, | ||
ContextInput, | ||
ContextInputType, | ||
RewardContextInput, | ||
} from "@iota/sdk-wasm-nova/web"; | ||
import React from "react"; | ||
import TruncatedId from "../stardust/TruncatedId"; | ||
import { useNetworkInfoNova } from "~/helpers/nova/networkInfo"; | ||
|
||
interface IContextInputViewProps { | ||
readonly contextInput: ContextInput; | ||
} | ||
|
||
const ContextInputView: React.FC<IContextInputViewProps> = ({ contextInput }) => { | ||
const { name: network } = useNetworkInfoNova((s) => s.networkInfo); | ||
if (contextInput.type === ContextInputType.COMMITMENT) { | ||
const input = contextInput as CommitmentContextInput; | ||
|
||
return ( | ||
<div className="section--data"> | ||
<div className="label">Commitment id</div> | ||
<div className="value code">{input.commitmentId}</div> | ||
</div> | ||
); | ||
} else if (contextInput.type === ContextInputType.BLOCK_ISSUANCE_CREDIT) { | ||
const input = contextInput as BlockIssuanceCreditContextInput; | ||
|
||
return ( | ||
<div className="section--data"> | ||
<div className="label">Account</div> | ||
<div className="value code"> | ||
<TruncatedId id={input.accountId} link={`/${network}/account/${input.accountId}`} showCopyButton /> | ||
</div> | ||
</div> | ||
); | ||
} else if (contextInput.type === ContextInputType.REWARD) { | ||
const input = contextInput as RewardContextInput; | ||
|
||
return ( | ||
<div className="section--data"> | ||
<div className="label">Reward Input Index</div> | ||
<div className="value code">{input.index}</div> | ||
</div> | ||
); | ||
} | ||
|
||
return null; | ||
}; | ||
|
||
export default ContextInputView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 80 additions & 51 deletions
131
client/src/app/components/nova/block/section/TransactionMetadataSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.