@@ -3,6 +3,7 @@ import { TerminalWindow } from '../components/TerminalWindow'
33import { formatTORUS } from "../utils/utils.ts" ;
44import { ASCIILogo } from "../components/ASCIILogo.tsx" ;
55import { DetailLabel , DetailRow , DetailValue } from "./AccountDetails.tsx" ;
6+ import { Helmet } from 'react-helmet-async' ;
67
78const GET_NETWORK_INFO = gql `
89 query {
@@ -22,43 +23,61 @@ const GET_NETWORK_INFO = gql`
2223export const Home = ( ) => {
2324 const { loading, error, data } = useQuery ( GET_NETWORK_INFO )
2425
26+ const title = 'TorEx - Torus Blockchain Explorer' ;
27+ const description = data
28+ ? `Explore the Torus blockchain - Current block height: ${ data . _metadata . lastProcessedHeight } , Circulating supply: ${ formatTORUS ( data . chainInfo . value ) } TORUS`
29+ : 'Explore the Torus blockchain - View blocks, transactions, accounts, and network statistics' ;
30+
2531 return (
26- < TerminalWindow title = "Network Overview" >
27- { loading && < div > Loading...</ div > }
28- { error && < div > Error: { error . message } </ div > }
29- { data && (
32+ < >
33+ < Helmet >
34+ < title > { title } </ title >
35+ < meta name = "description" content = { description } />
36+ < meta property = "og:title" content = { title } />
37+ < meta property = "og:description" content = { description } />
38+ < meta property = "og:type" content = "website" />
39+ < meta property = "og:url" content = { window . location . href } />
40+ < meta name = "twitter:card" content = "summary" />
41+ < meta name = "twitter:title" content = { title } />
42+ < meta name = "twitter:description" content = { description } />
43+ </ Helmet >
44+ < TerminalWindow title = "Network Overview" >
45+ { loading && < div > Loading...</ div > }
46+ { error && < div > Error: { error . message } </ div > }
47+ { data && (
3048 < div className = "flex flex-col h-full" >
31- < div className = { 'p-2' } >
32- < DetailRow >
33- < DetailLabel > Chain:</ DetailLabel >
34- < DetailValue > { data . _metadata . chain } </ DetailValue >
35- </ DetailRow >
36- < DetailRow >
37- < DetailLabel > Spec:</ DetailLabel >
38- < DetailValue > { data . _metadata . specName } </ DetailValue >
39- </ DetailRow >
40- < DetailRow >
41- < DetailLabel > Last Processed Block:</ DetailLabel >
42- < DetailValue > { data . _metadata . lastProcessedHeight } </ DetailValue >
43- </ DetailRow >
44- < DetailRow >
45- < DetailLabel > Last Timestamp:</ DetailLabel >
46- < DetailValue > { new Date ( parseInt ( data . _metadata . lastProcessedTimestamp ) ) . toLocaleString ( ) } </ DetailValue >
47- </ DetailRow >
48- < DetailRow >
49- < DetailLabel > Target Height:</ DetailLabel >
50- < DetailValue > { data . _metadata . targetHeight } </ DetailValue >
51- </ DetailRow >
52- < DetailRow >
53- < DetailLabel > Circulating supply:</ DetailLabel >
54- < DetailValue > { formatTORUS ( data . chainInfo . value ) } ♓︎TORUS</ DetailValue >
55- </ DetailRow >
56- </ div >
57- < div className = "flex-grow flex items-center justify-center" >
58- < ASCIILogo />
59- </ div >
49+ < div className = { 'p-2' } >
50+ < DetailRow >
51+ < DetailLabel > Chain:</ DetailLabel >
52+ < DetailValue > { data . _metadata . chain } </ DetailValue >
53+ </ DetailRow >
54+ < DetailRow >
55+ < DetailLabel > Spec:</ DetailLabel >
56+ < DetailValue > { data . _metadata . specName } </ DetailValue >
57+ </ DetailRow >
58+ < DetailRow >
59+ < DetailLabel > Last Processed Block:</ DetailLabel >
60+ < DetailValue > { data . _metadata . lastProcessedHeight } </ DetailValue >
61+ </ DetailRow >
62+ < DetailRow >
63+ < DetailLabel > Last Timestamp:</ DetailLabel >
64+ < DetailValue > { new Date ( parseInt ( data . _metadata . lastProcessedTimestamp ) ) . toLocaleString ( ) } </ DetailValue >
65+ </ DetailRow >
66+ < DetailRow >
67+ < DetailLabel > Target Height:</ DetailLabel >
68+ < DetailValue > { data . _metadata . targetHeight } </ DetailValue >
69+ </ DetailRow >
70+ < DetailRow >
71+ < DetailLabel > Circulating supply:</ DetailLabel >
72+ < DetailValue > { formatTORUS ( data . chainInfo . value ) } ♓︎TORUS</ DetailValue >
73+ </ DetailRow >
74+ </ div >
75+ < div className = "flex-grow flex items-center justify-center" >
76+ < ASCIILogo />
77+ </ div >
6078 </ div >
61- ) }
62- </ TerminalWindow >
63- )
79+ ) }
80+ </ TerminalWindow >
81+ </ >
82+ )
6483}
0 commit comments