diff --git a/apps/explorer/app/opengraph-image.tsx b/apps/explorer/app/opengraph-image.tsx index d19fdd80a..708df58bd 100644 --- a/apps/explorer/app/opengraph-image.tsx +++ b/apps/explorer/app/opengraph-image.tsx @@ -3,7 +3,7 @@ import { getSiaCentralHostsNetworkMetrics, } from '@siafoundation/sia-central' import { getOGImage } from '../components/OGImage' -import { networkName, siaCentralApi } from '../config' +import { network, siaCentralApi } from '../config' import { humanBytes } from '@siafoundation/sia-js' export const revalidate = 60 @@ -50,9 +50,9 @@ export default async function Image() { return getOGImage( { - title: networkName === 'Sia Mainnet' ? 'siascan' : 'siascan', + title: 'siascan', subtitle: - networkName === 'Sia Mainnet' + network === 'mainnet' ? 'Sia blockchain and host explorer.' : 'Zen testnet blockchain and host explorer.', values, diff --git a/apps/explorer/app/page.tsx b/apps/explorer/app/page.tsx index c1135112e..6ae4779bb 100644 --- a/apps/explorer/app/page.tsx +++ b/apps/explorer/app/page.tsx @@ -1,5 +1,5 @@ import { Metadata } from 'next' -import { appLink, appName, networkName, siaCentralApi } from '../config' +import { appLink, network, siaCentralApi } from '../config' import { Home } from '../components/Home' import { getSiaCentralBlockLatest, @@ -9,23 +9,19 @@ import { getSiaCentralHostsNetworkMetrics, } from '@siafoundation/sia-central' import { range } from 'lodash' +import { buildMetadata } from '../lib/utils' export function generateMetadata(): Metadata { - const title = networkName === 'Sia Mainnet' ? 'siascan' : 'siascan' + const title = 'siascan' const description = - networkName === 'Sia Mainnet' + network === 'mainnet' ? 'Sia blockchain and host explorer.' : 'Zen blockchain and host explorer.' - return { + return buildMetadata({ title, description, - openGraph: { - title, - description, - url: appLink, - siteName: appName, - }, - } + url: appLink, + }) } export const revalidate = 60 diff --git a/apps/explorer/components/Faucet/index.tsx b/apps/explorer/components/Faucet/index.tsx index d860e195f..bdffac592 100644 --- a/apps/explorer/components/Faucet/index.tsx +++ b/apps/explorer/components/Faucet/index.tsx @@ -40,7 +40,7 @@ export function Faucet() { return (
- +
diff --git a/apps/explorer/components/Layout/NavDropdownMenu.tsx b/apps/explorer/components/Layout/NavDropdownMenu.tsx index 94816b243..779284bec 100644 --- a/apps/explorer/components/Layout/NavDropdownMenu.tsx +++ b/apps/explorer/components/Layout/NavDropdownMenu.tsx @@ -7,8 +7,8 @@ import { Link, DropdownMenuGroup, DropdownMenuLabel, + Menu24, } from '@siafoundation/design-system' -import { networkName } from '../../config' type Props = React.ComponentProps & { trigger?: React.ReactNode @@ -20,8 +20,8 @@ export function NavDropdownMenu({ trigger, children, ...props }: Props) { - {networkName} + ) } @@ -30,16 +30,24 @@ export function NavDropdownMenu({ trigger, children, ...props }: Props) { Network - + Sia Mainnet - + Zen Testnet + + Tools + + + Zen Faucet + + + ) } diff --git a/libs/design-system/src/core/NavbarSite.tsx b/apps/explorer/components/Layout/Navbar.tsx similarity index 51% rename from libs/design-system/src/core/NavbarSite.tsx rename to apps/explorer/components/Layout/Navbar.tsx index 2ad46a260..b56b15907 100644 --- a/libs/design-system/src/core/NavbarSite.tsx +++ b/apps/explorer/components/Layout/Navbar.tsx @@ -1,20 +1,27 @@ -import { Container } from './Container' -import { Heading } from './Heading' -import { Link } from './Link' -import { Logo } from './Logo' +import { + Container, + Heading, + Link, + Logo, + Text, +} from '@siafoundation/design-system' type Props = { appName?: string + network?: 'mainnet' | 'zen' homeHref: string children: React.ReactNode } -export function NavbarSite({ appName, homeHref, children }: Props) { +export function Navbar({ appName, network, homeHref, children }: Props) { return (
+ {network !== 'mainnet' && ( +
+ )}
-
+
@@ -22,11 +29,19 @@ export function NavbarSite({ appName, homeHref, children }: Props) { {appName} )} + {network !== 'mainnet' && ( + + {network} + + )}
diff --git a/apps/explorer/components/Layout/index.tsx b/apps/explorer/components/Layout/index.tsx index ed4b6a2b1..864187cf5 100644 --- a/apps/explorer/components/Layout/index.tsx +++ b/apps/explorer/components/Layout/index.tsx @@ -1,14 +1,10 @@ -import { - NavbarSite, - FaucetIcon, - LinkButton, - Tooltip, -} from '@siafoundation/design-system' +import { FaucetIcon, LinkButton, Tooltip } from '@siafoundation/design-system' import { routes } from '../../config/routes' import { Search } from './Search' -import { isMainnet, networkName } from '../../config' +import { isMainnet, network, networkName, appName } from '../../config' import { NavDropdownMenu } from './NavDropdownMenu' import { Footer } from './Footer' +import { Navbar } from './Navbar' type Props = { children: React.ReactNode @@ -18,17 +14,25 @@ export function Layout({ children }: Props) { return (
- + {!isMainnet && ( - + )} - +
{children} diff --git a/apps/explorer/components/OGImage/Preview.tsx b/apps/explorer/components/OGImage/Preview.tsx index 95ef9eb2d..31d4d741f 100644 --- a/apps/explorer/components/OGImage/Preview.tsx +++ b/apps/explorer/components/OGImage/Preview.tsx @@ -2,6 +2,7 @@ import { Header } from './Header' import { Background } from './Background' import { cx } from 'class-variance-authority' +import { network } from '../../config' type Props = { title: string @@ -24,7 +25,7 @@ export function Preview({ title, subtitle, values }: Props) { values ? 'pb-6' : 'pb-10' )} style={{ - gap: '7px', + gap: '8px', }} > )}
-
+
) } diff --git a/apps/explorer/components/OGImageEntity/Preview.tsx b/apps/explorer/components/OGImageEntity/Preview.tsx index 674786fd2..76cf1b92c 100644 --- a/apps/explorer/components/OGImageEntity/Preview.tsx +++ b/apps/explorer/components/OGImageEntity/Preview.tsx @@ -3,6 +3,7 @@ import { cx } from 'class-variance-authority' import { Background } from '../OGImage/Background' import { Header } from './Header' +import { network } from '../../config' type Props = { id: string @@ -57,7 +58,7 @@ export function Preview({
-
+
) } diff --git a/apps/explorer/config/index.ts b/apps/explorer/config/index.ts index d6ed5265a..b431cb333 100644 --- a/apps/explorer/config/index.ts +++ b/apps/explorer/config/index.ts @@ -1,10 +1,12 @@ import { webLinks } from '@siafoundation/design-system' +export const network = 'mainnet' export const networkName = 'Sia Mainnet' +export const siteName = 'siascan.com' export const appName = 'siascan' export const appLink = webLinks.explore.mainnet export const isMainnet = true // APIs -export const faucetApi = 'https://navigator.sia.tech/faucet/api' +export const faucetApi = 'https://faucet.zen.sia.tech/api' export const siaCentralApi = 'https://api.siacentral.com/v2' diff --git a/apps/explorer/config/testnet.ts b/apps/explorer/config/testnet.ts index 1744d65b6..bdf00befe 100644 --- a/apps/explorer/config/testnet.ts +++ b/apps/explorer/config/testnet.ts @@ -1,10 +1,12 @@ import { webLinks } from '@siafoundation/design-system' +export const network = 'zen' export const networkName = 'Zen Testnet' -export const appName = 'Zen Testnet' +export const siteName = 'zen.siascan.com' +export const appName = 'siascan' export const appLink = webLinks.explore.testnet export const isMainnet = false // APIs -export const faucetApi = 'https://navigator-zen.sia.tech/faucet/api' +export const faucetApi = 'https://faucet.zen.sia.tech/api' export const siaCentralApi = 'https://api.siacentral.com/v2/zen' diff --git a/apps/explorer/lib/utils.ts b/apps/explorer/lib/utils.ts index 66a87fdec..812f14a74 100644 --- a/apps/explorer/lib/utils.ts +++ b/apps/explorer/lib/utils.ts @@ -1,7 +1,7 @@ import { EntityType } from '@siafoundation/design-system' import { routes } from '../config/routes' import { Metadata } from 'next' -import { appName } from '../config' +import { siteName } from '../config' export function getHref(type: EntityType, value: string) { return routes[type].view.replace(':id', value) @@ -23,7 +23,7 @@ export function buildMetadata({ title, description, url, - siteName: appName, + siteName: siteName, }, } } diff --git a/libs/design-system/src/index.ts b/libs/design-system/src/index.ts index 845f12834..625d6b539 100644 --- a/libs/design-system/src/index.ts +++ b/libs/design-system/src/index.ts @@ -1,7 +1,6 @@ // core export * from './core/Accordion' export * from './core/Alert' -export * from './core/NavbarSite' export * from './core/Avatar' export * from './core/Badge' export * from './core/Button'