-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(explorer): various fixes (#3299)
- Loading branch information
Showing
13 changed files
with
111 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"@latticexyz/explorer": patch | ||
--- | ||
|
||
- Not found page if invalid chain name. | ||
- Only show selector for worlds if options exist. | ||
- Remove "future time" from transactions table. | ||
- Improved layout for Interact tab. | ||
- Wrap long args in transactions table. | ||
- New tables polling. | ||
- Add logs (regression). |
19 changes: 19 additions & 0 deletions
19
packages/explorer/src/app/(explorer)/[chainName]/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"use client"; | ||
|
||
import { notFound } from "next/navigation"; | ||
import { isValidChainName } from "../../../common"; | ||
|
||
type Props = { | ||
params: { | ||
chainName: string; | ||
}; | ||
children: React.ReactNode; | ||
}; | ||
|
||
export default function ChainLayout({ params: { chainName }, children }: Props) { | ||
if (!isValidChainName(chainName)) { | ||
return notFound(); | ||
} | ||
|
||
return children; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 20 additions & 3 deletions
23
packages/explorer/src/app/(explorer)/[chainName]/worlds/[worldAddress]/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,32 @@ | ||
"use client"; | ||
|
||
import { notFound } from "next/navigation"; | ||
import { Address } from "viem"; | ||
import { isValidChainName } from "../../../../../common"; | ||
import { Navigation } from "../../../../../components/Navigation"; | ||
import { Providers } from "./Providers"; | ||
import { TransactionsWatcher } from "./observe/TransactionsWatcher"; | ||
|
||
export default function WorldLayout({ children }: { children: React.ReactNode }) { | ||
type Props = { | ||
params: { | ||
chainName: string; | ||
worldAddress: Address; | ||
}; | ||
children: React.ReactNode; | ||
}; | ||
|
||
export default function WorldLayout({ params: { chainName }, children }: Props) { | ||
if (!isValidChainName(chainName)) { | ||
return notFound(); | ||
} | ||
|
||
return ( | ||
<Providers> | ||
<Navigation /> | ||
<div className="flex h-screen flex-col"> | ||
<Navigation /> | ||
{children} | ||
</div> | ||
<TransactionsWatcher /> | ||
{children} | ||
</Providers> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/explorer/src/app/(explorer)/[chainName]/worlds/[worldAddress]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { redirect } from "next/navigation"; | ||
import { supportedChainName } from "../../../../../common"; | ||
|
||
type Props = { | ||
params: { | ||
chainName: string; | ||
chainName: supportedChainName; | ||
worldAddress: string; | ||
}; | ||
}; | ||
|
||
export default async function WorldPage({ params }: Props) { | ||
const { chainName, worldAddress } = params; | ||
export default async function WorldPage({ params: { chainName, worldAddress } }: Props) { | ||
return redirect(`/${chainName}/worlds/${worldAddress}/explore`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters