Skip to content

Commit 4db208f

Browse files
Vlad LobachovTrofimovAnton85Magne Cedric
authored
Unified login (#1481)
* ACT-1390: Faucet page routing * ACT-1387, ACT-1387: Tabs, Button ACT-1388: Component: Button ACT-1387: Component: Tabs * ACT-1393 Component: Typography (#1410) * ACT-1393 Component: Typography * ACT-1386 Component: Accordion * Faucet alerts + prettier (#1423) * ACT-1394 Component: Alert + Prettier whole project * feat(faucet): act-1391 - added badge component (#1425) * feat(faucet): act-1391 - added badge component * feat(faucet): act-1391 - fix for css vars * feat(docs): act-1392 - added table component (#1439) * eslint + prettier fix for src (#1440) * ACT-1473 Assemble faucet page (#1448) ACT-1473 Assemble faucet page (#1448) * ACT-1473 Assemble faucet page * ESlint + Prettier * Improve types and aliases resolving * feat(m-login): adding full login flow * feat(m-login): fix build * feat(m-login): fixing link unfurling * feat(m-login): implementing multiple wallet pairing * feat(mm-login): updating dashboard preview url * feat(mm-login): updating dashboard preview url * feat(mm-login): hardcode dashboard preview url * Faucet maintenance mode (#1475) Faucet maintenance mode (#1475) * Faucet supports MM login flow * Handle MetaMask sdk using common sdk * Handle auth Infura connection * Faucet Hero img * Fix SSR * Fix BrowserOnly * Handle stale data * Get transactions * Unified login interface for MM Docs via MM Wallet * Unified login interface for MM Docs via MM Wallet * Unified login interface for MM Docs via MM Wallet * Unified login interface for MM Docs via MM Wallet * feat(unified-login): update unified login * feat(unified-login): update unified login flow * feat(unified-login): update unified login flow * feat(unified-login): update unified login flow * feat(unified-login): update unified login flow * feat(unified-login): add feature flag to manage login button * feat(unified-login): fix bug on refreshing page * feat(unified-login): fix dahboard url * feat(unified-login): fix dahboard url * feat(unified-login): fix dahboard url * feat(unified-login): fix dahboard url * feat(unified-login): fix dahboard url * feat(unified-login): fix dahboard url * feat(unified-login): fix dahboard url * feat(unified-login): update dahboard_url function call * Improve ui and ux * clear data on disconnect * Small bugfixes * feat(unified-login): add connection success modal * feat(unified-login): upgrade metamask sdk * feat(mm-login): fix merge and improve login when multiple infura account or no account * feat(mm-login): fix merge conflicts * feat(mm-login): fix yarn install * feat(mm-login): update profile sync sdk package * feat(mm-login): fix merge * Fix useDoc hook * feat(mm-login): fix merge and package version * Fix metamask provider value * feat(mm-login): fix sdk initialization * fix package.json * feat(mm-login): add projects box on new-reference page * feat(mm-login): add projects box on new-reference page * feat(mm-login): conosle log test * feat(mm-login): fix pathname testing * feat(unified-login): fix css lightmode --------- Co-authored-by: Vlad Lo. <vlad.lobachov-ext@> Co-authored-by: TrofimovAnton85 <98453427+TrofimovAnton85@users.noreply.github.com> Co-authored-by: Magne Cedric <cedric.magne@consensys.net>
1 parent 13123fc commit 4db208f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+7697
-3545
lines changed

docusaurus.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

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

3334
customFields: {
3435
LD_CLIENT_ID: process.env.LD_CLIENT_ID,
36+
VERCEL_ENV: process.env.VERCEL_ENV,
37+
DASHBOARD_PREVIEW_URL: process.env.DASHBOARD_PREVIEW_URL,
3538
SENTRY_KEY: process.env.SENTRY_KEY,
3639
},
3740

@@ -89,6 +92,7 @@ const config = {
8992
],
9093
],
9194
plugins: [
95+
"docusaurus-plugin-sass",
9296
[
9397
"@docusaurus/plugin-content-docs",
9498
{
@@ -206,6 +210,11 @@ const config = {
206210
label: "User support",
207211
position: "right",
208212
},
213+
{
214+
type: "custom-navbarWallet",
215+
position: "right",
216+
includeUrl: REF_ALLOW_LOGIN_PATH,
217+
},
209218
/* Language drop down
210219
{
211220
type: "localeDropdown",

package-lock.json

Lines changed: 3515 additions & 1517 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "(MIT OR Apache-2.0)",
66
"scripts": {
77
"docusaurus": "docusaurus",
8-
"start": "docusaurus start",
8+
"start": "docusaurus start -p 3003",
99
"build": "docusaurus build",
1010
"swizzle": "docusaurus swizzle",
1111
"deploy": "docusaurus deploy",
@@ -19,7 +19,7 @@
1919
"lint:js": "eslint . --ext js,jsx,ts,tsx --max-warnings=5",
2020
"lint:style": "stylelint \"**/*.css\" --fix",
2121
"lint:fix": "npm run lint:js -- --fix",
22-
"format": "prettier --write '{blog,docs,src,static}/**/*.{md,mdx,ts,js,tsx,jsx,json}'"
22+
"format": "prettier --write '{blog,docs,src}/**/*.{md,mdx,ts,js,tsx,jsx,json}'"
2323
},
2424
"lint-staged": {
2525
"src/**/*.{ts,js,jsx,tsx}": "npm run lint:fix",
@@ -31,35 +31,43 @@
3131
"@apidevtools/json-schema-ref-parser": "^11.6.4",
3232
"@docusaurus/core": "^3.0.0",
3333
"@docusaurus/plugin-content-docs": "^3.0.0",
34+
"@docusaurus/plugin-content-pages": "^3.4.0",
3435
"@docusaurus/theme-common": "^3.0.0",
3536
"@docusaurus/theme-mermaid": "^3.0.0",
3637
"@intercom/messenger-js-sdk": "^0.0.11",
3738
"@mdx-js/react": "^3.0.0",
3839
"@metamask/design-tokens": "^1.11.1",
3940
"@metamask/docusaurus-openrpc": "^0.4.1",
40-
"@metamask/sdk": "^0.26.5",
41-
"@metamask/sdk-react": "^0.26.5",
41+
"@metamask/profile-sync-controller": "^0.6.0",
42+
"@metamask/sdk": "^0.28.1",
4243
"@rjsf/core": "^5.18.4",
4344
"@rjsf/utils": "^5.18.4",
4445
"@rjsf/validator-ajv8": "^5.18.4",
4546
"@sentry/browser": "^8.30.0",
47+
"@types/react": "^18.3.3",
4648
"clsx": "^1.2.1",
49+
"docusaurus-plugin-sass": "^0.2.5",
4750
"docusaurus-plugin-segment": "^1.0.4",
4851
"dotenv": "^16.4.5",
52+
"ethers": "^6.13.2",
4953
"js-cookie": "^3.0.5",
54+
"jsonwebtoken": "^9.0.2",
5055
"launchdarkly-js-client-sdk": "^3.3.0",
5156
"lodash.debounce": "^4.0.8",
5257
"lodash.isobject": "^3.0.2",
5358
"node-polyfill-webpack-plugin": "^2.0.1",
54-
"prettier": "^3.0.0",
59+
"prettier": "^3.3.3",
5560
"prism-react-renderer": "^2.1.0",
5661
"react": "^18.0.0",
62+
"react-alert": "^7.0.3",
5763
"react-dom": "^18.0.0",
5864
"react-dropdown-select": "^4.11.2",
65+
"react-modal": "^3.16.1",
5966
"react-player": "^2.13.0",
6067
"react-tippy": "^1.4.0",
6168
"remark-codesandbox": "^0.10.1",
62-
"remark-docusaurus-tabs": "^0.2.0"
69+
"remark-docusaurus-tabs": "^0.2.0",
70+
"sass": "^1.77.6"
6371
},
6472
"devDependencies": {
6573
"@docusaurus/eslint-plugin": "^3.0.0",
@@ -69,12 +77,14 @@
6977
"@docusaurus/types": "^3.4.0",
7078
"@lavamoat/allow-scripts": "^3.0.4",
7179
"@tsconfig/docusaurus": "^1.0.5",
80+
"@types/react-alert": "^7.0.6",
81+
"@types/react-modal": "^3.16.3",
7282
"@typescript-eslint/parser": "^7.12.0",
7383
"eslint-plugin-react": "^7.34.2",
7484
"stylelint": "^15.0.0 ",
7585
"stylelint-config-standard": "^34.0.0",
7686
"tsc-files": "^1.1.4",
77-
"typescript": "^5.4.5"
87+
"typescript": "^5.5.4"
7888
},
7989
"browserslist": {
8090
"production": [
@@ -112,7 +122,9 @@
112122
"@metamask/sdk-react>@metamask/sdk>eciesjs>secp256k1": false,
113123
"@metamask/sdk>@metamask/sdk-communication-layer>bufferutil": false,
114124
"@metamask/sdk>@metamask/sdk-communication-layer>utf-8-validate": false,
115-
"@metamask/sdk>eciesjs>secp256k1": false
125+
"@metamask/sdk>eciesjs>secp256k1": false,
126+
"ethers>ws>bufferutil": false,
127+
"ethers>ws>utf-8-validate": false
116128
}
117129
}
118130
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
:root[data-theme="dark"] {
2+
--alert-error-background: rgb(53, 40, 41);
3+
--alert-error-border: #e06470;
4+
--alert-success-background: rgb(34, 48, 36);
5+
--alert-success-border: #28a745;
6+
--alert-info-background: rgb(61, 57, 43);
7+
--alert-info-border: #ffdf70;
8+
}
9+
10+
:root[data-theme="light"] {
11+
--alert-error-background: rgb(248, 235, 237);
12+
--alert-error-border: #d73847;
13+
--alert-success-background: rgb(234, 242, 235);
14+
--alert-success-border: #1c8234;
15+
--alert-info-background: rgb(247, 238, 231);
16+
--alert-info-border: #bf5208;
17+
}
18+
19+
.alert {
20+
padding: 8px 36px;
21+
border-radius: 4px;
22+
border-left: 4px solid;
23+
position: relative;
24+
width: 80vw;
25+
box-shadow: var(--ifm-alert-shadow);
26+
27+
&.info {
28+
border-color: var(--alert-info-border);
29+
background-color: var(--alert-info-background);
30+
31+
.icon {
32+
color: var(--alert-info-border);
33+
}
34+
}
35+
36+
&.success {
37+
border-color: var(--alert-success-border);
38+
background-color: var(--alert-success-background);
39+
40+
.icon {
41+
color: var(--alert-success-border);
42+
}
43+
}
44+
45+
&.error {
46+
border-color: var(--alert-error-border);
47+
background-color: var(--alert-error-background);
48+
49+
.icon {
50+
color: var(--alert-error-border);
51+
}
52+
}
53+
54+
.icon {
55+
position: absolute;
56+
left: 5px;
57+
top: 8px;
58+
}
59+
60+
.closeButton {
61+
cursor: pointer;
62+
display: block;
63+
height: 16px;
64+
line-height: 1;
65+
position: absolute;
66+
top: 10px;
67+
right: 10px;
68+
69+
.closeIcon {
70+
min-width: 16px;
71+
width: 16px;
72+
min-height: 16px;
73+
height: 16px;
74+
}
75+
}
76+
}
77+
78+
.alertTitle {
79+
font-weight: 500 !important;
80+
margin: 0;
81+
}
82+
83+
.alertText {
84+
margin: 0;
85+
}

src/components/Alert/close.svg

Lines changed: 6 additions & 0 deletions
Loading

src/components/Alert/error.svg

Lines changed: 4 additions & 0 deletions
Loading

src/components/Alert/index.tsx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React from "react";
2+
import { positions, types } from "react-alert";
3+
import clsx from "clsx";
4+
import CloseImg from "./close.svg";
5+
import InfoImg from "./info.svg";
6+
import SuccessImg from "./success.svg";
7+
import ErrorImg from "./error.svg";
8+
import Text from "@site/src/components/Text";
9+
import styles from "./alert.module.scss";
10+
11+
export const options = {
12+
position: positions.TOP_CENTER,
13+
timeout: 10000,
14+
offset: "5px",
15+
containerStyle: {
16+
zIndex: 1000,
17+
marginTop: 64,
18+
},
19+
};
20+
21+
export const AlertTemplate = ({ style, options, message, close }) => (
22+
<div
23+
style={style}
24+
className={clsx(
25+
styles.alert,
26+
options.type === types.INFO && styles.info,
27+
options.type === types.SUCCESS && styles.success,
28+
options.type === types.ERROR && styles.error,
29+
)}
30+
>
31+
{options.type === types.INFO && <InfoImg className={styles.icon} />}
32+
{options.type === types.SUCCESS && <SuccessImg className={styles.icon} />}
33+
{options.type === types.ERROR && <ErrorImg className={styles.icon} />}
34+
{message}
35+
<span role="button" onClick={close} className={styles.closeButton}>
36+
<CloseImg className={styles.closeIcon} />
37+
</span>
38+
</div>
39+
);
40+
41+
export const AlertTitle = ({
42+
children,
43+
}: {
44+
children: string | React.ReactElement;
45+
}) => (
46+
<Text as="p" className={styles.alertTitle}>
47+
{children}
48+
</Text>
49+
);
50+
51+
export const AlertText = ({
52+
children,
53+
}: {
54+
children: string | React.ReactElement;
55+
}) => (
56+
<Text as="p" className={styles.alertText}>
57+
{children}
58+
</Text>
59+
);

src/components/Alert/info.svg

Lines changed: 4 additions & 0 deletions
Loading

src/components/Alert/success.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)