Skip to content

Commit cbe3ee4

Browse files
authored
Merge branch 'main' into add-ogori-chain-83333
2 parents 5014cfa + 727a6ec commit cbe3ee4

File tree

5 files changed

+448
-195
lines changed

5 files changed

+448
-195
lines changed

app/api/chains/route.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
import { NextResponse } from 'next/server';
1+
import { NextResponse, NextRequest } from 'next/server';
22
import { Chains } from '@/types';
33
import fs from 'fs/promises';
44
import path from 'path';
5+
import { pickBy } from 'es-toolkit';
56

6-
export async function GET() {
7+
export async function GET(_req: NextRequest) {
78
try {
9+
const chainIds = _req.nextUrl.searchParams.get('chain_ids')?.split(',');
810
const filePath = path.join(process.cwd(), 'data', 'chains.json');
911
const jsonData = await fs.readFile(filePath, 'utf8');
12+
1013
const chainsData: Chains = JSON.parse(jsonData);
14+
const filteredChains = chainIds && chainIds.length > 0 ?
15+
pickBy(chainsData, (_, chainId) => chainIds.includes(String(chainId))) :
16+
chainsData;
1117

12-
return NextResponse.json(chainsData);
18+
return NextResponse.json(filteredChains);
1319
} catch (error) {
1420
console.error('Error reading chains data:', error);
1521
return NextResponse.json({ error: 'Failed to load chains data' }, { status: 500 });

components/MenuLinks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const MenuLinks: React.FC<MenuLinksProps> = ({ isMobile = false }) => (
3030
<MenuLink href="https://eaas.blockscout.com/#features" isMobile={isMobile}>Features</MenuLink>
3131
<MenuLink href="https://eaas.blockscout.com/#explorer-as-a-service" isMobile={isMobile}>Explorer as a Service</MenuLink>
3232
<MenuLink href="https://eaas.blockscout.com/#future-updates" isMobile={isMobile}>Future Updates</MenuLink>
33-
<MenuLink href="https://eaas.blog.blockscout.com/" target="_blank" isMobile={isMobile}>Blog</MenuLink>
33+
<MenuLink href="https://www.blog.blockscout.com/" target="_blank" isMobile={isMobile}>Blog</MenuLink>
3434
<MenuLink href="https://docs.blockscout.com/" target="_blank" isMobile={isMobile}>Docs</MenuLink>
3535
<MenuLink href="https://eaas.blockscout.com/#contact" isMobile={isMobile}>Contact</MenuLink>
3636
</nav>

0 commit comments

Comments
 (0)