diff --git a/.vscode/settings.json b/.vscode/settings.json index f7f353781..dc01eae78 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,5 +9,9 @@ "[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "typescript.preferences.importModuleSpecifier": "non-relative", } diff --git a/apps/web/app/(entity)/[network]/[...path]/page.tsx b/apps/web/app/(entity)/[network]/[...path]/page.tsx index 0d53b6a51..7e348e690 100644 --- a/apps/web/app/(entity)/[network]/[...path]/page.tsx +++ b/apps/web/app/(entity)/[network]/[...path]/page.tsx @@ -32,10 +32,24 @@ export async function generateMetadata({ const query = params.path[1]; return { title: `Searching for ${query}`, + icons: [ + { + rel: "icon", + url: `/api/og?model=favicon&networkSlug=${network.slug}`, + }, + ], }; } - return getMetadata(params, network); + return { + ...getMetadata(params, network), + icons: [ + { + rel: "icon", + url: `/api/og?model=favicon&networkSlug=${network.slug}`, + }, + ], + }; } export default function EntityPage({ diff --git a/apps/web/app/(entity)/[network]/error.tsx b/apps/web/app/(entity)/[network]/error.tsx index b3cd23172..f3ab0d28b 100644 --- a/apps/web/app/(entity)/[network]/error.tsx +++ b/apps/web/app/(entity)/[network]/error.tsx @@ -6,11 +6,11 @@ import { ErrorBox } from "~/ui/error/box"; import { Footer } from "~/ui/footer"; import { HomeBg } from "~/ui/home-bg"; import { HomeBgMobile } from "~/ui/home-bg/mobile"; -import { useSearchOptionsContext } from "~/ui/search-options-context"; +import { useGroupedNetworksContext } from "~/ui/grouped-networks-context"; export default function Error() { const params = useParams(); - const optionGroups = useSearchOptionsContext(); + const optionGroups = useGroupedNetworksContext(); const network = React.useMemo(() => { const values = optionGroups.flat(); return ( diff --git a/apps/web/app/(entity)/[network]/layout.tsx b/apps/web/app/(entity)/[network]/layout.tsx index 761eb6107..21d8027b7 100644 --- a/apps/web/app/(entity)/[network]/layout.tsx +++ b/apps/web/app/(entity)/[network]/layout.tsx @@ -1,5 +1,5 @@ // components -import { Header } from "~/ui/header"; +import { EntityHeader } from "~/ui/entity-header"; import { HideBodyOverflow } from "~/ui/hide-body-overflow"; // utils @@ -30,7 +30,7 @@ export default async function BlockLayout({ > -
+
; @@ -34,38 +52,504 @@ export async function generateMetadata(props: Props): Promise { }, ], }, + icons: [ + { + rel: "icon", + url: `/api/og?model=favicon&networkSlug=${network.slug}`, + }, + ], }; } -export default async function NetworkWidgetPage({ params }: Props) { +export default async function NetworkPage({ params }: Props) { const network = await getSingleNetwork(params.network); // this fixes a bug on vercel with build where it would throw if the network doesn't // exist (even though technically it should always exist) if (!network) notFound(); + return ( + <> + + + + + ); +} + +type FeaturedChains = Exclude< + SingleNetwork["config"]["featuredChains"], + undefined +>; +function FeaturedChains({ + chainsLeft, + chainsRight, +}: { + chainsLeft: FeaturedChains; + chainsRight: FeaturedChains; +}) { + const noOfMissingChainsLeft = 3 - chainsLeft.length; + const noOfMissingChainsRight = 3 - chainsRight.length; + return ( + <> +