Skip to content

Commit 7e32325

Browse files
committed
[NEB-173]: Hide testnets in nebula chain selector
1 parent ddf2836 commit 7e32325

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

apps/dashboard/src/@/components/blocks/NetworkSelectors.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function MultiNetworkSelector(props: {
1919
disableChainId?: boolean;
2020
className?: string;
2121
priorityChains?: number[];
22+
hideTestnets?: boolean;
2223
}) {
2324
const { allChains, idToChain } = useAllChainsData();
2425

@@ -44,13 +45,17 @@ export function MultiNetworkSelector(props: {
4445
sortedChains = [...priorityChains, ...otherChains];
4546
}
4647

48+
if (props.hideTestnets) {
49+
sortedChains = sortedChains.filter((chain) => !chain.testnet);
50+
}
51+
4752
return sortedChains.map((chain) => {
4853
return {
4954
label: cleanChainName(chain.name),
5055
value: String(chain.chainId),
5156
};
5257
});
53-
}, [allChains, props.priorityChains, idToChain]);
58+
}, [allChains, props.priorityChains, idToChain, props.hideTestnets]);
5459

5560
const searchFn = useCallback(
5661
(option: Option, searchValue: string) => {

apps/dashboard/src/app/nebula-app/(app)/components/ContextFilters.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export function ContextFiltersForm(props: {
189189
<FormLabel>Chain IDs</FormLabel>
190190
<FormControl>
191191
<MultiNetworkSelector
192+
hideTestnets
192193
disableChainId
193194
className="bg-background"
194195
selectedChainIds={form

0 commit comments

Comments
 (0)