File tree Expand file tree Collapse file tree 7 files changed +21
-20
lines changed
Transactions/TransactionItem Expand file tree Collapse file tree 7 files changed +21
-20
lines changed Original file line number Diff line number Diff line change 14
14
"private" : true ,
15
15
"dependencies" : {
16
16
"@reach/router" : " 1.2.1" ,
17
- "big.js" : " ^ 5.2.2" ,
17
+ "big.js" : " 5.2.2" ,
18
18
"bootstrap" : " 4.3.1" ,
19
19
"graphql" : " 14.5.8" ,
20
20
"node-sass" : " 4.12.0" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ import { blocksFromBlockConnection } from '../../../helpers/blockHelper';
11
11
// TODO: Think on some way of extract shared code between EpochBlockTable and BlockPagedTable
12
12
const EpochBlockTable = ( { epoch, relay } ) => {
13
13
const [ start , setStart ] = useState ( 1 ) ;
14
+ if ( ! epoch . blocks ) {
15
+ return null ;
16
+ }
17
+
14
18
const blocks = blocksFromBlockConnection ( epoch . blocks ) ;
15
19
const { pageInfo } = epoch . blocks ;
16
20
Original file line number Diff line number Diff line change @@ -25,17 +25,7 @@ const FullBlockInfo = ({ block }) => {
25
25
export default createFragmentContainer ( FullBlockInfo , {
26
26
block : graphql `
27
27
fragment FullBlockInfo_block on Block {
28
- id
29
- date {
30
- epoch {
31
- id
32
- }
33
- slot
34
- }
35
- chainLength
36
- previousBlock {
37
- id
38
- }
28
+ ...BlockInfo_block
39
29
transactions {
40
30
...TransactionTable_transactions
41
31
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const EpochInfo = ({ epoch }) => {
13
13
if ( ! epoch ) {
14
14
return < EmptyResult { ...{ entityName : 'Epoch' } } /> ;
15
15
}
16
- const { blocks } = epoch ;
16
+ const { blocks, firstBlock , lastBlock } = epoch ;
17
17
18
18
return (
19
19
< div className = "epochInfo" >
@@ -30,15 +30,11 @@ const EpochInfo = ({ epoch }) => {
30
30
</ tr >
31
31
< tr >
32
32
< td > First Block:</ td >
33
- < td >
34
- < BlockLink id = { epoch . firstBlock . id } />
35
- </ td >
33
+ < td > { firstBlock && < BlockLink id = { firstBlock . id } /> } </ td >
36
34
</ tr >
37
35
< tr >
38
36
< td > Last Block:</ td >
39
- < td >
40
- < BlockLink id = { epoch . lastBlock . id } />
41
- </ td >
37
+ < td > { lastBlock && < BlockLink id = { lastBlock . id } /> } </ td >
42
38
</ tr >
43
39
< tr >
44
40
< td > Blocks count:</ td >
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ const FullEpochInfo = ({ epoch }) => {
17
17
return (
18
18
< div className = "fullEpochInfo" >
19
19
< EpochInfo { ...{ epoch } } />
20
- < h3 > Blocks</ h3 >
21
20
< EpochBlockTable { ...{ epoch } } />
22
21
</ div >
23
22
) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ import Button from 'react-bootstrap/Button';
8
8
import './searchBar.scss' ;
9
9
import { isBlockNumber } from '../../../helpers/blockHelper' ;
10
10
11
+ const onEpochSearchClick = searchValue => {
12
+ const baseUrl = 'epoch' ;
13
+
14
+ navigate ( `/${ baseUrl } /${ searchValue } ` ) ;
15
+ } ;
16
+
11
17
const onBlockSearchClick = searchValue => {
12
18
let baseUrl = 'block' ;
13
19
@@ -42,6 +48,9 @@ const Search = () => {
42
48
placeholder = "Search by block hash, chain length and transaction hash..."
43
49
/>
44
50
< ButtonGroup >
51
+ < Button variant = "primary" onClick = { ( ) => onEpochSearchClick ( searchValue ) } >
52
+ Epoch
53
+ </ Button >
45
54
< Button variant = "primary" onClick = { ( ) => onBlockSearchClick ( searchValue ) } >
46
55
Block
47
56
</ Button >
Original file line number Diff line number Diff line change 7
7
flex-direction : row ;
8
8
justify-content : space-between ;
9
9
padding : 1% ;
10
+ div {
11
+ padding : 1% 0% ;
12
+ }
10
13
box-shadow : 0 0 4px 0px grey ;
11
14
}
You can’t perform that action at this time.
0 commit comments