From a1af774494c3ce2b0cd9cf9893cf8827db422025 Mon Sep 17 00:00:00 2001 From: Hayder Date: Thu, 5 Jun 2025 15:59:18 +0200 Subject: [PATCH 1/6] implement service level for NetworksTable --- .../src/supportedNetworks/NetworksTable.tsx | 94 +++++++++++++++---- website/src/supportedNetworks/utils.ts | 27 ++++++ 2 files changed, 104 insertions(+), 17 deletions(-) diff --git a/website/src/supportedNetworks/NetworksTable.tsx b/website/src/supportedNetworks/NetworksTable.tsx index 8750e9a6b8f5..e6f84be67865 100644 --- a/website/src/supportedNetworks/NetworksTable.tsx +++ b/website/src/supportedNetworks/NetworksTable.tsx @@ -11,7 +11,7 @@ import { Text, useDebounce, } from '@edgeandnode/gds' -import { Check, EyeClosed } from '@edgeandnode/gds/icons' +import { Check, Checks, EyeClosed } from '@edgeandnode/gds/icons' import { NetworkIcon } from '@edgeandnode/go' import { Callout, Table } from '@/components' @@ -58,6 +58,51 @@ export function NetworksTable({ networks }: { networks: SupportedNetwork[] }) {

+
+
+
+ Subgraphs +
+ + Subgraph Studio (No issuance) +
+
+ + The Graph Network (Issuance) +
+
+
+ Substreams +
+ + Base +
+
+ + Extended (EVM Only) +
+
+
+ Firehose +
+ + Base +
+
+ + Extended (EVM Only) +
+
+
+ Token API +
+ + All endpoints supported +
+
+
+
+
{t('index.supportedNetworks.tableHeaders.name')} - - {t('index.supportedNetworks.tableHeaders.id')} - {t('index.supportedNetworks.tableHeaders.subgraphs')} @@ -124,26 +166,44 @@ export function NetworksTable({ networks }: { networks: SupportedNetwork[] }) { key={network.id} className="group/table-row isolate -outline-offset-1 transition hocus-visible-within:bg-space-1600 has-[a:focus-visible]:outline-focus" > - - - - - {network.shortName} - - - -
- {network.id} + +
+ +
+ {network.shortName} + {network.id} +
+
+ +
- {network.subgraphs ? : null} - {network.substreams ? : null} - {network.firehose ? : null} + + {network.subgraphsSupportLevel === 'full' ? ( + + ) : network.subgraphsSupportLevel === 'basic' ? ( + + ) : null} + + + {network.substreamsSupportLevel === 'full' ? ( + + ) : network.substreamsSupportLevel === 'basic' ? ( + + ) : null} + + + {network.firehoseSupportLevel === 'full' ? ( + + ) : network.firehoseSupportLevel === 'basic' ? ( + + ) : null} + {network.tokenApi ? : null} ))} diff --git a/website/src/supportedNetworks/utils.ts b/website/src/supportedNetworks/utils.ts index 2de8d153584c..2e4f1559173c 100644 --- a/website/src/supportedNetworks/utils.ts +++ b/website/src/supportedNetworks/utils.ts @@ -41,6 +41,29 @@ export const getIconVariant = (networkId: string): 'mono' | 'branded' => { return MONO_ICON_NETWORKS.includes(networkId) ? 'mono' : 'branded' } +// Suport level for services +export const getSubgraphsSupportLevel = (network: any): 'none' | 'basic' | 'full' => { + const hasSubgraphs = Boolean(network.services.subgraphs?.length || network.services.sps?.length) + + if (!hasSubgraphs) return 'none' + if (network.issuanceRewards === true) return 'full' + return 'basic' +} + +export const getSubstreamsSupportLevel = (network: any): 'none' | 'basic' | 'full' => { + const substreamCount = network.services.substreams?.length || 0 + if (substreamCount === 0) return 'none' + if (substreamCount >= 2) return 'full' + return 'basic' +} + +export const getFirehoseSupportLevel = (network: any): 'none' | 'basic' | 'full' => { + const firehoseCount = network.services.firehose?.length || 0 + if (firehoseCount === 0) return 'none' + if (firehoseCount >= 2) return 'full' + return 'basic' +} + export async function getSupportedNetworks() { const registry = await NetworksRegistry.fromLatestVersion() return registry.networks @@ -61,6 +84,10 @@ export async function getSupportedNetworks() { substreams, firehose, tokenApi, + rawNetwork: network, + subgraphsSupportLevel: getSubgraphsSupportLevel(network), + substreamsSupportLevel: getSubstreamsSupportLevel(network), + firehoseSupportLevel: getFirehoseSupportLevel(network), }, ] }) From d32fa4f6facb63a29f6784d58eb1da6ecaed6bfd Mon Sep 17 00:00:00 2001 From: Hayder Date: Thu, 5 Jun 2025 16:05:53 +0200 Subject: [PATCH 2/6] Table Legend literals --- website/src/pages/en/index.json | 17 +++++++++++++++++ website/src/supportedNetworks/NetworksTable.tsx | 16 ++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/website/src/pages/en/index.json b/website/src/pages/en/index.json index 3a514cbb1908..3a7a5225bb2f 100644 --- a/website/src/pages/en/index.json +++ b/website/src/pages/en/index.json @@ -72,6 +72,23 @@ "substreams": "Substreams", "firehose": "Firehose", "tokenApi": "Token API" + }, + "tableLegend": { + "subgraphs": { + "basic": "Subgraph Studio (No issuance)", + "full": "The Graph Network (Issuance)" + }, + "substreams": { + "basic": "Base", + "full": "Extended (EVM Only)" + }, + "firehose": { + "basic": "Base", + "full": "Extended (EVM Only)" + }, + "tokenApi": { + "supported": "All endpoints supported" + } } }, "networkGuides": { diff --git a/website/src/supportedNetworks/NetworksTable.tsx b/website/src/supportedNetworks/NetworksTable.tsx index e6f84be67865..87e8954bea16 100644 --- a/website/src/supportedNetworks/NetworksTable.tsx +++ b/website/src/supportedNetworks/NetworksTable.tsx @@ -59,45 +59,45 @@ export function NetworksTable({ networks }: { networks: SupportedNetwork[] }) {
-
+
Subgraphs
- Subgraph Studio (No issuance) + {t('index.supportedNetworks.tableLegend.subgraphs.basic')}
- The Graph Network (Issuance) + {t('index.supportedNetworks.tableLegend.subgraphs.full')}
Substreams
- Base + {t('index.supportedNetworks.tableLegend.substreams.basic')}
- Extended (EVM Only) + {t('index.supportedNetworks.tableLegend.substreams.full')}
Firehose
- Base + {t('index.supportedNetworks.tableLegend.firehose.basic')}
- Extended (EVM Only) + {t('index.supportedNetworks.tableLegend.firehose.full')}
Token API
- All endpoints supported + {t('index.supportedNetworks.tableLegend.tokenApi.supported')}
From 5219db7194f404960da51c7a5dd5eda9b8c551d5 Mon Sep 17 00:00:00 2001 From: Hayder Date: Fri, 6 Jun 2025 08:28:54 +0200 Subject: [PATCH 3/6] general improvements --- website/src/pages/en/index.json | 7 +- .../src/supportedNetworks/NetworksTable.tsx | 87 +++++++++++-------- website/src/supportedNetworks/utils.ts | 8 +- 3 files changed, 60 insertions(+), 42 deletions(-) diff --git a/website/src/pages/en/index.json b/website/src/pages/en/index.json index 3a7a5225bb2f..3d575aa7a1fc 100644 --- a/website/src/pages/en/index.json +++ b/website/src/pages/en/index.json @@ -88,7 +88,12 @@ }, "tokenApi": { "supported": "All endpoints supported" - } + }, + "icons": { + "checkmark": "Checkmark", + "checkmarks": "Checkmarks" + }, + "legendTitle": "Table Legend" } }, "networkGuides": { diff --git a/website/src/supportedNetworks/NetworksTable.tsx b/website/src/supportedNetworks/NetworksTable.tsx index 87e8954bea16..316709e443a1 100644 --- a/website/src/supportedNetworks/NetworksTable.tsx +++ b/website/src/supportedNetworks/NetworksTable.tsx @@ -24,6 +24,13 @@ export function NetworksTable({ networks }: { networks: SupportedNetwork[] }) { const [immediateSearchQuery, setSearchQuery] = useState('') const [immediateShowTestnets, setShowTestnets] = useState(false) + const checkmark = ( + + ) + const checkmarks = ( + + ) + const searchQuery = useDebounce(immediateSearchQuery, 200) const showTestnets = useDebounce(immediateShowTestnets, 200) @@ -58,50 +65,56 @@ export function NetworksTable({ networks }: { networks: SupportedNetwork[] }) {

-
+
@@ -167,7 +180,7 @@ export function NetworksTable({ networks }: { networks: SupportedNetwork[] }) { className="group/table-row isolate -outline-offset-1 transition hocus-visible-within:bg-space-1600 has-[a:focus-visible]:outline-focus" > -
+
@@ -184,27 +197,27 @@ export function NetworksTable({ networks }: { networks: SupportedNetwork[] }) {
- {network.subgraphsSupportLevel === 'full' ? ( - - ) : network.subgraphsSupportLevel === 'basic' ? ( - - ) : null} + {network.subgraphsSupportLevel === 'full' + ? checkmarks + : network.subgraphsSupportLevel === 'basic' + ? checkmark + : null} - {network.substreamsSupportLevel === 'full' ? ( - - ) : network.substreamsSupportLevel === 'basic' ? ( - - ) : null} + {network.substreamsSupportLevel === 'full' + ? checkmarks + : network.substreamsSupportLevel === 'basic' + ? checkmark + : null} - {network.firehoseSupportLevel === 'full' ? ( - - ) : network.firehoseSupportLevel === 'basic' ? ( - - ) : null} + {network.firehoseSupportLevel === 'full' + ? checkmarks + : network.firehoseSupportLevel === 'basic' + ? checkmark + : null} - {network.tokenApi ? : null} + {network.tokenApi ? checkmark : null} ))} diff --git a/website/src/supportedNetworks/utils.ts b/website/src/supportedNetworks/utils.ts index 2e4f1559173c..8e1c5eb084eb 100644 --- a/website/src/supportedNetworks/utils.ts +++ b/website/src/supportedNetworks/utils.ts @@ -1,4 +1,4 @@ -import { NetworksRegistry } from '@pinax/graph-networks-registry' +import { NetworksRegistry, type Network } from '@pinax/graph-networks-registry' // Networks that should use the "mono" icon variant (TODO: add this feature to web3icons?) export const MONO_ICON_NETWORKS = [ @@ -42,7 +42,7 @@ export const getIconVariant = (networkId: string): 'mono' | 'branded' => { } // Suport level for services -export const getSubgraphsSupportLevel = (network: any): 'none' | 'basic' | 'full' => { +export const getSubgraphsSupportLevel = (network: Network): 'none' | 'basic' | 'full' => { const hasSubgraphs = Boolean(network.services.subgraphs?.length || network.services.sps?.length) if (!hasSubgraphs) return 'none' @@ -50,14 +50,14 @@ export const getSubgraphsSupportLevel = (network: any): 'none' | 'basic' | 'full return 'basic' } -export const getSubstreamsSupportLevel = (network: any): 'none' | 'basic' | 'full' => { +export const getSubstreamsSupportLevel = (network: Network): 'none' | 'basic' | 'full' => { const substreamCount = network.services.substreams?.length || 0 if (substreamCount === 0) return 'none' if (substreamCount >= 2) return 'full' return 'basic' } -export const getFirehoseSupportLevel = (network: any): 'none' | 'basic' | 'full' => { +export const getFirehoseSupportLevel = (network: Network): 'none' | 'basic' | 'full' => { const firehoseCount = network.services.firehose?.length || 0 if (firehoseCount === 0) return 'none' if (firehoseCount >= 2) return 'full' From a669ce015b49fa45010ce99b4c2cbb470efea454 Mon Sep 17 00:00:00 2001 From: Hayder Date: Fri, 6 Jun 2025 08:34:37 +0200 Subject: [PATCH 4/6] fix lint --- website/src/supportedNetworks/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/supportedNetworks/utils.ts b/website/src/supportedNetworks/utils.ts index 8e1c5eb084eb..e4f806810f75 100644 --- a/website/src/supportedNetworks/utils.ts +++ b/website/src/supportedNetworks/utils.ts @@ -1,4 +1,4 @@ -import { NetworksRegistry, type Network } from '@pinax/graph-networks-registry' +import { type Network,NetworksRegistry } from '@pinax/graph-networks-registry' // Networks that should use the "mono" icon variant (TODO: add this feature to web3icons?) export const MONO_ICON_NETWORKS = [ @@ -46,7 +46,7 @@ export const getSubgraphsSupportLevel = (network: Network): 'none' | 'basic' | ' const hasSubgraphs = Boolean(network.services.subgraphs?.length || network.services.sps?.length) if (!hasSubgraphs) return 'none' - if (network.issuanceRewards === true) return 'full' + if (network.issuanceRewards) return 'full' return 'basic' } From 08f205e4f6d356024d4da6279012e4fa9e325d0f Mon Sep 17 00:00:00 2001 From: Hayder Date: Fri, 6 Jun 2025 08:38:39 +0200 Subject: [PATCH 5/6] fix lint --- website/src/supportedNetworks/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/supportedNetworks/utils.ts b/website/src/supportedNetworks/utils.ts index e4f806810f75..83e2d4d398e6 100644 --- a/website/src/supportedNetworks/utils.ts +++ b/website/src/supportedNetworks/utils.ts @@ -1,4 +1,4 @@ -import { type Network,NetworksRegistry } from '@pinax/graph-networks-registry' +import { type Network, NetworksRegistry } from '@pinax/graph-networks-registry' // Networks that should use the "mono" icon variant (TODO: add this feature to web3icons?) export const MONO_ICON_NETWORKS = [ From 4c733041a7e1c60f924cdabb2f7d6626d9c2f03d Mon Sep 17 00:00:00 2001 From: Hayder Date: Tue, 10 Jun 2025 20:23:12 +0200 Subject: [PATCH 6/6] Remove explicit return type annotations from support level functions --- website/src/supportedNetworks/utils.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/website/src/supportedNetworks/utils.ts b/website/src/supportedNetworks/utils.ts index 83e2d4d398e6..5b64b3b18354 100644 --- a/website/src/supportedNetworks/utils.ts +++ b/website/src/supportedNetworks/utils.ts @@ -41,23 +41,20 @@ export const getIconVariant = (networkId: string): 'mono' | 'branded' => { return MONO_ICON_NETWORKS.includes(networkId) ? 'mono' : 'branded' } -// Suport level for services -export const getSubgraphsSupportLevel = (network: Network): 'none' | 'basic' | 'full' => { +// Support level for services +export const getSubgraphsSupportLevel = (network: Network) => { const hasSubgraphs = Boolean(network.services.subgraphs?.length || network.services.sps?.length) - if (!hasSubgraphs) return 'none' if (network.issuanceRewards) return 'full' return 'basic' } - -export const getSubstreamsSupportLevel = (network: Network): 'none' | 'basic' | 'full' => { +export const getSubstreamsSupportLevel = (network: Network) => { const substreamCount = network.services.substreams?.length || 0 if (substreamCount === 0) return 'none' if (substreamCount >= 2) return 'full' return 'basic' } - -export const getFirehoseSupportLevel = (network: Network): 'none' | 'basic' | 'full' => { +export const getFirehoseSupportLevel = (network: Network) => { const firehoseCount = network.services.firehose?.length || 0 if (firehoseCount === 0) return 'none' if (firehoseCount >= 2) return 'full'