1
1
import "../styles/globals.css"
2
2
import "../styles/markdown.css"
3
+ import { FrontendVersion } from "../version.js"
3
4
import Head from "next/head"
4
5
import { useState } from "react"
5
6
import { ethers } from "ethers"
6
7
import { Menu , Transition } from "@headlessui/react"
7
8
import { Fragment , useEffect } from "react"
8
9
import { ChevronDownIcon } from "@heroicons/react/solid"
9
10
import { Navigation } from "../components/Navigation" ;
11
+ import axios from "axios"
10
12
11
13
// On production, you should use something like web3Modal
12
14
// to support additional wallet providers, like WalletConnect
@@ -17,6 +19,7 @@ function Marketplace({ Component, pageProps }) {
17
19
const [ ethAccount , setethAccount ] = useState ( null )
18
20
const [ Logined , setLogined ] = useState ( false )
19
21
const [ loadingState , setLoadingState ] = useState ( "not-loaded" )
22
+ const [ BackendVersion , setBackendVersion ] = useState ( "err" )
20
23
21
24
useEffect ( ( ) => {
22
25
if ( typeof window !== "undefined" ) {
@@ -41,9 +44,22 @@ function Marketplace({ Component, pageProps }) {
41
44
} )
42
45
}
43
46
listenMMAccount ( )
47
+ getBackendVersion ( )
44
48
}
45
49
} , [ ] )
46
50
51
+ async function getBackendVersion ( ) {
52
+ try {
53
+ const dweb_search_ver_api = "https://dweb-search-api.anwen.cc/version"
54
+ const ret = await axios . get ( dweb_search_ver_api )
55
+ if ( ret . status == 200 && 'version' in ret . data ) {
56
+ setBackendVersion ( ret . data [ 'version' ] )
57
+ }
58
+ } catch ( error ) {
59
+ console . log ( error )
60
+ }
61
+ }
62
+
47
63
async function loginSig ( ) {
48
64
// change network and sig login
49
65
const sig_login = localStorage . getItem ( "sig_login" )
@@ -230,10 +246,13 @@ function Marketplace({ Component, pageProps }) {
230
246
231
247
< Component { ...pageProps } />
232
248
233
-
234
-
235
249
< footer className = "border-b p-6" >
236
- < p > Version v0.4.4 Powered by Dweb Lab</ p >
250
+ < p > Frontend Version: { FrontendVersion }
251
+ Backend Version: { BackendVersion }
252
+ & < a href = "https://mumbai.polygonscan.com/" > Polygon (MATIC) Mumbai TESTNET</ a >
253
+
254
+ | Powered by Dweb Lab.
255
+ </ p >
237
256
</ footer >
238
257
239
258
</ div >
0 commit comments