Skip to content

Commit 9c4b269

Browse files
committed
dashboard: add FT tab
Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
1 parent 3b59063 commit 9c4b269

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Box, Divider, Typography } from '@mui/material';
2+
import { useNetworkContext } from '../contexts/NetworkContext';
3+
import { LookerDashboard } from './LookerDashboard';
4+
5+
function FTMetrics() {
6+
const { currentNetwork } = useNetworkContext();
7+
if (currentNetwork.name === 'Mainnet') {
8+
return (
9+
<>
10+
<LookerDashboard
11+
title="Mainnet FT Transfers Report"
12+
src="https://lookerstudio.google.com/embed/reporting/6125e312-2e23-4385-8ba2-4c86f5f48e7f/page/p_fy15iz6kkd"
13+
hasTabs
14+
/>
15+
<Divider />
16+
</>
17+
);
18+
}
19+
// Unsupported because Swap Layer is not deployed on Testnet
20+
return (
21+
<>
22+
<Box textAlign="center" my={8} mx={4}>
23+
<Typography variant="h3">FT Metrics are currently only supported in Mainnet</Typography>
24+
</Box>
25+
26+
</>
27+
);
28+
}
29+
export default FTMetrics;

dashboard/src/components/Main.tsx

+26-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Home from './Home';
1414
import NTTMetrics from './NTTMetrics';
1515
import NetworkSelector from './NetworkSelector';
1616
import Settings from './Settings';
17+
import FTMetrics from './FTMetrics';
1718

1819
function NavButton(props: any) {
1920
// fix for Invalid value for prop `navigate` on <a> tag
@@ -84,8 +85,29 @@ function NavLinks() {
8485
<Typography variant="h6">NTT</Typography>
8586
</Hidden>
8687
</NavLink>
88+
<NavLink
89+
to={`/ft-metrics${search}`}
90+
exact
91+
component={NavButton}
92+
color="inherit"
93+
activeStyle={{ borderBottom: '2px solid', paddingBottom: 4 }}
94+
style={{
95+
paddingRight: 8,
96+
marginLeft: 8,
97+
textTransform: 'none',
98+
borderRadius: 0,
99+
minWidth: 0,
100+
}}
101+
>
102+
<Hidden mdUp>
103+
<SyncAltOutlined />
104+
</Hidden>
105+
<Hidden mdDown>
106+
<Typography variant="h6">FT</Typography>
107+
</Hidden>
108+
</NavLink>
87109
</>
88-
);
110+
)
89111
}
90112

91113
function Main() {
@@ -130,6 +152,9 @@ function Main() {
130152
<Route path="/contracts">
131153
<Contracts />
132154
</Route>
155+
<Route path="/ft-metrics">
156+
<FTMetrics />
157+
</Route>
133158
<Route path="/">
134159
<Home
135160
heartbeats={heartbeats}

0 commit comments

Comments
 (0)