Remove isUnreachable from sidebar (#7728)

This commit is contained in:
Jaco 2022-06-11 15:41:12 +02:00 committed by GitHub
parent 739ba2d082
commit f5f71f023e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
import type { Group } from './types';
import React, { useCallback } from 'react';
import React, { useCallback, useMemo } from 'react';
import styled from 'styled-components';
import { Icon } from '@polkadot/react-components';
@ -28,6 +28,11 @@ function GroupDisplay ({ affinities, apiUrl, children, className = '', index, is
[index, isSelected, setGroup]
);
const filtered = useMemo(
() => networks.filter(({ isUnreachable }) => !isUnreachable),
[networks]
);
return (
<div className={`${className}${isSelected ? ' isSelected' : ''}`}>
<div
@ -40,7 +45,7 @@ function GroupDisplay ({ affinities, apiUrl, children, className = '', index, is
{isSelected && (
<>
<div className='groupNetworks'>
{networks.map((network, index): React.ReactNode => (
{filtered.map((network, index): React.ReactNode => (
<Network
affinity={affinities[network.name]}
apiUrl={apiUrl}