File tree Expand file tree Collapse file tree 2 files changed +39
-6
lines changed
mithril-explorer/components Expand file tree Collapse file tree 2 files changed +39
-6
lines changed Original file line number Diff line number Diff line change 1
1
import React , { useEffect , useState } from 'react' ;
2
2
import { Card , CardGroup , ListGroup } from "react-bootstrap" ;
3
+ import { useSelector } from "react-redux" ;
3
4
import RawJsonButton from "../RawJsonButton" ;
5
+ import SignedEntityType from "../SignedEntityType" ;
4
6
import VerifiedBadge from '../VerifiedBadge' ;
5
- import { useSelector } from "react-redux" ;
6
- import ProtocolParameters from "../ProtocolParameters" ;
7
7
8
8
export default function PendingCertificate ( props ) {
9
9
const [ pendingCertificate , setPendingCertificate ] = useState ( { } ) ;
@@ -55,11 +55,9 @@ export default function PendingCertificate(props) {
55
55
< ListGroup className = "margin-bottom--md" variant = "flush" >
56
56
< ListGroup . Item > Network: { pendingCertificate . beacon . network } </ ListGroup . Item >
57
57
< ListGroup . Item > Epoch: { pendingCertificate . beacon . epoch } </ ListGroup . Item >
58
- < ListGroup . Item > Immutable File
59
- Number: { pendingCertificate . beacon . immutable_file_number } </ ListGroup . Item >
60
58
</ ListGroup >
61
- < Card . Title > Protocol Parameters </ Card . Title >
62
- < ProtocolParameters protocolParameters = { pendingCertificate . protocol } />
59
+ < Card . Title > Entity Type </ Card . Title >
60
+ < SignedEntityType signedEntityType = { pendingCertificate . entity_type } />
63
61
</ Card . Body >
64
62
</ Card >
65
63
< Card >
Original file line number Diff line number Diff line change
1
+ import React , { useEffect , useState } from 'react' ;
2
+ import { ListGroup } from "react-bootstrap" ;
3
+
4
+ export default function SignedEntityType ( { signedEntityType} ) {
5
+ const [ entityName , setEntityName ] = useState ( "" ) ;
6
+ const [ beacon , setBeacon ] = useState ( { } ) ;
7
+
8
+ useEffect ( ( ) => {
9
+ let type_name = Object . keys ( signedEntityType ) . at ( 0 ) ;
10
+ setEntityName ( type_name ) ;
11
+
12
+ if ( type_name === "MithrilStakeDistribution" || type_name === "CardanoStakeDistribution" ) {
13
+ setBeacon ( {
14
+ epoch : signedEntityType [ type_name ]
15
+ } )
16
+ } else {
17
+ setBeacon ( signedEntityType [ type_name ] ?? { } ) ;
18
+ }
19
+ } , [ signedEntityType ] ) ;
20
+
21
+ return (
22
+ < ListGroup >
23
+ < ListGroup . Item >
24
+ < h6 > { entityName } </ h6 >
25
+ </ ListGroup . Item >
26
+ < ListGroup . Item >
27
+ < ListGroup horizontal = "xxl" >
28
+ { Object . entries ( beacon ) . map ( ( [ key , value ] ) =>
29
+ < ListGroup . Item key = { key } > { key } : { value } </ ListGroup . Item >
30
+ ) }
31
+ </ ListGroup >
32
+ </ ListGroup . Item >
33
+ </ ListGroup >
34
+ ) ;
35
+ }
You can’t perform that action at this time.
0 commit comments