Skip to content

Commit

Permalink
Revamp Wallet get started docs (MetaMask#1114)
Browse files Browse the repository at this point in the history
* Revamp Wallet get started docs

* edits

* finish draft

* fixes

* clean up redirects

* frameworks -> platforms

* remove navbar beta labels

* add numbered steps

* link fix

* update sdk table

* strengthen messaging around SDK

* fix links
  • Loading branch information
alexandratran authored Feb 5, 2024
1 parent d8d2a14 commit c893340
Show file tree
Hide file tree
Showing 62 changed files with 664 additions and 590 deletions.
246 changes: 77 additions & 169 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,232 +136,132 @@ const config = {
fromExtensions: ["html", "htm"],
redirects: [
{
from: "/guide/",
to: "/wallet/",
from: ["/guide", "/guide/common-terms", "/guide/contributors", "/wallet/how-to/get-started-building", "/wallet/how-to/set-up-dev-environment", "/guide/create-dapp", "/guide/getting-started", "/wallet/category/get-started", "/wallet/get-started/set-up-dev-environment", "/wallet/how-to/get-started-building/set-up-dev-environment"],
to: "/wallet",
},
{
from: "/guide/getting-started",
to: "/wallet/how-to/get-started-building/set-up-dev-environment",
from: "/wallet/how-to/connect",
to: "/wallet/quickstart/javascript",
},
{
from: "/guide/common-terms",
to: "/wallet/",
from: "/wallet/category/how-to",
to: "/wallet/how-to",
},
{
from: "/guide/initializing-dapps",
to: "/wallet/how-to/interact-with-smart-contracts",
from: ["/guide/mobile-getting-started", "/guide/site-compatibility-checklist", "/guide/mobile-best-practices", "/wallet/how-to/use-mobile", "/wallet/how-to/integrate-with-mobile", "/sdk"],
to: "/wallet/how-to/use-sdk",
},
{
from: "/guide/accessing-accounts",
to: "/wallet/how-to/connect/access-accounts",
from: ["/wallet/get-started/detect-metamask", "/wallet/how-to/connect/detect-metamask", "/wallet/how-to/detect-metamask", "/wallet/how-to/discover-multiple-wallets"],
to: "/wallet/how-to/detect-wallet",
},
{
from: "/guide/sending-transactions",
to: "/wallet/how-to/send-transactions",
from: ["/wallet/get-started/detect-network", "/wallet/how-to/connect/detect-network"],
to: "/wallet/how-to/detect-network",
},
{
from: "/guide/ethereum-provider",
to: "/wallet/reference/provider-api",
from: ["/guide/accessing-accounts", "/wallet/how-to/connect/access-accounts", "/wallet/get-started/access-accounts"],
to: "/wallet/how-to/access-accounts",
},
{
from: "/guide/provider-migration",
to: "/wallet/concepts/apis",
},
{
from: "/guide/rpc-api",
to: "/wallet/reference/json-rpc-api",
from: "/guide/sending-transactions",
to: "/wallet/how-to/send-transactions",
},
{
from: "/guide/signing-data",
to: "/wallet/how-to/sign-data",
},
{
from: "/guide/registering-function-names",
to: "/wallet/how-to/display/method-names",
from: "/wallet/how-to/use-siwe",
to: "/wallet/how-to/sign-data/siwe",
},
{
from: "/guide/registering-your-token",
from: ["/guide/registering-your-token", "/wallet/how-to/register-token"],
to: "/wallet/how-to/display/tokens",
},
{
from: "/guide/defining-your-icon",
from: ["/guide/registering-function-names", "/wallet/how-to/register-method-names"],
to: "/wallet/how-to/display/method-names",
},
{
from: ["/guide/defining-your-icon", "/wallet/how-to/set-icon"],
to: "/wallet/how-to/display/icon",
},
{
from: "/guide/onboarding-library",
to: "/wallet/how-to/onboard-users",
from: "/wallet/how-to/request-permissions",
to: "/wallet/how-to/manage-permissions",
},
{
from: "/guide/metamask-extension-provider",
to: "/wallet/how-to/access-provider",
},
{
from: "/guide/mobile-getting-started",
to: "/wallet/how-to/connect/set-up-sdk",
},
{
from: "/guide/site-compatibility-checklist",
to: "/wallet/how-to/connect/set-up-sdk",
},
{
from: "/guide/mobile-best-practices",
to: "/wallet/how-to/connect/set-up-sdk",
},
{
from: "/guide/snaps",
to: "/snaps/",
},
{
from: "/guide/snaps-development-guide",
to: "/snaps/how-to/develop-a-snap",
from: "/guide/initializing-dapps",
to: "/wallet/how-to/interact-with-smart-contracts",
},
{
from: "/guide/snaps-concepts",
to: "/snaps/concepts",
from: "/guide/ethereum-provider",
to: "/wallet/reference/provider-api",
},
{
from: ["/guide/snaps-rpc-api", "/snaps/reference/rpc-api"],
to: "/snaps/reference/snaps-api",
from: ["/guide/onboarding-library", "/wallet/how-to/use-onboarding-library"],
to: "/wallet/how-to/onboard-users",
},
{
from: "/guide/snaps-permissions",
to: "/snaps/how-to/request-permissions",
from: ["/wallet/get-started/run-development-network", "/wallet/how-to/get-started-building/run-devnet"],
to: "/wallet/how-to/run-devnet",
},
{
from: ["/guide/snaps-exports", "/snaps/reference/exports"],
to: "/snaps/reference/entry-points",
from: "/wallet/how-to/get-started-building/secure-dapp",
to: "/wallet/how-to/secure-dapp",
},
{
from: "/guide/snaps-patching-dependencies",
to: "/snaps/how-to/troubleshoot",
from: "/wallet/category/concepts",
to: "/wallet/concepts",
},
{
from: "/guide/create-dapp",
to: "/wallet/how-to/get-started-building/set-up-dev-environment",
from: ["/guide/provider-migration", "/wallet/concepts/provider-api", "/wallet/concepts/rpc-api", "/wallet/how-to/migrate-api"],
to: "/wallet/concepts/apis",
},
{
from: "/guide/contributors",
to: "/wallet/",
from: "/wallet/category/tutorials",
to: "/wallet/tutorials",
},
{
from: "/wallet/tutorials/simple-react-dapp",
to: "/wallet/tutorials/react-dapp-local-state",
},
{
from: "/wallet/category/how-to",
to: "/wallet/how-to",
},
{
from: "/wallet/category/concepts",
to: "/wallet/concepts",
},
{
from: "/wallet/category/tutorials",
to: "/wallet/tutorials",
},
{
from: "/wallet/category/reference",
to: "/wallet/reference",
},
{
from: "/snaps/category/get-started",
to: "/snaps/get-started",
},
{
from: "/snaps/category/how-to",
to: "/snaps/how-to",
},
{
from: "/snaps/category/concepts",
to: "/snaps/concepts",
},
{
from: "/snaps/category/tutorials",
to: "/snaps/tutorials",
},
{
from: "/snaps/category/reference",
to: "/snaps/reference",
},
{
from: "/wallet/category/get-started",
to: "/wallet/how-to/get-started-building",
},
{
from: "/wallet/get-started/set-up-dev-environment",
to: "/wallet/how-to/get-started-building/set-up-dev-environment",
},
{
from: "/wallet/get-started/run-development-network",
to: "/wallet/how-to/get-started-building/run-devnet",
},
{
from: "/wallet/how-to/secure-dapp",
to: "/wallet/how-to/get-started-building/secure-dapp",
},
{
from: ["/wallet/get-started/detect-metamask", "/wallet/how-to/connect/detect-metamask"],
to: "/wallet/how-to/connect/detect-wallet/metamask",
},
{
from: "/wallet/get-started/detect-network",
to: "/wallet/how-to/connect/detect-network",
},
{
from: "/wallet/get-started/access-accounts",
to: "/wallet/how-to/connect/access-accounts",
},
{
from: "/wallet/how-to/use-siwe",
to: "/wallet/how-to/sign-data/siwe",
},
{
from: "/wallet/how-to/use-mobile",
to: "/wallet/how-to/connect/set-up-sdk",
},
{
from: "/wallet/how-to/use-onboarding-library",
to: "/wallet/how-to/onboard-users",
},
{
from: "/wallet/how-to/register-token",
to: "/wallet/how-to/display/tokens",
},
{
from: "/wallet/how-to/register-method-names",
to: "/wallet/how-to/display/method-names",
},
{
from: "/wallet/how-to/set-icon",
to: "/wallet/how-to/display/icon",
},
{
from: "/wallet/concepts/provider-api",
to: "/wallet/concepts/apis",
from: ["/guide/rpc-api", "/wallet/reference/rpc-api"],
to: "/wallet/reference/json-rpc-api",
},
{
from: "/wallet/concepts/rpc-api",
to: "/wallet/concepts/apis",
from: "/guide/snaps",
to: "/snaps",
},
{
from: "/wallet/how-to/integrate-with-mobile",
to: "/wallet/how-to/connect/set-up-sdk",
from: "/snaps/category/get-started",
to: "/snaps/get-started",
},
{
from: "/wallet/how-to/migrate-api",
to: "/wallet/concepts/apis",
from: "/snaps/get-started/install-snaps",
to: "/snaps/get-started/install-flask",
},
{
from: "/sdk",
to: "/wallet/how-to/connect/set-up-sdk",
from: "/snaps/category/how-to",
to: "/snaps/how-to",
},
{
from: "/wallet/reference/rpc-api",
to: "/wallet/reference/json-rpc-api",
from: "/guide/snaps-development-guide",
to: "/snaps/how-to/develop-a-snap",
},
{
from: "/wallet/how-to/request-permissions",
to: "/wallet/how-to/manage-permissions",
from: "/guide/snaps-permissions",
to: "/snaps/how-to/request-permissions",
},
{
from: "/snaps/tutorials/custom-evm-accounts",
Expand All @@ -372,30 +272,42 @@ const config = {
to: "/snaps/how-to/use-3rd-party-snaps",
},
{
from: "/snaps/get-started/install-snaps",
to: "/snaps/get-started/install-flask",
from: "/guide/snaps-patching-dependencies",
to: "/snaps/how-to/troubleshoot",
},
{
from: ["/guide/snaps-concepts", "/snaps/category/concepts", "/snaps/concepts/lifecycle", "/snaps/concepts/user-interface"],
to: "/snaps/concepts/overview",
},
{
from: "/snaps/concepts/anatomy",
to: "/snaps/concepts/files",
},
{
from: ["/snaps/concepts/lifecycle", "/snaps/concepts/user-interface"],
to: "/snaps/concepts/overview",
from: "/snaps/category/tutorials",
to: "/snaps/tutorials",
},
{
from: "/wallet/how-to/discover-multiple-wallets",
to: "/wallet/how-to/connect/detect-wallet/multiple-wallets",
from: "/snaps/category/reference",
to: "/snaps/reference",
},
{
from: ["/guide/snaps-rpc-api", "/snaps/reference/rpc-api"],
to: "/snaps/reference/snaps-api",
},
{
from: ["/guide/snaps-exports", "/snaps/reference/exports"],
to: "/snaps/reference/entry-points",
}
].reduce((acc, item) => {
acc.push(item);
acc.push({ from: item.from + ".html", to: item.to });
return acc;
}, []),
createRedirects(existingPath) {
if (existingPath.includes("/connect/set-up-sdk")) {
if (existingPath.includes("/use-sdk")) {
return [
existingPath.replace("/connect/set-up-sdk", "/use-sdk"),
existingPath.replace("/use-sdk", "/connect/set-up-sdk"),
];
}
return undefined;
Expand All @@ -415,10 +327,6 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Metadata array here for the open graph image tag
metadata: [
{ name: 'og:image', content: '/img/metamaskog.jpeg' },
],
navbar: {
title: " β”‚ β€Ž Documentation",
logo: {
Expand All @@ -433,7 +341,7 @@ const config = {
label: "Wallet",
},
{
to: "/wallet/how-to/connect/set-up-sdk",
to: "/wallet/how-to/use-sdk",
label: "SDK",
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/CardList/CardListItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function CardListItem({ item }: CardListItemProps): JSX.Element {
const cardContent = (
<>
{item.title && (
<h2 className={clsx("text--truncate", styles.cardTitle)}>
<h2 className={clsx(styles.cardTitle)}>
{item.icon && (
<img src={item.icon} className={styles.cardIcon} />
)}
Expand Down
8 changes: 4 additions & 4 deletions src/components/SnapsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Card, { type CardItem } from "@site/src/components/Card";

const CardList: CardItem[] = [
{
title: "🏁 Get started with Snaps",
title: "🏁 Snaps quickstart",
link: "/snaps/get-started/quickstart",
description: (<>
Get started quickly by creating and customizing a simple Snap, using the Snaps template built
Expand All @@ -19,10 +19,10 @@ const CardList: CardItem[] = [
</>),
},
{
title: "🌐 Snaps JSON-RPC API",
link: "/snaps/reference/rpc-api",
title: "🌐 Snaps API",
link: "/snaps/reference/snaps-api",
description: (<>
Use the Snaps JSON-RPC API to modify the functionality of MetaMask and communicate between dapps and Snaps.
Use the Snaps API to modify the functionality of MetaMask and communicate between dapps and Snaps.
</>),
},
];
Expand Down
Loading

0 comments on commit c893340

Please sign in to comment.