Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified login #1481

Open
wants to merge 88 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
b15b3bd
ACT-1390: Faucet page routing
Jul 9, 2024
cd7d7a5
ACT-1387, ACT-1387: Tabs, Button
Voltmod Jul 10, 2024
e7f9be1
Merge branch 'refs/heads/main' into faucets-for-mm-docs
Jul 12, 2024
22ec37b
ACT-1393 Component: Typography (#1410)
Voltmod Jul 17, 2024
2d23908
Merge branch 'refs/heads/main' into faucets-for-mm-docs
Jul 17, 2024
d5e4b5d
Faucet alerts + prettier (#1423)
Voltmod Jul 18, 2024
5ed2df2
Merge branch 'refs/heads/main' into faucets-for-mm-docs
Jul 18, 2024
1e9b628
feat(faucet): act-1391 - added badge component (#1425)
TrofimovAnton85 Jul 18, 2024
8871cf8
feat(docs): act-1392 - added table component (#1439)
TrofimovAnton85 Jul 23, 2024
a8d81d5
eslint + prettier fix for src (#1440)
Voltmod Jul 23, 2024
50e5158
ACT-1473 Assemble faucet page (#1448)
Voltmod Jul 24, 2024
52ab084
ACT-1473 Assemble faucet page
Jul 25, 2024
d892cf7
Merge branch 'refs/heads/main' into faucets-for-mm-docs
Jul 26, 2024
fdfc42d
ESlint + Prettier
Jul 26, 2024
597b1ec
Improve types and aliases resolving
Jul 26, 2024
a3fd801
feat(m-login): adding full login flow
cedricmagne Jul 31, 2024
e635c7e
feat(m-login): fix merge
cedricmagne Jul 31, 2024
c0aac44
feat(m-login): fix build
cedricmagne Jul 31, 2024
c4728a7
feat(m-login): fixing link unfurling
cedricmagne Jul 31, 2024
dcc4174
feat(m-login): implementing multiple wallet pairing
cedricmagne Aug 1, 2024
b2cddbf
feat(mm-login): updating dashboard preview url
cedricmagne Aug 1, 2024
450cfba
feat(mm-login): updating dashboard preview url
cedricmagne Aug 1, 2024
b81e5f1
feat(mm-login): fix merge
cedricmagne Aug 1, 2024
45f9716
feat(mm-login): hardcode dashboard preview url
cedricmagne Aug 1, 2024
7fe56b5
Faucet maintenance mode (#1475)
Voltmod Aug 2, 2024
667c043
Merge branch 'refs/heads/ACT-1382-siwsrp-full-flow' into faucets-for-…
Aug 5, 2024
af804ae
Faucet supports MM login flow
Aug 7, 2024
69485fa
Handle MetaMask sdk using common sdk
Aug 8, 2024
6e5c17d
Handle auth Infura connection
Aug 8, 2024
e7c5a19
Merge branch 'refs/heads/main' into faucets-for-mm-docs
Aug 8, 2024
2699e61
Faucet Hero img
Aug 8, 2024
251c500
Fix SSR
Aug 8, 2024
8d7f4b7
Fix BrowserOnly
Aug 8, 2024
7e9bf23
Handle stale data
Aug 9, 2024
f386d29
Get transactions
Aug 9, 2024
65fb211
Merge branch 'refs/heads/main' into ACT-1382-siwsrp-full-flow
Aug 12, 2024
d6fbd38
Merge branch 'refs/heads/ACT-1382-siwsrp-full-flow' into faucets-for-…
Aug 12, 2024
d8f4e23
Unified login interface for MM Docs via MM Wallet
Aug 12, 2024
e7537d3
Unified login interface for MM Docs via MM Wallet
Aug 12, 2024
ffbd55e
Unified login interface for MM Docs via MM Wallet
Aug 12, 2024
a1e3b18
Unified login interface for MM Docs via MM Wallet
Aug 12, 2024
86905aa
Merge branch 'main' into unified-login
cedricmagne Aug 13, 2024
def0d14
feat(unified-login): update unified login
cedricmagne Aug 13, 2024
30ff810
feat(unified-login): update unified login flow
cedricmagne Aug 13, 2024
65fe335
feat(unified-login): update unified login flow
cedricmagne Aug 14, 2024
df0ddd2
feat(unified-login): update unified login flow
cedricmagne Aug 14, 2024
bf1e849
feat(unified-login): update unified login flow
cedricmagne Aug 14, 2024
ff74d96
Merge branch 'main' into unified-login
cedricmagne Aug 14, 2024
b54a153
feat(unified-login): add feature flag to manage login button
cedricmagne Aug 14, 2024
c7ac6a7
feat(unified-login): fix bug on refreshing page
cedricmagne Aug 14, 2024
15ea458
feat(unified-login): fix dahboard url
cedricmagne Aug 15, 2024
df80924
feat(unified-login): fix dahboard url
cedricmagne Aug 15, 2024
901ec77
feat(unified-login): fix dahboard url
cedricmagne Aug 15, 2024
516f979
feat(unified-login): fix dahboard url
cedricmagne Aug 15, 2024
e2edca5
feat(unified-login): fix dahboard url
cedricmagne Aug 15, 2024
cbf37ba
feat(unified-login): fix dahboard url
cedricmagne Aug 15, 2024
449a33a
feat(unified-login): fix dahboard url
cedricmagne Aug 15, 2024
07c7ea3
feat(unified-login): update dahboard_url function call
cedricmagne Aug 15, 2024
41d24af
Merge branch 'main' into unified-login
Aug 29, 2024
16f66fe
Improve ui and ux
Aug 30, 2024
aa9273b
clear data on disconnect
Aug 30, 2024
8858103
Small bugfixes
Aug 30, 2024
9574bc8
feat(unified-login): add connection success modal
cedricmagne Sep 3, 2024
6a1939a
feat(mm-login-prod): fix merge
cedricmagne Sep 5, 2024
bc47a38
feat(unified-login): upgrade metamask sdk
cedricmagne Sep 6, 2024
886a6dc
feat(unified-login): fix merge
cedricmagne Sep 6, 2024
df4ed98
Merge branch 'main' into unified-login
cedricmagne Sep 11, 2024
10e7de7
feat(mm-login): fix merge and improve login when multiple infura acco…
cedricmagne Sep 16, 2024
44bf070
feat(mm-login): fix merge conflicts
cedricmagne Sep 16, 2024
f5ff3ee
feat(mm-login): fix merge conflicts
cedricmagne Sep 16, 2024
63b1931
feat(mm-login): fix yarn install
cedricmagne Sep 17, 2024
d9ffa86
feat(mm-login): update profile sync sdk package
cedricmagne Sep 17, 2024
1f8836d
feat(mm-login): fix merge
cedricmagne Sep 17, 2024
d0abe39
Fix useDoc hook
Sep 18, 2024
266e326
feat(mm-login): fix merge and package version
cedricmagne Sep 18, 2024
7ccbb64
Merge branch 'main' into unified-login
cedricmagne Sep 18, 2024
8c4ac1f
Fix metamask provider value
Sep 18, 2024
2b2a420
feat(mm-login): fix sdk initialization
cedricmagne Sep 18, 2024
8e5c348
Merge branch 'unified-login' of github.com:MetaMask/metamask-docs int…
cedricmagne Sep 18, 2024
a0c911d
Merge branch 'main' into unified-login
Sep 18, 2024
40e157d
fix package.json
Sep 18, 2024
3aa54ae
feat(mm-login): fix merge
cedricmagne Sep 18, 2024
97b5d22
feat(mm-login): fix merge
cedricmagne Sep 18, 2024
e8d28ab
Merge branch 'main' into unified-login
cedricmagne Sep 19, 2024
46c0afd
feat(mm-login): add projects box on new-reference page
cedricmagne Sep 19, 2024
c249a3d
feat(mm-login): add projects box on new-reference page
cedricmagne Sep 19, 2024
a72c6d4
feat(mm-login): conosle log test
cedricmagne Sep 19, 2024
bafccc9
feat(mm-login): fix pathname testing
cedricmagne Sep 19, 2024
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
11 changes: 10 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

require("dotenv").config();
const { themes } = require("prism-react-renderer");
const { REF_ALLOW_LOGIN_PATH } = require("./src/lib/constants");
const codeTheme = themes.dracula;
const remarkCodesandbox = require("remark-codesandbox");
const isProd = process.env.NODE_ENV === "production";
Expand Down Expand Up @@ -32,6 +33,8 @@ const config = {

customFields: {
LD_CLIENT_ID: process.env.LD_CLIENT_ID,
VERCEL_ENV: process.env.VERCEL_ENV,
DASHBOARD_PREVIEW_URL: process.env.DASHBOARD_PREVIEW_URL,
},

trailingSlash: true,
Expand Down Expand Up @@ -88,6 +91,7 @@ const config = {
],
],
plugins: [
"docusaurus-plugin-sass",
[
"@docusaurus/plugin-content-docs",
{
Expand Down Expand Up @@ -168,7 +172,7 @@ const config = {
replaysOnErrorSampleRate: isProd ? 1.0 : 0,
replaysSessionSampleRate: isProd ? 1.0 : 0,
sampleRate: isProd ? 0.25 : 0,
tracesSampleRate: 0,
tracesSampleRate: 0,
},
},
},
Expand Down Expand Up @@ -220,6 +224,11 @@ const config = {
label: "User support",
position: "right",
},
{
type: "custom-navbarWallet",
position: "right",
includeUrl: REF_ALLOW_LOGIN_PATH,
},
/* Language drop down
{
type: "localeDropdown",
Expand Down
5,032 changes: 3,515 additions & 1,517 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 20 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "(MIT OR Apache-2.0)",
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"start": "docusaurus start -p 3003",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
Expand All @@ -19,7 +19,7 @@
"lint:js": "eslint . --ext js,jsx,ts,tsx --max-warnings=5",
"lint:style": "stylelint \"**/*.css\" --fix",
"lint:fix": "npm run lint:js -- --fix",
"format": "prettier --write '{blog,docs,src,static}/**/*.{md,mdx,ts,js,tsx,jsx,json}'"
"format": "prettier --write '{blog,docs,src}/**/*.{md,mdx,ts,js,tsx,jsx,json}'"
},
"lint-staged": {
"src/**/*.{ts,js,jsx,tsx}": "npm run lint:fix",
Expand All @@ -31,35 +31,43 @@
"@apidevtools/json-schema-ref-parser": "^11.6.4",
"@docusaurus/core": "^3.0.0",
"@docusaurus/plugin-content-docs": "^3.0.0",
"@docusaurus/plugin-content-pages": "^3.4.0",
"@docusaurus/theme-common": "^3.0.0",
"@docusaurus/theme-mermaid": "^3.0.0",
"@intercom/messenger-js-sdk": "^0.0.11",
"@mdx-js/react": "^3.0.0",
"@metamask/design-tokens": "^1.11.1",
"@metamask/docusaurus-openrpc": "^0.4.1",
"@metamask/sdk": "^0.26.5",
"@metamask/sdk-react": "^0.26.5",
"@metamask/profile-sync-controller": "^0.6.0",
"@metamask/sdk": "^0.28.1",
"@rjsf/core": "^5.18.4",
"@rjsf/utils": "^5.18.4",
"@rjsf/validator-ajv8": "^5.18.4",
"@types/react": "^18.3.3",
"clsx": "^1.2.1",
"docusaurus-plugin-sass": "^0.2.5",
"docusaurus-plugin-segment": "^1.0.4",
"docusaurus-plugin-sentry": "^2.0.0",
"dotenv": "^16.4.5",
"ethers": "^6.13.2",
"js-cookie": "^3.0.5",
"jsonwebtoken": "^9.0.2",
"launchdarkly-js-client-sdk": "^3.3.0",
"lodash.debounce": "^4.0.8",
"lodash.isobject": "^3.0.2",
"node-polyfill-webpack-plugin": "^2.0.1",
"prettier": "^3.0.0",
"prettier": "^3.3.3",
"prism-react-renderer": "^2.1.0",
"react": "^18.0.0",
"react-alert": "^7.0.3",
"react-dom": "^18.0.0",
"react-dropdown-select": "^4.11.2",
"react-modal": "^3.16.1",
"react-player": "^2.13.0",
"react-tippy": "^1.4.0",
"remark-codesandbox": "^0.10.1",
"remark-docusaurus-tabs": "^0.2.0"
"remark-docusaurus-tabs": "^0.2.0",
"sass": "^1.77.6"
},
"devDependencies": {
"@docusaurus/eslint-plugin": "^3.0.0",
Expand All @@ -69,12 +77,14 @@
"@docusaurus/types": "^3.4.0",
"@lavamoat/allow-scripts": "^3.0.4",
"@tsconfig/docusaurus": "^1.0.5",
"@types/react-alert": "^7.0.6",
"@types/react-modal": "^3.16.3",
"@typescript-eslint/parser": "^7.12.0",
"eslint-plugin-react": "^7.34.2",
"stylelint": "^15.0.0 ",
"stylelint-config-standard": "^34.0.0",
"tsc-files": "^1.1.4",
"typescript": "^5.4.5"
"typescript": "^5.5.4"
},
"browserslist": {
"production": [
Expand Down Expand Up @@ -112,7 +122,9 @@
"@metamask/sdk-react>@metamask/sdk>eciesjs>secp256k1": false,
"@metamask/sdk>@metamask/sdk-communication-layer>bufferutil": false,
"@metamask/sdk>@metamask/sdk-communication-layer>utf-8-validate": false,
"@metamask/sdk>eciesjs>secp256k1": false
"@metamask/sdk>eciesjs>secp256k1": false,
"ethers>ws>bufferutil": false,
"ethers>ws>utf-8-validate": false
}
}
}
85 changes: 85 additions & 0 deletions src/components/Alert/alert.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
:root[data-theme="dark"] {
--alert-error-background: rgb(53, 40, 41);
--alert-error-border: #e06470;
--alert-success-background: rgb(34, 48, 36);
--alert-success-border: #28a745;
--alert-info-background: rgb(61, 57, 43);
--alert-info-border: #ffdf70;
}

:root[data-theme="light"] {
--alert-error-background: rgb(248, 235, 237);
--alert-error-border: #d73847;
--alert-success-background: rgb(234, 242, 235);
--alert-success-border: #1c8234;
--alert-info-background: rgb(247, 238, 231);
--alert-info-border: #bf5208;
}

.alert {
padding: 8px 36px;
border-radius: 4px;
border-left: 4px solid;
position: relative;
width: 80vw;
box-shadow: var(--ifm-alert-shadow);

&.info {
border-color: var(--alert-info-border);
background-color: var(--alert-info-background);

.icon {
color: var(--alert-info-border);
}
}

&.success {
border-color: var(--alert-success-border);
background-color: var(--alert-success-background);

.icon {
color: var(--alert-success-border);
}
}

&.error {
border-color: var(--alert-error-border);
background-color: var(--alert-error-background);

.icon {
color: var(--alert-error-border);
}
}

.icon {
position: absolute;
left: 5px;
top: 8px;
}

.closeButton {
cursor: pointer;
display: block;
height: 16px;
line-height: 1;
position: absolute;
top: 10px;
right: 10px;

.closeIcon {
min-width: 16px;
width: 16px;
min-height: 16px;
height: 16px;
}
}
}

.alertTitle {
font-weight: 500 !important;
margin: 0;
}

.alertText {
margin: 0;
}
6 changes: 6 additions & 0 deletions src/components/Alert/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/components/Alert/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions src/components/Alert/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from "react";
import { positions, types } from "react-alert";
import clsx from "clsx";
import CloseImg from "./close.svg";
import InfoImg from "./info.svg";
import SuccessImg from "./success.svg";
import ErrorImg from "./error.svg";
import Text from "@site/src/components/Text";
import styles from "./alert.module.scss";

export const options = {
position: positions.TOP_CENTER,
timeout: 10000,
offset: "5px",
containerStyle: {
zIndex: 1000,
marginTop: 64,
},
};

export const AlertTemplate = ({ style, options, message, close }) => (
<div
style={style}
className={clsx(
styles.alert,
options.type === types.INFO && styles.info,
options.type === types.SUCCESS && styles.success,
options.type === types.ERROR && styles.error,
)}
>
{options.type === types.INFO && <InfoImg className={styles.icon} />}
{options.type === types.SUCCESS && <SuccessImg className={styles.icon} />}
{options.type === types.ERROR && <ErrorImg className={styles.icon} />}
{message}
<span role="button" onClick={close} className={styles.closeButton}>
<CloseImg className={styles.closeIcon} />
</span>
</div>
);

export const AlertTitle = ({
children,
}: {
children: string | React.ReactElement;
}) => (
<Text as="p" className={styles.alertTitle}>
{children}
</Text>
);

export const AlertText = ({
children,
}: {
children: string | React.ReactElement;
}) => (
<Text as="p" className={styles.alertText}>
{children}
</Text>
);
4 changes: 4 additions & 0 deletions src/components/Alert/info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/components/Alert/success.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading