Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard: add FT tab #367

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions dashboard/src/components/FTMetrics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Box, Divider, Typography } from '@mui/material';
import { useNetworkContext } from '../contexts/NetworkContext';
import { LookerDashboard } from './LookerDashboard';

function FTMetrics() {
const { currentNetwork } = useNetworkContext();
if (currentNetwork.name === 'Mainnet') {
return (
<>
<LookerDashboard
title="Mainnet FT Transfers Report"
src="https://lookerstudio.google.com/embed/reporting/6125e312-2e23-4385-8ba2-4c86f5f48e7f/page/p_fy15iz6kkd"
hasTabs
/>
<Divider />
</>
);
}
// Unsupported because Swap Layer is not deployed on Testnet
return (
<>
<Box textAlign="center" my={8} mx={4}>
<Typography variant="h3">FT Metrics are currently only supported in Mainnet</Typography>
</Box>
</>
);
}
export default FTMetrics;
25 changes: 25 additions & 0 deletions dashboard/src/components/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Home from './Home';
import NTTMetrics from './NTTMetrics';
import NetworkSelector from './NetworkSelector';
import Settings from './Settings';
import FTMetrics from './FTMetrics';

function NavButton(props: any) {
// fix for Invalid value for prop `navigate` on <a> tag
Expand Down Expand Up @@ -84,6 +85,27 @@ function NavLinks() {
<Typography variant="h6">NTT</Typography>
</Hidden>
</NavLink>
<NavLink
to={`/ft-metrics${search}`}
exact
component={NavButton}
color="inherit"
activeStyle={{ borderBottom: '2px solid', paddingBottom: 4 }}
style={{
paddingRight: 8,
marginLeft: 8,
textTransform: 'none',
borderRadius: 0,
minWidth: 0,
}}
>
<Hidden mdUp>
<SyncAltOutlined />
</Hidden>
<Hidden mdDown>
<Typography variant="h6">FT</Typography>
</Hidden>
</NavLink>
</>
);
}
Expand Down Expand Up @@ -130,6 +152,9 @@ function Main() {
<Route path="/contracts">
<Contracts />
</Route>
<Route path="/ft-metrics">
<FTMetrics />
</Route>
<Route path="/">
<Home
heartbeats={heartbeats}
Expand Down
Loading