Use amboss.space onion link in Stats (#859)

after pre-commit cleanup
This commit is contained in:
Felix 2023-09-25 10:57:38 +00:00 committed by GitHub
parent 534e4c0fee
commit dd2292f8d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,12 @@ interface Props {
const StatsDialog = ({ open = false, onClose, info }: Props): JSX.Element => { const StatsDialog = ({ open = false, onClose, info }: Props): JSX.Element => {
const { t } = useTranslation(); const { t } = useTranslation();
const isOnionAccess = window.location.hostname.endsWith('.onion');
const ambossURL = isOnionAccess
? `http://amboss5jfdzzblty5dr5zaig5twvkgsla6y5xuy6s5c5ogpjfcqgltid.onion/node/${info.node_id}`
: `https://amboss.space/node/${info.node_id}`;
return ( return (
<Dialog open={open} onClose={onClose}> <Dialog open={open} onClose={onClose}>
<div style={info.loading ? {} : { display: 'none' }}> <div style={info.loading ? {} : { display: 'none' }}>
@ -107,11 +113,7 @@ const StatsDialog = ({ open = false, onClose, info }: Props): JSX.Element => {
<AmbossIcon /> <AmbossIcon />
</ListItemIcon> </ListItemIcon>
<ListItemText secondary={info.node_alias}> <ListItemText secondary={info.node_alias}>
<Link <Link target='_blank' href={ambossURL} rel='noreferrer'>
target='_blank'
href={`https://amboss.space/node/${info.node_id}`}
rel='noreferrer'
>
{`${info.node_id.slice(0, 12)}... (AMBOSS)`} {`${info.node_id.slice(0, 12)}... (AMBOSS)`}
</Link> </Link>
</ListItemText> </ListItemText>