1- import { ALIAS_OUTPUT_TYPE , FOUNDRY_OUTPUT_TYPE , NFT_OUTPUT_TYPE , TREASURY_OUTPUT_TYPE , UnitsHelper , IOutputResponse } from "@iota/iota.js" ;
1+ import { BASIC_OUTPUT_TYPE , ALIAS_OUTPUT_TYPE , FOUNDRY_OUTPUT_TYPE , NFT_OUTPUT_TYPE , TREASURY_OUTPUT_TYPE , UnitsHelper , IOutputResponse } from "@iota/iota.js" ;
22import React , { Component , ReactNode } from "react" ;
33import { Link } from "react-router-dom" ;
44import { ClipboardHelper } from "../../../utils/clipboardHelper" ;
@@ -35,6 +35,7 @@ class Output extends Component<OutputProps, OutputState> {
3535 return (
3636 < div className = "output" >
3737 < h2 > { NameHelper . getOutputTypeName ( this . state . output . type ) } { this . props . index } </ h2 >
38+ { /* Diplay metadata for Output Response */ }
3839 { this . isOutputResponse ( this . props . output ) && (
3940 < React . Fragment >
4041 < div className = "card--label" >
@@ -202,57 +203,51 @@ class Output extends Component<OutputProps, OutputState> {
202203 </ div >
203204 </ React . Fragment >
204205 ) }
205- { ( this . state . output . type === ALIAS_OUTPUT_TYPE ||
206- this . state . output . type === NFT_OUTPUT_TYPE ||
207- this . state . output . type === FOUNDRY_OUTPUT_TYPE ) &&
208- this . state . output . immutableBlocks && (
209- < React . Fragment >
210- < div className = "card--label" >
211- Immutable Blocks:
212- </ div >
213- < div className = "card--value row" >
214- { this . state . output . immutableBlocks . map ( ( immutableFeatureBlock , idx ) => (
215- < FeatureBlock
216- key = { idx }
217- featureBlock = { immutableFeatureBlock }
218- />
219- ) ) }
220- </ div >
221- </ React . Fragment >
222- ) }
223206
224- { /* all output types except Treasury have commonn output conditions */ }
207+ { /* all output types except Treasury have common output conditions */ }
225208 { this . state . output . type !== TREASURY_OUTPUT_TYPE && (
226209 < React . Fragment >
227210 { this . state . output . unlockConditions . map ( ( unlockCondition , idx ) => (
228211 < UnlockCondition
229212 key = { idx }
230213 unlockCondition = { unlockCondition }
231214 />
232- ) ) }
215+ ) ) }
233216 { this . state . output . featureBlocks . map ( ( featureBlock , idx ) => (
234217 < FeatureBlock
235218 key = { idx }
236219 featureBlock = { featureBlock }
237220 />
238- ) ) }
221+ ) ) }
222+ { this . state . output . type !== BASIC_OUTPUT_TYPE && this . state . output . immutableFeatureBlocks && (
223+ < React . Fragment >
224+ { this . state . output . immutableFeatureBlocks . map ( ( immutableFeatureBlock , idx ) => (
225+ < FeatureBlock
226+ key = { idx }
227+ featureBlock = { immutableFeatureBlock }
228+ />
229+ ) ) }
230+ </ React . Fragment >
231+ ) }
239232 { this . state . output . nativeTokens . map ( ( token , idx ) => (
240233 < React . Fragment key = { idx } >
241- < h3 > Native token</ h3 >
242- < div className = "card--label" >
243- Token id:
244- </ div >
245- < div className = "card--value row" >
246- { token . id }
247- </ div >
248- < div className = "card--label" >
249- Amount:
250- </ div >
251- < div className = "card--value row" >
252- { token . amount }
234+ < div className = "native-token padding-t-s" >
235+ < h3 > Native token</ h3 >
236+ < div className = "card--label" >
237+ Token id:
238+ </ div >
239+ < div className = "card--value row" >
240+ { token . id }
241+ </ div >
242+ < div className = "card--label" >
243+ Amount:
244+ </ div >
245+ < div className = "card--value row" >
246+ { token . amount }
247+ </ div >
253248 </ div >
254249 </ React . Fragment >
255- ) ) }
250+ ) ) }
256251 </ React . Fragment >
257252 ) }
258253
@@ -267,7 +262,7 @@ class Output extends Component<OutputProps, OutputState> {
267262 * @returns True of object is IOutputResponse.
268263 */
269264 private isOutputResponse ( object : unknown ) : object is IOutputResponse {
270- return Object . prototype . hasOwnProperty . call ( object , "messageId" )
265+ return Object . prototype . hasOwnProperty . call ( object , "messageId" ) ;
271266 }
272267}
273268
0 commit comments