7
7
NextCirculatProgressBar ,
8
8
UniversalSearchButton ,
9
9
} from "ui" ;
10
+ import { useBlockInfo } from "./hooks/useBlockInfo" ;
10
11
import { db } from "./models/SearchModel" ;
11
12
import { DrawerWidth } from "./settings/ui" ;
12
13
@@ -16,6 +17,7 @@ export default function Layout(props: {
16
17
} ) {
17
18
const router = useRouter ( ) ;
18
19
const [ open , setOpen ] = React . useState ( false ) ;
20
+ const { blockInfoResult } = useBlockInfo ( { } ) ;
19
21
20
22
const search = useCallback ( async ( value : string ) => {
21
23
const result = await db . searchResults
@@ -34,8 +36,8 @@ export default function Layout(props: {
34
36
< Box >
35
37
< AppBar
36
38
sx = { {
37
- width : { sm : `calc(100% - ${ DrawerWidth } px )` } ,
38
- ml : { sm : `${ DrawerWidth } px` } ,
39
+ width : { md : `calc(100% - ${ DrawerWidth } px )` } ,
40
+ ml : { md : `${ DrawerWidth } px` } ,
39
41
} }
40
42
>
41
43
< Toolbar
@@ -48,21 +50,26 @@ export default function Layout(props: {
48
50
< UniversalSearchButton
49
51
drawerWidth = { DrawerWidth }
50
52
onSearch = { async ( v ) => {
51
- await router . push ( `/info /${ v } ` ) ;
53
+ await router . push ( `/tx /${ v } ` ) ;
52
54
} }
53
55
onType = { search }
54
56
/>
55
57
</ Stack >
56
58
< Stack direction = { "row" } alignItems = "center" spacing = { 2 } >
57
59
< NextCirculatProgressBar size = { 20 } />
58
- < ConnectWalletButton />
60
+ { blockInfoResult . data && (
61
+ < ConnectWalletButton
62
+ chainId = { blockInfoResult . data ! . chainId }
63
+ rpc = { blockInfoResult . data ! . rpc }
64
+ />
65
+ ) }
59
66
</ Stack >
60
67
</ Toolbar >
61
68
</ AppBar >
62
69
< Box component = { "nav" } >
63
70
< Drawer
64
71
variant = "temporary"
65
- open = { open }
72
+ open = { false }
66
73
ModalProps = { {
67
74
keepMounted : true ,
68
75
} }
@@ -79,7 +86,7 @@ export default function Layout(props: {
79
86
< Drawer
80
87
variant = "permanent"
81
88
sx = { {
82
- display : { xs : "none" , sm : "block" } ,
89
+ display : { sm : "none" , md : "block" , xs : "none " } ,
83
90
"& .MuiDrawer-paper" : {
84
91
boxSizing : "border-box" ,
85
92
width : DrawerWidth ,
@@ -94,11 +101,11 @@ export default function Layout(props: {
94
101
mt = { 5 }
95
102
component = "main"
96
103
sx = { {
97
- width : { sm : `calc(100% - ${ DrawerWidth } px )` } ,
98
- pl : { sm : `${ DrawerWidth } px` } ,
104
+ width : { md : `calc(100% - ${ DrawerWidth } px )` } ,
105
+ pl : { md : `${ DrawerWidth } px` } ,
99
106
} }
100
107
>
101
- < Box sx = { { paddingX : { md : 25 , sm : 3 , xs : 3 } } } > { props . children } </ Box >
108
+ < Box sx = { { paddingX : { lg : 25 , sm : 3 , xs : 3 } } } > { props . children } </ Box >
102
109
</ Box >
103
110
</ Box >
104
111
) ;
0 commit comments