Skip to content

Commit

Permalink
Add flask-only UI elements (MetaMask#941)
Browse files Browse the repository at this point in the history
- New markdown admonition `:::flaskOnly` creates a block with Flask branding colors explaining that the section is Flask-only
- New `flask_only` custom prop for sidebar items adds a "Flask" tag to the sidebar item with appropriate colors
  • Loading branch information
ziad-saab authored Sep 27, 2023
1 parent 12d71fc commit 4183de5
Show file tree
Hide file tree
Showing 10 changed files with 799 additions and 6 deletions.
15 changes: 15 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ const config = {
remarkPlugins: [
require("remark-docusaurus-tabs"),
],
admonitions: {
tag: ":::",
keywords: [
"info",
"success",
"danger",
"note",
"tip",
"warning",
"important",
"caution",
"security",
"flaskOnly",
],
},
}),
],
[
Expand Down
3 changes: 3 additions & 0 deletions snaps-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ const sidebar = {
type: "doc",
id: "reference/keyring-api/index",
},
customProps: {
flask_only: true,
},
items: require("./snaps/reference/keyring-api/typedoc-sidebar.cjs"),
},
],
Expand Down
6 changes: 3 additions & 3 deletions snaps/concepts/keyring-api.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: Learn about the Snaps Keyring API.
sidebar_position: 6
sidebar_custom_props:
flask_only: true
---

# About the Keyring API

:::caution important
This API is only available in [MetaMask Flask](../get-started/install-flask.md), the canary
distribution of MetaMask.
:::flaskOnly
:::

:::tip API documentation
Expand Down
6 changes: 6 additions & 0 deletions snaps/how-to/use-keyring-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
description: Use the KeyringSnapRpcClient from a dapp.
sidebar_label: Use the Keyring API
sidebar_position: 5
sidebar_custom_props:
flask_only: true
---

# Use the Keyring API from a dapp

:::flaskOnly
:::


Your dapp can use the [Keyring API](../concepts/keyring-api.md) to interact with custom EVM accounts.
Use the [`KeyringSnapRpcClient`](../reference/keyring-api/classes/KeyringSnapRpcClient.md)
of the Keyring API to invoke Keyring RPC methods on your [Keyring snap](../concepts/keyring-api.md#terminology).
Expand Down
6 changes: 3 additions & 3 deletions snaps/tutorials/custom-evm-accounts.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
description: Create a Keyring snap to connect to custom EVM accounts in MetaMask.
sidebar_custom_props:
flask_only: true
---

# Create a snap to connect to custom EVM accounts

This tutorial walks you through creating a snap that uses the [Keyring API](../concepts/keyring-api.md)
to integrate custom EVM accounts in MetaMask.

:::caution important
The [Keyring API methods](../reference/keyring-api/index.md) mentioned in this tutorial are only
available in [MetaMask Flask](../get-started/install-flask.md), the canary distribution of MetaMask.
:::flaskOnly
:::

## Prerequisites
Expand Down
Loading

0 comments on commit 4183de5

Please sign in to comment.