2022-03-23 17:40:15 +00:00
|
|
|
import React, { useState } from 'react';
|
2022-03-24 14:58:24 +00:00
|
|
|
import { DATA_SOURCES } from './config';
|
2022-03-23 17:40:15 +00:00
|
|
|
import { Header } from './components/header';
|
2022-03-24 12:04:01 +00:00
|
|
|
import { StatsManager } from '@vegaprotocol/network-stats';
|
2022-03-23 17:40:15 +00:00
|
|
|
|
2022-03-24 14:58:24 +00:00
|
|
|
const envName = DATA_SOURCES.envName;
|
|
|
|
const restEndpoint = DATA_SOURCES.restEndpoint;
|
|
|
|
const statsEndpoint = `${restEndpoint}/statistics`;
|
|
|
|
const nodesEndpoint = `${restEndpoint}/nodes-data`;
|
|
|
|
|
2022-03-23 17:40:15 +00:00
|
|
|
function App() {
|
|
|
|
const [darkMode, setDarkMode] = useState<boolean>(
|
|
|
|
document.documentElement.classList.contains('dark-mode-preferred')
|
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className={`w-screen min-h-screen grid pb-24 ${
|
|
|
|
darkMode ? 'bg-black text-white-80' : 'bg-white text-black-95'
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
<div className="layout-grid w-screen justify-self-center">
|
|
|
|
<Header darkMode={darkMode} setDarkMode={setDarkMode} />
|
2022-03-24 14:58:24 +00:00
|
|
|
<StatsManager
|
|
|
|
envName={envName}
|
|
|
|
statsEndpoint={statsEndpoint}
|
|
|
|
nodesEndpoint={nodesEndpoint}
|
|
|
|
className="max-w-3xl px-24"
|
|
|
|
/>
|
2022-03-23 17:40:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|