2022-09-09 17:18:04 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
2022-05-19 12:33:41 +00:00
|
|
|
|
|
|
|
import {
|
|
|
|
Dialog,
|
|
|
|
DialogContent,
|
|
|
|
Divider,
|
|
|
|
Link,
|
|
|
|
List,
|
|
|
|
ListItemText,
|
|
|
|
ListItem,
|
|
|
|
ListItemIcon,
|
|
|
|
Typography,
|
2022-09-09 17:18:04 +00:00
|
|
|
} from '@mui/material';
|
2022-05-19 12:33:41 +00:00
|
|
|
|
2022-09-09 17:18:04 +00:00
|
|
|
import BoltIcon from '@mui/icons-material/Bolt';
|
|
|
|
import PublicIcon from '@mui/icons-material/Public';
|
|
|
|
import DnsIcon from '@mui/icons-material/Dns';
|
|
|
|
import WebIcon from '@mui/icons-material/Web';
|
|
|
|
import FavoriteIcon from '@mui/icons-material/Favorite';
|
|
|
|
import GitHubIcon from '@mui/icons-material/GitHub';
|
|
|
|
import EqualizerIcon from '@mui/icons-material/Equalizer';
|
2022-05-19 12:33:41 +00:00
|
|
|
|
2022-09-23 09:52:59 +00:00
|
|
|
import { AmbossIcon, BitcoinSignIcon, RoboSatsNoTextIcon } from '../Icons';
|
2022-05-19 12:33:41 +00:00
|
|
|
|
2022-09-09 17:18:04 +00:00
|
|
|
import { pn } from '../../utils/prettyNumbers';
|
2022-05-19 12:33:41 +00:00
|
|
|
|
2022-09-09 17:33:29 +00:00
|
|
|
interface Props {
|
2022-05-19 12:33:41 +00:00
|
|
|
isOpen: boolean;
|
|
|
|
handleClickCloseStatsForNerds: () => void;
|
|
|
|
lndVersion: string;
|
2022-09-23 09:52:59 +00:00
|
|
|
coordinatorVersion: string;
|
|
|
|
clientVersion: string;
|
2022-05-19 12:33:41 +00:00
|
|
|
network: string;
|
|
|
|
nodeAlias: string;
|
|
|
|
nodeId: string;
|
|
|
|
alternativeName: string;
|
|
|
|
alternativeSite: string;
|
2022-09-23 09:52:59 +00:00
|
|
|
commitHash: string;
|
2022-05-19 12:33:41 +00:00
|
|
|
lastDayVolume: number;
|
|
|
|
lifetimeVolume: number;
|
2022-09-09 17:33:29 +00:00
|
|
|
}
|
2022-05-19 12:33:41 +00:00
|
|
|
|
|
|
|
const StatsDialog = ({
|
|
|
|
isOpen,
|
|
|
|
handleClickCloseStatsForNerds,
|
|
|
|
lndVersion,
|
2022-09-23 09:52:59 +00:00
|
|
|
coordinatorVersion,
|
|
|
|
clientVersion,
|
2022-05-19 12:33:41 +00:00
|
|
|
network,
|
|
|
|
nodeAlias,
|
|
|
|
nodeId,
|
|
|
|
alternativeName,
|
|
|
|
alternativeSite,
|
2022-09-23 09:52:59 +00:00
|
|
|
commitHash,
|
2022-05-19 12:33:41 +00:00
|
|
|
lastDayVolume,
|
|
|
|
lifetimeVolume,
|
|
|
|
}: Props): JSX.Element => {
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Dialog
|
|
|
|
open={isOpen}
|
|
|
|
onClose={handleClickCloseStatsForNerds}
|
2022-09-09 17:18:04 +00:00
|
|
|
aria-labelledby='stats-for-nerds-dialog-title'
|
|
|
|
aria-describedby='stats-for-nerds-description'
|
2022-05-19 12:33:41 +00:00
|
|
|
>
|
|
|
|
<DialogContent>
|
2022-09-09 17:18:04 +00:00
|
|
|
<Typography component='h5' variant='h5'>
|
|
|
|
{t('Stats For Nerds')}
|
|
|
|
</Typography>
|
2022-05-19 12:33:41 +00:00
|
|
|
|
|
|
|
<List dense>
|
|
|
|
<Divider />
|
|
|
|
|
2022-09-23 09:52:59 +00:00
|
|
|
<ListItem>
|
|
|
|
<ListItemIcon>
|
|
|
|
<RoboSatsNoTextIcon sx={{width:'1.4em',height:'1.4em',right:'0.2em', position:'relative'}}/>
|
|
|
|
</ListItemIcon>
|
|
|
|
<ListItemText primary={`${t("Client")} ${clientVersion} - ${t("Coordinator")} ${coordinatorVersion}`} secondary={t('RoboSats version')} />
|
|
|
|
</ListItem>
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
|
2022-05-19 12:33:41 +00:00
|
|
|
<ListItem>
|
|
|
|
<ListItemIcon>
|
|
|
|
<BoltIcon />
|
|
|
|
</ListItemIcon>
|
2022-09-09 17:18:04 +00:00
|
|
|
<ListItemText primary={lndVersion} secondary={t('LND version')} />
|
2022-05-19 12:33:41 +00:00
|
|
|
</ListItem>
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
|
2022-09-09 17:18:04 +00:00
|
|
|
{network === 'testnet' ? (
|
2022-05-19 12:33:41 +00:00
|
|
|
<ListItem>
|
|
|
|
<ListItemIcon>
|
|
|
|
<DnsIcon />
|
|
|
|
</ListItemIcon>
|
2022-09-23 09:52:59 +00:00
|
|
|
<ListItemText secondary={`${t("LN Node")}: ${nodeAlias}`}>
|
2022-05-19 12:33:41 +00:00
|
|
|
<Link
|
2022-09-09 17:18:04 +00:00
|
|
|
target='_blank'
|
2022-05-19 12:33:41 +00:00
|
|
|
href={`https://1ml.com/testnet/node/${nodeId}`}
|
2022-09-09 17:18:04 +00:00
|
|
|
rel='noreferrer'
|
2022-05-19 12:33:41 +00:00
|
|
|
>
|
|
|
|
{`${nodeId.slice(0, 12)}... (1ML)`}
|
|
|
|
</Link>
|
|
|
|
</ListItemText>
|
|
|
|
</ListItem>
|
|
|
|
) : (
|
|
|
|
<ListItem>
|
|
|
|
<ListItemIcon>
|
|
|
|
<AmbossIcon />
|
|
|
|
</ListItemIcon>
|
|
|
|
<ListItemText secondary={nodeAlias}>
|
2022-09-09 17:18:04 +00:00
|
|
|
<Link target='_blank' href={`https://amboss.space/node/${nodeId}`} rel='noreferrer'>
|
2022-05-19 12:33:41 +00:00
|
|
|
{`${nodeId.slice(0, 12)}... (AMBOSS)`}
|
|
|
|
</Link>
|
|
|
|
</ListItemText>
|
|
|
|
</ListItem>
|
|
|
|
)}
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
|
|
|
|
<ListItem>
|
|
|
|
<ListItemIcon>
|
|
|
|
<WebIcon />
|
|
|
|
</ListItemIcon>
|
|
|
|
<ListItemText secondary={alternativeName}>
|
2022-09-09 17:18:04 +00:00
|
|
|
<Link target='_blank' href={`http://${alternativeSite}`} rel='noreferrer'>
|
2022-05-19 12:33:41 +00:00
|
|
|
{`${alternativeSite.slice(0, 12)}...onion`}
|
|
|
|
</Link>
|
|
|
|
</ListItemText>
|
|
|
|
</ListItem>
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
|
|
|
|
<ListItem>
|
|
|
|
<ListItemIcon>
|
|
|
|
<GitHubIcon />
|
|
|
|
</ListItemIcon>
|
2022-09-23 09:52:59 +00:00
|
|
|
<ListItemText secondary={t('Coordinator commit hash')}>
|
2022-05-19 12:33:41 +00:00
|
|
|
<Link
|
2022-09-09 17:18:04 +00:00
|
|
|
target='_blank'
|
2022-09-23 09:52:59 +00:00
|
|
|
href={`https://github.com/Reckless-Satoshi/robosats/tree/${commitHash}`}
|
2022-09-09 17:18:04 +00:00
|
|
|
rel='noreferrer'
|
2022-05-19 12:33:41 +00:00
|
|
|
>
|
2022-09-23 09:52:59 +00:00
|
|
|
{`${commitHash.slice(0, 12)}...`}
|
2022-05-19 12:33:41 +00:00
|
|
|
</Link>
|
|
|
|
</ListItemText>
|
|
|
|
</ListItem>
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
|
|
|
|
<ListItem>
|
|
|
|
<ListItemIcon>
|
|
|
|
<EqualizerIcon />
|
|
|
|
</ListItemIcon>
|
2022-09-09 17:18:04 +00:00
|
|
|
<ListItemText secondary={t('24h contracted volume')}>
|
|
|
|
<div
|
|
|
|
style={{
|
|
|
|
cursor: 'pointer',
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
flexWrap: 'wrap',
|
|
|
|
}}
|
|
|
|
>
|
2022-05-19 12:33:41 +00:00
|
|
|
{pn(lastDayVolume)}
|
2022-09-09 17:18:04 +00:00
|
|
|
<BitcoinSignIcon sx={{ width: 14, height: 14 }} color={'text.secondary'} />
|
2022-05-19 12:33:41 +00:00
|
|
|
</div>
|
|
|
|
</ListItemText>
|
|
|
|
</ListItem>
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
|
|
|
|
<ListItem>
|
|
|
|
<ListItemIcon>
|
|
|
|
<EqualizerIcon />
|
|
|
|
</ListItemIcon>
|
2022-09-09 17:18:04 +00:00
|
|
|
<ListItemText secondary={t('Lifetime contracted volume')}>
|
|
|
|
<div
|
|
|
|
style={{
|
|
|
|
cursor: 'pointer',
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
flexWrap: 'wrap',
|
|
|
|
}}
|
|
|
|
>
|
2022-05-19 12:33:41 +00:00
|
|
|
{pn(lifetimeVolume)}
|
2022-09-09 17:18:04 +00:00
|
|
|
<BitcoinSignIcon sx={{ width: 14, height: 14 }} color={'text.secondary'} />
|
2022-05-19 12:33:41 +00:00
|
|
|
</div>
|
|
|
|
</ListItemText>
|
|
|
|
</ListItem>
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
<ListItem>
|
|
|
|
<ListItemIcon>
|
|
|
|
<PublicIcon />
|
|
|
|
</ListItemIcon>
|
|
|
|
<ListItemText
|
|
|
|
primary={
|
2022-09-09 17:18:04 +00:00
|
|
|
<div
|
|
|
|
style={{
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'left',
|
|
|
|
flexWrap: 'wrap',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<span>{`${t('Made with')} `}</span>
|
|
|
|
<FavoriteIcon sx={{ color: '#ff0000', height: '22px', width: '22px' }} />
|
|
|
|
<span>{` ${t('and')} `}</span>
|
|
|
|
<BoltIcon sx={{ color: '#fcba03', height: '23px', width: '23px' }} />
|
2022-05-19 12:33:41 +00:00
|
|
|
</div>
|
|
|
|
}
|
2022-09-09 17:18:04 +00:00
|
|
|
secondary={t('... somewhere on Earth!')}
|
2022-05-19 12:33:41 +00:00
|
|
|
/>
|
|
|
|
</ListItem>
|
|
|
|
</List>
|
|
|
|
</DialogContent>
|
|
|
|
</Dialog>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default StatsDialog;
|