-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dashboard: ntt looker and nav link fix
- Loading branch information
Showing
4 changed files
with
149 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { Box } from '@mui/material'; | ||
import { ReactElement } from 'react'; | ||
|
||
function RatioWrapper({ | ||
children, | ||
ratio = '56.25%' /* 16:9 */, | ||
paddingTop = 0, | ||
}: { | ||
children: ReactElement; | ||
ratio?: string; | ||
paddingTop?: number; | ||
}) { | ||
return ( | ||
<Box display="flex" alignItems="center" justifyContent="center" mt={2} mx={2}> | ||
<Box maxWidth={1366} flexGrow={1}> | ||
<Box style={{ width: '100%', paddingTop, paddingBottom: ratio, position: 'relative' }}> | ||
<Box | ||
style={{ | ||
position: 'absolute', | ||
top: 0, | ||
bottom: 0, | ||
left: 0, | ||
right: 0, | ||
}} | ||
> | ||
{children} | ||
</Box> | ||
</Box> | ||
</Box> | ||
</Box> | ||
); | ||
} | ||
|
||
export function LookerDashboard({ | ||
title, | ||
src, | ||
hasTabs = false, | ||
}: { | ||
title: string; | ||
src: string; | ||
hasTabs?: boolean; | ||
}) { | ||
return ( | ||
<RatioWrapper paddingTop={hasTabs ? 65 : 0}> | ||
<iframe | ||
title={title} | ||
src={src} | ||
style={{ | ||
border: 0, | ||
width: '100%', | ||
height: '100%', | ||
}} | ||
allowFullScreen | ||
sandbox="allow-storage-access-by-user-activation allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox" | ||
></iframe> | ||
</RatioWrapper> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Box, Typography } from '@mui/material'; | ||
import { useNetworkContext } from '../contexts/NetworkContext'; | ||
import { LookerDashboard } from './LookerDashboard'; | ||
|
||
function NTTMetrics() { | ||
const { currentNetwork } = useNetworkContext(); | ||
if (currentNetwork.name !== 'Testnet') { | ||
return ( | ||
<Box textAlign="center" my={8} mx={4}> | ||
<Typography variant="h3">NTT Metrics are only supported in Testnet</Typography> | ||
</Box> | ||
); | ||
} | ||
return ( | ||
<> | ||
<LookerDashboard | ||
title="Testnet NTT Transfers Report" | ||
src="https://lookerstudio.google.com/embed/reporting/a47057a8-15a0-4cc7-8086-eb00f5d09d2a/page/SPpuD" | ||
/> | ||
</> | ||
); | ||
} | ||
export default NTTMetrics; |