Skip to content

Commit 96ab1d5

Browse files
committed
Add embedded wallets intro page
1 parent 5edfbdd commit 96ab1d5

File tree

6 files changed

+1124
-10
lines changed

6 files changed

+1124
-10
lines changed

embedded-wallets/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
title: MetaMask Embedded Wallets
33
sidebar_label: Overview
44
description: 'MetaMask Embedded Wallets'
5+
displayed_sidebar: sdk_react
6+
hide_table_of_contents: true
57
---
8+
9+
import SDKReferenceCards from '@site/src/components/SDKReferenceCards'
10+
11+
<SDKReferenceCards />

ew-sidebar.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {
1+
import {
22
reactJS,
33
vue,
44
android,
@@ -122,7 +122,7 @@ function mobileTopNavButton(selectedSDK) {
122122

123123
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
124124
const sidebar = {
125-
sdk_pnp_react: [
125+
sdk_react: [
126126
{
127127
type: "html",
128128
value: webTopNavButton(reactJS),
@@ -192,7 +192,7 @@ const sidebar = {
192192
href: "https://github.com/Web3Auth/web3auth-web/releases",
193193
},
194194
],
195-
sdk_pnp_vue: [
195+
sdk_vue: [
196196
{
197197
type: "html",
198198
value: webTopNavButton(vue),
@@ -258,7 +258,7 @@ const sidebar = {
258258
href: "https://github.com/Web3Auth/web3auth-web/releases",
259259
},
260260
],
261-
sdk_pnp_js: [
261+
sdk_js: [
262262
{
263263
type: "html",
264264
value: webTopNavButton(js),
@@ -311,7 +311,7 @@ const sidebar = {
311311
href: "https://github.com/Web3Auth/web3auth-web/releases",
312312
},
313313
],
314-
sdk_pnp_android: [
314+
sdk_android: [
315315
{
316316
type: "html",
317317
value: mobileTopNavButton(android),
@@ -350,7 +350,7 @@ const sidebar = {
350350
href: "https://github.com/Web3Auth/web3auth-android-sdk/releases",
351351
},
352352
],
353-
sdk_pnp_ios: [
353+
sdk_ios: [
354354
{
355355
type: "html",
356356
value: mobileTopNavButton(ios),
@@ -389,7 +389,7 @@ const sidebar = {
389389
href: "https://github.com/Web3Auth/web3auth-swift-sdk/releases",
390390
},
391391
],
392-
sdk_pnp_react_native: [
392+
sdk_react_native: [
393393
{
394394
type: "html",
395395
value: mobileTopNavButton(reactnative),
@@ -436,7 +436,7 @@ const sidebar = {
436436
href: "https://github.com/Web3Auth/web3auth-react-native-sdk/releases",
437437
},
438438
],
439-
sdk_pnp_flutter: [
439+
sdk_flutter: [
440440
{
441441
type: "html",
442442
value: mobileTopNavButton(flutter),
@@ -480,7 +480,7 @@ const sidebar = {
480480
href: "https://github.com/Web3Auth/web3auth-flutter-sdk/releases",
481481
},
482482
],
483-
sdk_pnp_unity: [
483+
sdk_unity: [
484484
{
485485
type: "html",
486486
value: gamingTopNavButton(unity),
@@ -514,7 +514,7 @@ const sidebar = {
514514
href: "https://github.com/Web3Auth/web3auth-unity-sdk/releases",
515515
},
516516
],
517-
sdk_pnp_unreal: [
517+
sdk_unreal: [
518518
{
519519
type: "html",
520520
value: gamingTopNavButton(unreal),
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
export const reactJS = "React";
2+
export const angular = "Angular";
3+
export const vue = "Vue";
4+
export const nextjs = "Next JS";
5+
export const web = "Web";
6+
export const mobile = "Mobile";
7+
export const gaming = "Gaming";
8+
export const enterprise = "Enterprise";
9+
export const android = "Android";
10+
export const ios = "iOS";
11+
export const js = "Javascript";
12+
export const macOS = "macOS";
13+
export const reactnative = "React Native";
14+
export const rnbare = "React Native Bare";
15+
export const rnexpo = "React Native Expo";
16+
export const rnlist = [rnbare, rnexpo];
17+
export const flutter = "Flutter";
18+
export const unity = "Unity";
19+
export const unreal = "Unreal Engine";
20+
export const nodejs = "Node.js";
21+
export const weblist = [reactJS, angular, vue, nextjs];
22+
23+
export const pnp = "Plug and Play";
24+
export const sfa = "Single Factor Auth";
25+
export const pnpwebmodal = "Plug and Play Web Modal";
26+
export const pnpwebnomodal = "Plug and Play Web No Modal";
27+
export const pnpandroid = "Plug and Play Android";
28+
export const pnpios = "Plug and Play iOS";
29+
export const pnprn = "Plug and Play React Native";
30+
export const pnpflutter = "Plug and Play Flutter";
31+
export const pnpunity = "Plug and Play Unity";
32+
export const pnpunreal = "Plug and Play Unreal";
33+
export const pnplist = [
34+
{ label: "Web - Modal", value: pnpwebmodal, platforms: [...weblist] },
35+
{ label: "Web - No Modal", value: pnpwebnomodal, platforms: [...weblist] },
36+
{ label: "Android", value: pnpandroid, platforms: [android] },
37+
{ label: "iOS", value: pnpios, platforms: [ios] },
38+
{ label: "React Native", value: pnprn, platforms: [...rnlist] },
39+
{ label: "Flutter", value: pnpflutter, platforms: [flutter] },
40+
{ label: "Unity", value: pnpunity, platforms: [unity] },
41+
{ label: "Unreal", value: pnpunreal, platforms: [unreal] },
42+
];
43+
44+
export const mpccorekit = "MPC Core Kit";
45+
export const singlefactorauth = "Single Factor Auth";
46+
export const singlefactorauthjs = "SFA JS";
47+
export const singlefactorauthandroid = "SFA Android";
48+
export const singlefactorauthios = "SFA Swift";
49+
export const singlefactorauthflutter = "SFA Flutter";
50+
export const mpccorekitjs = "MPC Core Kit JS";
51+
export const mpccorekitreactnative = "MPC Core Kit React Native";
52+
53+
export const sfalist = [
54+
{ label: "SFA JS", value: singlefactorauthjs, platforms: [...weblist, reactnative, nodejs] },
55+
{ label: "SFA Android", value: singlefactorauthandroid, platforms: [android] },
56+
{ label: "SFA Swift", value: singlefactorauthios, platforms: [ios, macOS] },
57+
{ label: "SFA Flutter", value: singlefactorauthflutter, platforms: [flutter] },
58+
];
59+
60+
export const mpccorekitlist = [
61+
{ label: "MPC Core Kit JS", value: mpccorekitjs, platforms: [...weblist, reactnative, nodejs] },
62+
{ label: "MPC Core Kit React Native", value: mpccorekitreactnative, platforms: [reactnative] },
63+
];
64+
65+
const getWindowLocation = () => {
66+
if (typeof window !== "undefined") return window.location.href;
67+
return "http://localhost";
68+
};
69+
70+
export const getOptionsfromURL = (): Record<string, string> => {
71+
const url = new URL(getWindowLocation());
72+
73+
const urlOpts = {};
74+
url.searchParams.forEach((value, key) => {
75+
urlOpts[key] = value;
76+
});
77+
78+
return { ...urlOpts };
79+
};
80+
81+
export const setURLfromOptions = (opts: Record<string, string>): string => {
82+
const url = new URL(getWindowLocation());
83+
84+
url.search = "";
85+
for (const [key, value] of Object.entries(opts)) url.searchParams.append(key, value);
86+
return url.toString();
87+
};

0 commit comments

Comments
 (0)