Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 72 additions & 18 deletions app/[locale]/wallets/find-wallet/page-jsonld.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getTranslations } from "next-intl/server"

import { FileContributor, Lang } from "@/lib/types"
import { FileContributor, Lang, WalletData } from "@/lib/types"

import PageJsonLD from "@/components/PageJsonLD"

Expand All @@ -13,12 +13,14 @@ import { normalizeUrlForJsonLd } from "@/lib/utils/url"
export default async function FindWalletPageJsonLD({
locale,
contributors,
wallets,
}: {
locale: Lang | undefined
contributors: FileContributor[]
wallets: WalletData[]
}) {
const t = await getTranslations({
namespace: "page-find-wallet",
namespace: "page-wallets-find-wallet",
})

const url = normalizeUrlForJsonLd(locale, `/wallets/find-wallet/`)
Expand All @@ -29,14 +31,28 @@ export default async function FindWalletPageJsonLD({
url: contributor.html_url,
}))

const platforms = (wallet: WalletData): string[] => {
const os: string[] = []
if (wallet.ios) os.push("iOS")
if (wallet.android) os.push("Android")
if (wallet.linux) os.push("Linux")
if (wallet.windows) os.push("Windows")
if (wallet.macOS) os.push("macOS")
if (wallet.chromium) os.push("Chromium (Extension)")
if (wallet.firefox) os.push("Firefox")
if (wallet.hardware) os.push("Hardware")
return os
}

const jsonLd = {
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebPage",
"@type": "CollectionPage",
"@id": url,
name: t("page-find-wallet-meta-title"),
description: t("page-find-wallet-meta-description"),
image: "https://ethereum.org/images/wallets/wallet-hero.png",
url: url,
inLanguage: locale,
contributor: contributorList,
Expand Down Expand Up @@ -72,24 +88,62 @@ export default async function FindWalletPageJsonLD({
},
publisher: ethereumFoundationOrganization,
reviewedBy: ethereumFoundationOrganization,
mainEntity: { "@id": `${url}#find-wallet` },
mainEntity: { "@id": `${url}#wallet-list` },
},
{
"@type": "Article",
"@id": `${url}#find-wallet`,
headline: t("page-find-wallet-title"),
"@type": "ItemList",
"@id": `${url}#wallet-list`,
name: t("page-find-wallet-title"),
description: t("page-find-wallet-meta-description"),
image: "https://ethereum.org/images/wallets/wallet-hero.png",
author: [ethereumCommunityOrganization],
publisher: ethereumFoundationOrganization,
contributor: contributorList,
reviewedBy: ethereumFoundationOrganization,
about: {
"@type": "Thing",
name: "Ethereum Wallet Finder",
description:
"Tool to find and compare Ethereum wallets based on features and requirements",
},
numberOfItems: wallets.length,
itemListElement: wallets.map((wallet, index) => ({
"@type": "ListItem",
position: index + 1,
item: {
"@type": "SoftwareApplication",
name: wallet.name,
url: wallet.url,
applicationCategory: "Cryptocurrency Wallet",
operatingSystem: platforms(wallet).join(", "),
offers: {
"@type": "Offer",
price: "0",
priceCurrency: "USD",
},
additionalProperty: [
{
"@type": "PropertyValue",
name: "Open Source",
value: wallet.open_source ? "Yes" : "No",
},
{
"@type": "PropertyValue",
name: "Self Custody",
value: wallet.non_custodial ? "Yes" : "No",
},
{
"@type": "PropertyValue",
name: "Hardware Wallet Support",
value: wallet.hardware_support ? "Yes" : "No",
},
{
"@type": "PropertyValue",
name: "Layer 2 Support",
value: wallet.layer_2 ? "Yes" : "No",
},
{
"@type": "PropertyValue",
name: "Staking",
value: wallet.staking ? "Yes" : "No",
},
{
"@type": "PropertyValue",
name: "NFT Support",
value: wallet.nft_support ? "Yes" : "No",
},
],
},
})),
},
],
}
Expand Down
6 changes: 5 additions & 1 deletion app/[locale]/wallets/find-wallet/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ const Page = async ({ params }: { params: PageParams }) => {

return (
<>
<FindWalletPageJsonLD locale={locale} contributors={contributors} />
<FindWalletPageJsonLD
locale={locale}
contributors={contributors}
wallets={walletsData}
/>

<I18nProvider locale={locale} messages={messages}>
<MainArticle className="relative flex flex-col">
Expand Down