@mezo-org/passport 0.16.0-dev.0 → 0.16.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/auth.d.ts +9 -0
- package/dist/src/api/auth.d.ts.map +1 -1
- package/dist/src/api/auth.js +7 -0
- package/dist/src/api/auth.js.map +1 -1
- package/dist/src/config.d.ts +3 -4
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +9 -13
- package/dist/src/config.js.map +1 -1
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +2 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/useAcceptDocuments.d.ts +18 -0
- package/dist/src/hooks/useAcceptDocuments.d.ts.map +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.d.ts +11 -11
- package/dist/src/hooks/useAuthenticateWithWallet.js +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.js.map +1 -1
- package/dist/src/hooks/useBorrowData.js +1 -1
- package/dist/src/hooks/useBorrowData.js.map +1 -1
- package/dist/src/hooks/useCollateralPrice.js +1 -1
- package/dist/src/hooks/useCollateralPrice.js.map +1 -1
- package/dist/src/hooks/useCreateAccount.d.ts +18 -0
- package/dist/src/hooks/useCreateAccount.d.ts.map +1 -1
- package/dist/src/hooks/useCreateAccount.js +1 -1
- package/dist/src/hooks/useCreateAccount.js.map +1 -1
- package/dist/src/hooks/useLinkAccount.js +1 -1
- package/dist/src/hooks/useLinkAccount.js.map +1 -1
- package/dist/src/hooks/useSignInWithWallet.d.ts +11 -11
- package/dist/src/hooks/useSignUpWithWallet.d.ts +11 -11
- package/dist/src/hooks/useTokensBalances.d.ts.map +1 -1
- package/dist/src/hooks/useTokensBalances.js +2 -10
- package/dist/src/hooks/useTokensBalances.js.map +1 -1
- package/dist/src/hooks/useUpdateMezoId.d.ts +18 -0
- package/dist/src/hooks/useUpdateMezoId.d.ts.map +1 -1
- package/dist/src/hooks/useUpdateUserProfile.d.ts +171 -0
- package/dist/src/hooks/useUpdateUserProfile.d.ts.map +1 -0
- package/dist/src/hooks/useUpdateUserProfile.js +19 -0
- package/dist/src/hooks/useUpdateUserProfile.js.map +1 -0
- package/dist/src/hooks/useWalletAccount.d.ts +3 -6
- package/dist/src/hooks/useWalletAccount.d.ts.map +1 -1
- package/dist/src/hooks/useWalletAccount.js +6 -4
- package/dist/src/hooks/useWalletAccount.js.map +1 -1
- package/dist/src/hooks/useWatchTransferEvents.d.ts.map +1 -1
- package/dist/src/hooks/useWatchTransferEvents.js +0 -1
- package/dist/src/hooks/useWatchTransferEvents.js.map +1 -1
- package/dist/src/index.d.ts +1 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/contracts/index.d.ts +1 -1
- package/dist/src/lib/contracts/index.d.ts.map +1 -1
- package/dist/src/lib/contracts/index.js +0 -3
- package/dist/src/lib/contracts/index.js.map +1 -1
- package/dist/src/stores/dropdownStore.d.ts +2 -1
- package/dist/src/stores/dropdownStore.d.ts.map +1 -1
- package/dist/src/stores/dropdownStore.js +1 -0
- package/dist/src/stores/dropdownStore.js.map +1 -1
- package/dist/src/utils/assets.d.ts +0 -15
- package/dist/src/utils/assets.d.ts.map +1 -1
- package/dist/src/utils/assets.js +0 -13
- package/dist/src/utils/assets.js.map +1 -1
- package/dist/src/utils/validation.d.ts +13 -0
- package/dist/src/utils/validation.d.ts.map +1 -0
- package/dist/src/utils/validation.js +34 -0
- package/dist/src/utils/validation.js.map +1 -0
- package/dist/src/utils/validation.test.d.ts +2 -0
- package/dist/src/utils/validation.test.d.ts.map +1 -0
- package/dist/src/utils/validation.test.js +63 -0
- package/dist/src/utils/validation.test.js.map +1 -0
- package/package.json +10 -9
- package/src/api/auth.ts +22 -0
- package/src/config.ts +16 -26
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useAuthenticateWithWallet.ts +1 -1
- package/src/hooks/useBorrowData.ts +1 -1
- package/src/hooks/useCollateralPrice.ts +1 -1
- package/src/hooks/useCreateAccount.ts +1 -1
- package/src/hooks/useLinkAccount.ts +1 -1
- package/src/hooks/useTokensBalances.ts +1 -10
- package/src/hooks/useUpdateUserProfile.ts +34 -0
- package/src/hooks/useWalletAccount.ts +15 -10
- package/src/hooks/useWatchTransferEvents.ts +0 -1
- package/src/index.ts +0 -2
- package/src/lib/contracts/index.ts +0 -4
- package/src/stores/dropdownStore.ts +1 -0
- package/src/utils/assets.ts +0 -14
- package/src/utils/validation.test.ts +97 -0
- package/src/utils/validation.ts +35 -0
- package/dist/src/assets/DefaultAvatar.d.ts +0 -5
- package/dist/src/assets/DefaultAvatar.d.ts.map +0 -1
- package/dist/src/assets/DefaultAvatar.js +0 -21
- package/dist/src/assets/DefaultAvatar.js.map +0 -1
- package/dist/src/components/Dropdown/ConnectedTrigger.d.ts +0 -8
- package/dist/src/components/Dropdown/ConnectedTrigger.d.ts.map +0 -1
- package/dist/src/components/Dropdown/ConnectedTrigger.js +0 -39
- package/dist/src/components/Dropdown/ConnectedTrigger.js.map +0 -1
- package/dist/src/components/Dropdown/Content.d.ts +0 -8
- package/dist/src/components/Dropdown/Content.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Content.js +0 -27
- package/dist/src/components/Dropdown/Content.js.map +0 -1
- package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts +0 -7
- package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts.map +0 -1
- package/dist/src/components/Dropdown/DisconnectedTrigger.js +0 -13
- package/dist/src/components/Dropdown/DisconnectedTrigger.js.map +0 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +0 -23
- package/dist/src/components/Dropdown/Dropdown.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Dropdown.js +0 -45
- package/dist/src/components/Dropdown/Dropdown.js.map +0 -1
- package/dist/src/components/Dropdown/ListingItem.d.ts +0 -14
- package/dist/src/components/Dropdown/ListingItem.d.ts.map +0 -1
- package/dist/src/components/Dropdown/ListingItem.js +0 -42
- package/dist/src/components/Dropdown/ListingItem.js.map +0 -1
- package/dist/src/components/Dropdown/NestedViewLayout.d.ts +0 -8
- package/dist/src/components/Dropdown/NestedViewLayout.d.ts.map +0 -1
- package/dist/src/components/Dropdown/NestedViewLayout.js +0 -32
- package/dist/src/components/Dropdown/NestedViewLayout.js.map +0 -1
- package/dist/src/components/Dropdown/Receive/Receive.d.ts +0 -4
- package/dist/src/components/Dropdown/Receive/Receive.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Receive/Receive.js +0 -64
- package/dist/src/components/Dropdown/Receive/Receive.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts +0 -4
- package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountAddressActions.js +0 -49
- package/dist/src/components/Dropdown/Root/AccountAddressActions.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts +0 -6
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountBalance.js +0 -32
- package/dist/src/components/Dropdown/Root/AccountBalance.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts +0 -6
- package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountBtcListing.js +0 -28
- package/dist/src/components/Dropdown/Root/AccountBtcListing.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountError.d.ts +0 -8
- package/dist/src/components/Dropdown/Root/AccountError.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountError.js +0 -17
- package/dist/src/components/Dropdown/Root/AccountError.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts +0 -4
- package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountMusdListing.js +0 -21
- package/dist/src/components/Dropdown/Root/AccountMusdListing.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts +0 -8
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js +0 -43
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js.map +0 -1
- package/dist/src/components/Dropdown/Root/Root.d.ts +0 -8
- package/dist/src/components/Dropdown/Root/Root.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/Root.js +0 -45
- package/dist/src/components/Dropdown/Root/Root.js.map +0 -1
- package/dist/src/components/Dropdown/Root/WalletAddress.d.ts +0 -4
- package/dist/src/components/Dropdown/Root/WalletAddress.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/WalletAddress.js +0 -66
- package/dist/src/components/Dropdown/Root/WalletAddress.js.map +0 -1
- package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts +0 -6
- package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js +0 -88
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js.map +0 -1
- package/dist/src/components/Dropdown/SlotNumber.d.ts +0 -19
- package/dist/src/components/Dropdown/SlotNumber.d.ts.map +0 -1
- package/dist/src/components/Dropdown/SlotNumber.js +0 -67
- package/dist/src/components/Dropdown/SlotNumber.js.map +0 -1
- package/dist/src/components/Dropdown/TestnetTopBanner.d.ts +0 -3
- package/dist/src/components/Dropdown/TestnetTopBanner.d.ts.map +0 -1
- package/dist/src/components/Dropdown/TestnetTopBanner.js +0 -14
- package/dist/src/components/Dropdown/TestnetTopBanner.js.map +0 -1
- package/dist/src/components/Dropdown/index.d.ts +0 -3
- package/dist/src/components/Dropdown/index.d.ts.map +0 -1
- package/dist/src/components/Dropdown/index.js +0 -2
- package/dist/src/components/Dropdown/index.js.map +0 -1
- package/dist/src/components/index.d.ts +0 -2
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/index.js +0 -2
- package/dist/src/components/index.js.map +0 -1
- package/dist/src/lib/contracts/artifacts/MEZO.json +0 -428
- package/src/assets/DefaultAvatar.tsx +0 -74
- package/src/components/Dropdown/ConnectedTrigger.tsx +0 -76
- package/src/components/Dropdown/Content.tsx +0 -53
- package/src/components/Dropdown/DisconnectedTrigger.tsx +0 -36
- package/src/components/Dropdown/Dropdown.tsx +0 -100
- package/src/components/Dropdown/ListingItem.tsx +0 -176
- package/src/components/Dropdown/NestedViewLayout.tsx +0 -87
- package/src/components/Dropdown/README.md +0 -41
- package/src/components/Dropdown/Receive/Receive.tsx +0 -144
- package/src/components/Dropdown/Root/AccountAddressActions.tsx +0 -99
- package/src/components/Dropdown/Root/AccountBalance.tsx +0 -69
- package/src/components/Dropdown/Root/AccountBtcListing.tsx +0 -53
- package/src/components/Dropdown/Root/AccountError.tsx +0 -34
- package/src/components/Dropdown/Root/AccountMusdListing.tsx +0 -45
- package/src/components/Dropdown/Root/AccountOtherAssets.tsx +0 -85
- package/src/components/Dropdown/Root/Root.tsx +0 -77
- package/src/components/Dropdown/Root/WalletAddress.tsx +0 -123
- package/src/components/Dropdown/Root/WelcomeBlock.tsx +0 -173
- package/src/components/Dropdown/SlotNumber.tsx +0 -131
- package/src/components/Dropdown/TestnetTopBanner.tsx +0 -32
- package/src/components/Dropdown/index.ts +0 -2
- package/src/components/index.ts +0 -1
- package/src/lib/contracts/artifacts/MEZO.json +0 -428
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { validateEmail, validateTelegram } from "./validation"
|
|
2
|
+
|
|
3
|
+
describe("validateEmail", () => {
|
|
4
|
+
it("returns null for empty string", () => {
|
|
5
|
+
expect(validateEmail("")).toBeNull()
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
it("returns null for valid email", () => {
|
|
9
|
+
expect(validateEmail("user@example.com")).toBeNull()
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it("returns null for valid email with subdomain", () => {
|
|
13
|
+
expect(validateEmail("user@mail.example.com")).toBeNull()
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it("returns null for valid email with plus addressing", () => {
|
|
17
|
+
expect(validateEmail("user+tag@example.com")).toBeNull()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it("returns error for email without @", () => {
|
|
21
|
+
expect(validateEmail("userexample.com")).toBe(
|
|
22
|
+
"Please enter a valid email address",
|
|
23
|
+
)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it("returns error for email without domain", () => {
|
|
27
|
+
expect(validateEmail("user@")).toBe("Please enter a valid email address")
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it("returns error for email without TLD", () => {
|
|
31
|
+
expect(validateEmail("user@example")).toBe(
|
|
32
|
+
"Please enter a valid email address",
|
|
33
|
+
)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it("returns error for email with spaces", () => {
|
|
37
|
+
expect(validateEmail("user @example.com")).toBe(
|
|
38
|
+
"Please enter a valid email address",
|
|
39
|
+
)
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
describe("validateTelegram", () => {
|
|
44
|
+
it("returns null for empty string", () => {
|
|
45
|
+
expect(validateTelegram("")).toBeNull()
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it("returns null for valid handle without @", () => {
|
|
49
|
+
expect(validateTelegram("username")).toBeNull()
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it("returns null for valid handle with @", () => {
|
|
53
|
+
expect(validateTelegram("@username")).toBeNull()
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it("returns null for handle with numbers", () => {
|
|
57
|
+
expect(validateTelegram("user123")).toBeNull()
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it("returns null for handle with underscores", () => {
|
|
61
|
+
expect(validateTelegram("user_name")).toBeNull()
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it("returns null for exactly 5 character handle", () => {
|
|
65
|
+
expect(validateTelegram("abcde")).toBeNull()
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it("returns error for handle shorter than 5 characters", () => {
|
|
69
|
+
expect(validateTelegram("abcd")).toBe(
|
|
70
|
+
"Telegram handle must be at least 5 characters",
|
|
71
|
+
)
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it("returns error for handle with @ that is too short", () => {
|
|
75
|
+
expect(validateTelegram("@abcd")).toBe(
|
|
76
|
+
"Telegram handle must be at least 5 characters",
|
|
77
|
+
)
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
it("returns error for handle with special characters", () => {
|
|
81
|
+
expect(validateTelegram("user-name")).toBe(
|
|
82
|
+
"Telegram handle can only contain letters, numbers, and underscores",
|
|
83
|
+
)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it("returns error for handle with spaces", () => {
|
|
87
|
+
expect(validateTelegram("user name")).toBe(
|
|
88
|
+
"Telegram handle can only contain letters, numbers, and underscores",
|
|
89
|
+
)
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it("returns error for handle with dots", () => {
|
|
93
|
+
expect(validateTelegram("user.name")).toBe(
|
|
94
|
+
"Telegram handle can only contain letters, numbers, and underscores",
|
|
95
|
+
)
|
|
96
|
+
})
|
|
97
|
+
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Validates an email address.
|
|
5
|
+
* @param value - The email address to validate
|
|
6
|
+
* @returns An error message if invalid, null if valid or empty
|
|
7
|
+
*/
|
|
8
|
+
export function validateEmail(value: string): string | null {
|
|
9
|
+
if (!value) {
|
|
10
|
+
return null
|
|
11
|
+
}
|
|
12
|
+
if (!EMAIL_REGEX.test(value)) {
|
|
13
|
+
return "Please enter a valid email address"
|
|
14
|
+
}
|
|
15
|
+
return null
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Validates a Telegram handle.
|
|
20
|
+
* @param value - The Telegram handle to validate (with or without @ prefix)
|
|
21
|
+
* @returns An error message if invalid, null if valid or empty
|
|
22
|
+
*/
|
|
23
|
+
export function validateTelegram(value: string): string | null {
|
|
24
|
+
if (!value) {
|
|
25
|
+
return null
|
|
26
|
+
}
|
|
27
|
+
const handle = value.startsWith("@") ? value.slice(1) : value
|
|
28
|
+
if (handle.length < 5) {
|
|
29
|
+
return "Telegram handle must be at least 5 characters"
|
|
30
|
+
}
|
|
31
|
+
if (!/^[a-zA-Z0-9_]+$/.test(handle)) {
|
|
32
|
+
return "Telegram handle can only contain letters, numbers, and underscores"
|
|
33
|
+
}
|
|
34
|
+
return null
|
|
35
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultAvatar.d.ts","sourceRoot":"","sources":["../../../src/assets/DefaultAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAmB,MAAM,OAAO,CAAA;AAoEvC,iBAAS,sBAAsB,CAAC,KAAK,EAAE,UAAU,qBAEhD;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Block } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React from "react";
|
|
3
|
-
function DefaultAvatar(props) {
|
|
4
|
-
return (React.createElement("svg", { viewBox: "0 0 214 214", fill: "none", ...props },
|
|
5
|
-
React.createElement("rect", { y: "-0.478027", width: "166.379", height: "81.7091", fill: "#FF004D" }),
|
|
6
|
-
React.createElement("rect", { x: "166", y: "-0.478027", width: "48", height: "82", fill: "black" }),
|
|
7
|
-
React.createElement("rect", { x: "166.379", y: "81.231", width: "24.1044", height: "132.291", fill: "#DFFF80" }),
|
|
8
|
-
React.createElement("rect", { x: "118.758", y: "81.231", width: "24.1044", height: "132.291", fill: "#FF5500" }),
|
|
9
|
-
React.createElement("rect", { x: "71.1372", y: "81.231", width: "24.1044", height: "132.291", fill: "#5A59A7" }),
|
|
10
|
-
React.createElement("rect", { x: "23.5166", y: "81.231", width: "24.1044", height: "132.291", fill: "#47B5FF" }),
|
|
11
|
-
React.createElement("rect", { y: "81.231", width: "23.5165", height: "132.291", fill: "#A3C238" }),
|
|
12
|
-
React.createElement("rect", { x: "190.483", y: "81.231", width: "23.5165", height: "132.291", fill: "#6E6E70" }),
|
|
13
|
-
React.createElement("rect", { x: "142.863", y: "81.231", width: "23.5165", height: "132.291", fill: "#0A3C01" }),
|
|
14
|
-
React.createElement("rect", { x: "95.2417", y: "81.231", width: "23.5165", height: "132.291", fill: "#F2A91F" }),
|
|
15
|
-
React.createElement("rect", { x: "47.6211", y: "81.231", width: "23.5165", height: "132.291", fill: "#6B3D01" })));
|
|
16
|
-
}
|
|
17
|
-
function DefaultAvatarComponent(props) {
|
|
18
|
-
return React.createElement(Block, { as: DefaultAvatar, ...props });
|
|
19
|
-
}
|
|
20
|
-
export default DefaultAvatarComponent;
|
|
21
|
-
//# sourceMappingURL=DefaultAvatar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultAvatar.js","sourceRoot":"","sources":["../../../src/assets/DefaultAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAc,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,SAAS,aAAa,CAAC,KAA8B;IACnD,OAAO,CACL,6BAAK,OAAO,EAAC,aAAa,EAAC,IAAI,EAAC,MAAM,KAAK,KAAK;QAC9C,8BAAM,CAAC,EAAC,WAAW,EAAC,KAAK,EAAC,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS,GAAG;QACtE,8BAAM,CAAC,EAAC,KAAK,EAAC,CAAC,EAAC,WAAW,EAAC,KAAK,EAAC,I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AsB,CAAC,KAAiB;IAC/C,OAAO,oBAAC,KAAK,IAAC,EAAE,EAAE,aAAa,KAAM,KAAK,GAAI,CAAA;AAChD,CAAC;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { ReactNode } from "react";
|
|
3
|
-
declare const ConnectedTrigger: React.ForwardRefExoticComponent<Omit<ButtonProps, "size" | "children"> & {
|
|
4
|
-
avatar: ReactNode;
|
|
5
|
-
size?: "medium" | "large";
|
|
6
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
export default ConnectedTrigger;
|
|
8
|
-
//# sourceMappingURL=ConnectedTrigger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectedTrigger.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/ConnectedTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAgB,MAAM,qBAAqB,CAAA;AAC9E,OAAO,KAAK,EAAE,EAAc,SAAS,EAAW,MAAM,OAAO,CAAA;AAO7D,QAAA,MAAM,gBAAgB;YAJZ,SAAS;WACV,QAAQ,GAAG,OAAO;2CAoE1B,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Block, Button, useStyletron } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { forwardRef, useMemo } from "react";
|
|
3
|
-
const ConnectedTrigger = forwardRef((props, ref) => {
|
|
4
|
-
const { onClick, avatar, size = "medium", ...restProps } = props;
|
|
5
|
-
const [, theme] = useStyletron();
|
|
6
|
-
const avatarSize = useMemo(() => {
|
|
7
|
-
const sizeMap = {
|
|
8
|
-
medium: theme.sizing.scale950,
|
|
9
|
-
large: theme.sizing.scale1400,
|
|
10
|
-
};
|
|
11
|
-
return sizeMap[size];
|
|
12
|
-
}, [theme, size]);
|
|
13
|
-
const buttonPadding = useMemo(() => {
|
|
14
|
-
const paddingMap = {
|
|
15
|
-
medium: theme.sizing.scale0,
|
|
16
|
-
large: theme.sizing.scale100,
|
|
17
|
-
};
|
|
18
|
-
return paddingMap[size];
|
|
19
|
-
}, [theme, size]);
|
|
20
|
-
return (React.createElement(Button, { overrides: {
|
|
21
|
-
BaseButton: {
|
|
22
|
-
props: { ref, ...restProps },
|
|
23
|
-
style: {
|
|
24
|
-
borderRadius: "100%",
|
|
25
|
-
overflow: "hidden",
|
|
26
|
-
padding: buttonPadding,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
}, onClick: onClick }, typeof avatar === "string" ? (React.createElement(Block, { width: avatarSize, height: avatarSize, as: "img", src: avatar, alt: "" })) : (React.createElement(Block, { width: avatarSize, height: avatarSize, overrides: {
|
|
30
|
-
Block: {
|
|
31
|
-
style: {
|
|
32
|
-
borderRadius: "100%",
|
|
33
|
-
overflow: "hidden",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
} }, avatar))));
|
|
37
|
-
});
|
|
38
|
-
export default ConnectedTrigger;
|
|
39
|
-
//# sourceMappingURL=ConnectedTrigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectedTrigger.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/ConnectedTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC9E,OAAO,KAAK,EAAE,EAAE,UAAU,EAAa,OAAO,EAAE,MAAM,OAAO,CAAA;AAO7D,MAAM,gBAAgB,GAAG,UAAU,CACjC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IAEhE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,E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;aACF;SACF,IAEA,MAAM,CACD,CACT,CACM,CACV,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/Content.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAMxC,KAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC,CAAA;AAED,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,qBAsCnC;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Block, useStyletron } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { useEffect } from "react";
|
|
3
|
-
import useDropdownStore, { DropdownView } from "../../stores/dropdownStore";
|
|
4
|
-
import Root from "./Root/Root";
|
|
5
|
-
import Receive from "./Receive/Receive";
|
|
6
|
-
import TestnetTopBanner from "./TestnetTopBanner";
|
|
7
|
-
function Content(props) {
|
|
8
|
-
const { onSignOut, onOtherAssetsClick } = props;
|
|
9
|
-
const [_, theme] = useStyletron();
|
|
10
|
-
const currentView = useDropdownStore((state) => state.view);
|
|
11
|
-
const setView = useDropdownStore((state) => state.setView);
|
|
12
|
-
useEffect(() => () => {
|
|
13
|
-
setView(DropdownView.ROOT);
|
|
14
|
-
}, [setView]);
|
|
15
|
-
return (React.createElement(Block, { display: "inline-flex", flexDirection: "column", backgroundColor: theme.colors.backgroundPrimary, width: "100%", overrides: {
|
|
16
|
-
Block: {
|
|
17
|
-
style: {
|
|
18
|
-
boxSizing: "border-box",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
} },
|
|
22
|
-
React.createElement(TestnetTopBanner, null),
|
|
23
|
-
currentView === DropdownView.ROOT && (React.createElement(Root, { onSignOut: onSignOut, onOtherAssetsClick: onOtherAssetsClick })),
|
|
24
|
-
currentView === DropdownView.RECEIVE && React.createElement(Receive, null)));
|
|
25
|
-
}
|
|
26
|
-
export default Content;
|
|
27
|
-
//# sourceMappingURL=Content.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,gBAAgB,EAAE,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,IAAI,MAAM,aAAa,CAAA;AAC9B,OAAO,OAAO,MAAM,mBAAmB,CAAA;AACvC,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AAOjD,SAAS,OAAO,CAAC,KAAmB;IAClC,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAA;IAE/C,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEjC,MAAM,WAAW,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3D,MAAM,OAAO,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAE1D,SAAS,CACP,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAA;IAED,OAAO,CACL,oBAAC,KAAK,IACJ,OAAO,EAAC,aAAa,EACrB,aAAa,EAAC,QAAQ,EACtB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAC/C,KAAK,EAAC,MAAM,EACZ,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,SAAS,EAAE,YAAY;iBACxB;aACF;SACF;QAED,oBAAC,gBAAgB,OAAG;QAEnB,WAAW,KAAK,YAAY,CAAC,IAAI,IAAI,CACpC,oBAAC,IAAI,IAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,kBAAkB,GAAI,CACvE;QAEA,WAAW,KAAK,YAAY,CAAC,OAAO,IAAI,oBAAC,OAAO,OAAG,CAC9C,CACT,CAAA;AACH,CAAC;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React from "react";
|
|
3
|
-
declare const DisconnectedTrigger: React.ForwardRefExoticComponent<Omit<ButtonProps, "children"> & {
|
|
4
|
-
children: string;
|
|
5
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
export default DisconnectedTrigger;
|
|
7
|
-
//# sourceMappingURL=DisconnectedTrigger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisconnectedTrigger.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/DisconnectedTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,WAAW,EAAyB,MAAM,qBAAqB,CAAA;AAChF,OAAO,KAAqB,MAAM,OAAO,CAAA;AAMzC,QAAA,MAAM,mBAAmB;cAHb,MAAM;2CA6BhB,CAAA;AAEF,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Button, LogIn01, useStyletron } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { forwardRef } from "react";
|
|
3
|
-
const DisconnectedTrigger = forwardRef((props, ref) => {
|
|
4
|
-
const { onClick, children, ...restProps } = props;
|
|
5
|
-
const [, theme] = useStyletron();
|
|
6
|
-
return (React.createElement(Button, { startEnhancer: React.createElement(LogIn01, { color: "currentColor", size: theme.sizing.scale600 }), overrides: {
|
|
7
|
-
Root: {
|
|
8
|
-
props: { ref },
|
|
9
|
-
},
|
|
10
|
-
}, size: "small", shape: "pill", onClick: onClick, ...restProps }, children));
|
|
11
|
-
});
|
|
12
|
-
export default DisconnectedTrigger;
|
|
13
|
-
//# sourceMappingURL=DisconnectedTrigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisconnectedTrigger.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/DisconnectedTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAe,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAChF,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAMzC,MAAM,mBAAmB,GAAG,UAAU,CAGpC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IAEjD,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,OAAO,CACL,oBAAC,MAAM,IACL,aAAa,EACX,oBAAC,OAAO,IAAC,KAAK,EAAC,cAAc,EAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAI,EAE/D,SAAS,EAAE;YACT,IAAI,EAAE;gBACJ,KAAK,EAAE,EAAE,GAAG,EAAE;aACf;SACF,EACD,IAAI,EAAC,OAAO,EACZ,KAAK,EAAC,MAAM,EACZ,OAAO,EAAE,OAAO,KACZ,SAAS,IAEZ,QAAQ,CACF,CACV,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ButtonProps, StatefulPopoverProps } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export type DropdownProps = {
|
|
4
|
-
/** The callback to be called when the user clicks the sign-out button */
|
|
5
|
-
onSignOut?: () => void;
|
|
6
|
-
/** The callback to be called when the user clicks the button in sign-in state */
|
|
7
|
-
onSignIn?: () => void;
|
|
8
|
-
/** The props to be passed to the trigger button */
|
|
9
|
-
triggerProps?: {
|
|
10
|
-
signedIn?: Omit<ButtonProps, "onClick" | "size"> & {
|
|
11
|
-
size: "medium" | "large";
|
|
12
|
-
};
|
|
13
|
-
signedOut?: Omit<ButtonProps, "onClick">;
|
|
14
|
-
};
|
|
15
|
-
onOtherAssetsClick?: () => void;
|
|
16
|
-
} & Omit<StatefulPopoverProps, "children" | "content">;
|
|
17
|
-
/**
|
|
18
|
-
* Passport Dropdown component that displays user's wallet and assets information.
|
|
19
|
-
* @param {DropdownProps} props - Component props.
|
|
20
|
-
* @returns {JSX.Element}
|
|
21
|
-
*/
|
|
22
|
-
export declare function Dropdown(props: DropdownProps): React.JSX.Element;
|
|
23
|
-
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,oBAAoB,EAErB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,MAAM,MAAM,aAAa,GAAG;IAC1B,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,mDAAmD;IACnD,YAAY,CAAC,EAAE;QACb,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAAC,GAAG;YACjD,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;SACzB,CAAA;QACD,SAAS,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;KACzC,CAAA;IACD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,SAAS,CAAC,CAAA;AAEtD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAgE5C"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { StatefulPopover, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
-
import { useConnectModal } from "@rainbow-me/rainbowkit";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import DefaultAvatar from "../../assets/DefaultAvatar";
|
|
5
|
-
import ConnectedTrigger from "./ConnectedTrigger";
|
|
6
|
-
import Content from "./Content";
|
|
7
|
-
import DisconnectedTrigger from "./DisconnectedTrigger";
|
|
8
|
-
import useWalletAccount from "../../hooks/useWalletAccount";
|
|
9
|
-
import { useWatchTransferEventsForAllTokens } from "../../hooks/useWatchTransferEvents";
|
|
10
|
-
/**
|
|
11
|
-
* Passport Dropdown component that displays user's wallet and assets information.
|
|
12
|
-
* @param {DropdownProps} props - Component props.
|
|
13
|
-
* @returns {JSX.Element}
|
|
14
|
-
*/
|
|
15
|
-
export function Dropdown(props) {
|
|
16
|
-
const { placement = "bottomRight", animateOutTime = 120, onSignIn, onSignOut, overrides, triggerProps, onOtherAssetsClick, ...restProps } = props;
|
|
17
|
-
const [, theme] = useStyletron();
|
|
18
|
-
const walletAccount = useWalletAccount();
|
|
19
|
-
useWatchTransferEventsForAllTokens();
|
|
20
|
-
const { openConnectModal } = useConnectModal();
|
|
21
|
-
if (!walletAccount?.isConnected) {
|
|
22
|
-
return (React.createElement(DisconnectedTrigger
|
|
23
|
-
// If connect wallet flow is not provided it fallbacks to RainbowKit's
|
|
24
|
-
// connect modal
|
|
25
|
-
, {
|
|
26
|
-
// If connect wallet flow is not provided it fallbacks to RainbowKit's
|
|
27
|
-
// connect modal
|
|
28
|
-
onClick: onSignIn || openConnectModal, ...triggerProps?.signedOut }, "Sign in"));
|
|
29
|
-
}
|
|
30
|
-
return (React.createElement(StatefulPopover, { content: React.createElement(Content, { onSignOut: onSignOut, onOtherAssetsClick: onOtherAssetsClick }), placement: placement, animateOutTime: animateOutTime, overrides: {
|
|
31
|
-
...overrides,
|
|
32
|
-
Body: {
|
|
33
|
-
...overrides?.Body,
|
|
34
|
-
style: {
|
|
35
|
-
width: "402px",
|
|
36
|
-
borderRadius: theme.borders.radius500,
|
|
37
|
-
boxShadow: theme.lighting.shadow500,
|
|
38
|
-
overflow: "hidden",
|
|
39
|
-
...overrides?.Body?.style,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
}, ...restProps },
|
|
43
|
-
React.createElement(ConnectedTrigger, { avatar: React.createElement(DefaultAvatar, null), ...triggerProps?.signedIn })));
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEf,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,aAAa,MAAM,4BAA4B,CAAA;AACtD,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AACvD,OAAO,gBAAgB,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,kCAAkC,EAAE,MAAM,oCAAoC,CAAA;AAiBvF;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EACJ,SAAS,GAAG,aAAa,EACzB,cAAc,GAAG,GAAG,EACpB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,GAAG,SAAS,EACb,GAAG,KAAK,CAAA;IAET,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IAExC,kCAAkC,EAAE,CAAA;IAEpC,MAAM,EAAE,gBAAgB,EAAE,GAAG,eAAe,EAAE,CAAA;IAE9C,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE,CAAC;QAChC,OAAO,CACL,oBAAC,mBAAmB;QAClB,sEAAsE;QACtE,gBAAgB;;YADhB,sEAAsE;YACtE,gBAAgB;YAChB,OAAO,EAAE,QAAQ,IAAI,gBAAgB,KACjC,YAAY,EAAE,SAAS,cAGP,CACvB,CAAA;IACH,CAAC;IAED,OAAO,CACL,oBAAC,eAAe,IACd,OAAO,EACL,oBAAC,OAAO,IACN,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,GACtC,EAEJ,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE;YACT,GAAG,SAAS;YACZ,IAAI,EAAE;gBACJ,GAAG,SAAS,EAAE,IAAI;gBAClB,KAAK,EAAE;oBACL,KAAK,EAAE,OAAO;oBACd,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS;oBACrC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS;oBACnC,QAAQ,EAAE,QAAQ;oBAClB,GAAG,SAAS,EAAE,IAAI,EAAE,KAAK;iBAC1B;aACF;SACF,KACG,SAAS;QAEb,oBAAC,gBAAgB,IACf,MAAM,EAAE,oBAAC,aAAa,OAAG,KACrB,YAAY,EAAE,QAAQ,GAC1B,CACc,CACnB,CAAA;AACH,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BlockProps } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { ReactNode } from "react";
|
|
3
|
-
type ListingItemProps = {
|
|
4
|
-
icon?: ReactNode;
|
|
5
|
-
label?: string;
|
|
6
|
-
subLabel?: string;
|
|
7
|
-
value?: number;
|
|
8
|
-
subValue?: number;
|
|
9
|
-
overrides?: BlockProps["overrides"];
|
|
10
|
-
isLoading?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export default function ListingItem(props: ListingItemProps): React.JSX.Element;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=ListingItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListingItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/ListingItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,UAAU,EAIX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAwDxC,KAAK,gBAAgB,GAAG;IACtB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAA;IACnC,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAoG1D"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { mergeOverrides, Block, useStyletron, Skeleton, LabelMedium, ParagraphSmall, } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import SlotNumber from "./SlotNumber";
|
|
4
|
-
import { formatUsd } from "../../utils/currency";
|
|
5
|
-
function ListingItemLayout(props) {
|
|
6
|
-
const { icon, label, value, subLabel, subValue, overrides, ...restProps } = props;
|
|
7
|
-
const [, theme] = useStyletron();
|
|
8
|
-
return (React.createElement(Block, { display: "flex", alignItems: "center", paddingLeft: theme.sizing.scale600, paddingRight: theme.sizing.scale600, overrides: mergeOverrides({
|
|
9
|
-
Block: {
|
|
10
|
-
style: {
|
|
11
|
-
gap: theme.sizing.scale600,
|
|
12
|
-
minHeight: "72px",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
}, overrides), ...restProps },
|
|
16
|
-
icon && icon,
|
|
17
|
-
React.createElement(Block, { display: "flex", flexDirection: "column", alignItems: "flex-start" },
|
|
18
|
-
label && label,
|
|
19
|
-
subLabel && subLabel),
|
|
20
|
-
React.createElement(Block, { display: "flex", flexDirection: "column", alignItems: "flex-end", marginLeft: "auto" },
|
|
21
|
-
value && value,
|
|
22
|
-
subValue && subValue)));
|
|
23
|
-
}
|
|
24
|
-
export default function ListingItem(props) {
|
|
25
|
-
const { icon, label, subLabel, value, subValue, overrides, isLoading = false, } = props;
|
|
26
|
-
const [, theme] = useStyletron();
|
|
27
|
-
if (isLoading) {
|
|
28
|
-
return (React.createElement(ListingItemLayout, { icon: React.createElement(Skeleton, { animation: true, width: theme.sizing.scale800, height: theme.sizing.scale800 }), label: React.createElement(Skeleton, { animation: true, width: theme.sizing.scale2400, height: theme.sizing.scale600, overrides: {
|
|
29
|
-
Root: {
|
|
30
|
-
style: { marginBottom: theme.sizing.scale100 },
|
|
31
|
-
},
|
|
32
|
-
} }), subLabel: React.createElement(Skeleton, { animation: true, width: theme.sizing.scale1600, height: theme.sizing.scale550 }), value: React.createElement(Skeleton, { animation: true, width: theme.sizing.scale2400, height: theme.sizing.scale600, overrides: {
|
|
33
|
-
Root: {
|
|
34
|
-
style: { marginBottom: theme.sizing.scale100 },
|
|
35
|
-
},
|
|
36
|
-
} }), subValue: React.createElement(Skeleton, { animation: true, width: theme.sizing.scale1600, height: theme.sizing.scale550 }), overrides: overrides }));
|
|
37
|
-
}
|
|
38
|
-
return (React.createElement(ListingItemLayout, { icon: icon, label: React.createElement(LabelMedium, null, label), subLabel: React.createElement(ParagraphSmall, { margin: 0, as: "div", color: theme.colors.contentSecondary }, subLabel), value: value !== undefined && (React.createElement(LabelMedium, null,
|
|
39
|
-
React.createElement(SlotNumber, { formatFunction: formatUsd }, value))), subValue: subValue !== undefined && (React.createElement(ParagraphSmall, { margin: 0, as: "div", color: theme.colors.contentSecondary },
|
|
40
|
-
React.createElement(SlotNumber, { formatFunction: formatUsd }, subValue))), overrides: overrides }));
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=ListingItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListingItem.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/ListingItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,EACL,YAAY,EAEZ,QAAQ,EACR,WAAW,EACX,cAAc,GACf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAUhD,SAAS,iBAAiB,CAAC,KAA6B;IACtD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GACvE,KAAK,CAAA;IACP,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,OAAO,CACL,oBAAC,KAAK,IACJ,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAClC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EACnC,SAAS,EAAE,cAAc,CACvB;YACE,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;oBAC1B,SAAS,EAAE,MAAM;iBAClB;aACF;SACF,EACD,SAAS,CACV,KACG,SAAS;QAEZ,IAAI,IAAI,IAAI;QAEb,oBAAC,KAAK,IAA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
|
4
|
-
children: ReactNode;
|
|
5
|
-
} & BlockProps;
|
|
6
|
-
declare function NestedViewLayout(props: NestedViewLayoutProps): React.JSX.Element;
|
|
7
|
-
export default NestedViewLayout;
|
|
8
|
-
//# sourceMappingURL=NestedViewLayout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NestedViewLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/NestedViewLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAIX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAe,MAAM,OAAO,CAAA;AAUrD,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,SAAS,CAAA;CACpB,GAAG,UAAU,CAAA;AAEd,iBAAS,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBA8DrD;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ArrowLeft, Block, ButtonIcon, HeadingSmall, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { useCallback } from "react";
|
|
3
|
-
import useDropdownStore, { DropdownView } from "../../stores/dropdownStore";
|
|
4
|
-
const getHeaderTitle = (view) => {
|
|
5
|
-
const titleMap = {
|
|
6
|
-
[DropdownView.RECEIVE]: "Scan to receive",
|
|
7
|
-
};
|
|
8
|
-
return titleMap[view];
|
|
9
|
-
};
|
|
10
|
-
function NestedViewLayout(props) {
|
|
11
|
-
const { children, ...restProps } = props;
|
|
12
|
-
const currentView = useDropdownStore((state) => state.view);
|
|
13
|
-
const setView = useDropdownStore((state) => state.setView);
|
|
14
|
-
const [, theme] = useStyletron();
|
|
15
|
-
const handleOnButtonClick = useCallback(() => {
|
|
16
|
-
setView(DropdownView.ROOT);
|
|
17
|
-
}, [setView]);
|
|
18
|
-
return (React.createElement(Block, { display: "flex", flexDirection: "column", minHeight: "588px", ...restProps },
|
|
19
|
-
React.createElement(Block, { display: "flex", alignItems: "center", padding: theme.sizing.scale100, paddingTop: theme.sizing.scale800, paddingBottom: theme.sizing.scale500, marginBottom: theme.sizing.scale300, overrides: {
|
|
20
|
-
Block: {
|
|
21
|
-
style: {
|
|
22
|
-
gap: theme.sizing.scale300,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
} },
|
|
26
|
-
React.createElement(ButtonIcon, { onClick: handleOnButtonClick, shape: "circle", size: "medium", kind: "tertiary" },
|
|
27
|
-
React.createElement(ArrowLeft, null)),
|
|
28
|
-
React.createElement(HeadingSmall, { marginTop: theme.sizing.scale300, marginBottom: theme.sizing.scale300 }, getHeaderTitle(currentView))),
|
|
29
|
-
React.createElement(Block, { display: "flex", flexDirection: "column", padding: theme.sizing.scale600, paddingTop: 0, flex: 1 }, children)));
|
|
30
|
-
}
|
|
31
|
-
export default NestedViewLayout;
|
|
32
|
-
//# sourceMappingURL=NestedViewLayout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NestedViewLayout.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/NestedViewLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EAEL,UAAU,EACV,YAAY,EACZ,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,gBAAgB,EAAE,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,cAAc,GAAG,CAAC,IAAkB,EAAE,EAAE;IAC5C,MAAM,QAAQ,GAA0C;QACtD,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,iBAAiB;KAC1C,CAAA;IACD,OAAO,QAAQ,CAAC,IAAI,CAAE,CAAA;AACxB,CAAC,CAAA;AAMD,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,C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,KAAK,IACJ,OAAO,EAAC,MAAM,EACd,aAAa,EAAC,QAAQ,EACtB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC9B,UAAU,EAAE,CAAC,EACb,IAAI,EAAE,CAAC,IAEN,QAAQ,CACH,CACF,CACT,CAAA;AACH,CAAC;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Receive.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Receive/Receive.tsx"],"names":[],"mappings":"AASA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAQvC,iBAAS,OAAO,sBA4Hf;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Block, Button, LabelLarge, MezoCircle, MonoLabelXSmall, ParagraphSmall, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
import { useCopyToClipboard } from "usehooks-ts";
|
|
4
|
-
import { QRCodeSVG } from "qrcode.react";
|
|
5
|
-
import NestedViewLayout from "../NestedViewLayout";
|
|
6
|
-
import { getAddressExplorerUrl } from "../../../utils/address";
|
|
7
|
-
import { usePassportContext } from "../../../hooks/usePassportContext";
|
|
8
|
-
import useWalletAccount from "../../../hooks/useWalletAccount";
|
|
9
|
-
function Receive() {
|
|
10
|
-
const { environment } = usePassportContext();
|
|
11
|
-
const walletAccount = useWalletAccount();
|
|
12
|
-
const [, theme] = useStyletron();
|
|
13
|
-
const [, copy] = useCopyToClipboard();
|
|
14
|
-
const [isCopiedMessageVisible, setIsCopiedMessageVisible] = useState(false);
|
|
15
|
-
const handleCopyAddress = () => {
|
|
16
|
-
copy(walletAccount.accountAddress);
|
|
17
|
-
setIsCopiedMessageVisible(true);
|
|
18
|
-
setTimeout(() => {
|
|
19
|
-
setIsCopiedMessageVisible(false);
|
|
20
|
-
}, 2000);
|
|
21
|
-
};
|
|
22
|
-
const blockExplorerUrl = getAddressExplorerUrl(walletAccount.accountAddress, "mezo", environment === "testnet");
|
|
23
|
-
return (React.createElement(NestedViewLayout, null,
|
|
24
|
-
React.createElement(LabelLarge, null, "Your Mezo Address"),
|
|
25
|
-
React.createElement(ParagraphSmall, { marginTop: 0, marginBottom: theme.sizing.scale800, color: theme.colors.contentTertiary }, walletAccount.networkFamily === "bitcoin" ? (React.createElement(React.Fragment, null, "Mezo automatically created a smart account that's fully controlled by your connected Bitcoin wallet. Use this address to receive assets on Mezo.")) : (React.createElement(React.Fragment, null, "Your connected wallet address is your Mezo address. Use this address to receive assets on Mezo."))),
|
|
26
|
-
React.createElement(Block, { as: QRCodeSVG, value: walletAccount.accountAddress, flex: 1, overrides: {
|
|
27
|
-
Block: {
|
|
28
|
-
style: {
|
|
29
|
-
aspectRatio: 1,
|
|
30
|
-
width: "fit-content",
|
|
31
|
-
margin: "0 auto",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
} }),
|
|
35
|
-
React.createElement(Block, { display: "flex", alignItems: "center", backgroundColor: theme.colors.backgroundSecondary, marginTop: theme.sizing.scale800, marginBottom: theme.sizing.scale600, padding: theme.sizing.scale300, overrides: {
|
|
36
|
-
Block: {
|
|
37
|
-
style: {
|
|
38
|
-
gap: theme.sizing.scale300,
|
|
39
|
-
borderRadius: theme.borders.radius400,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
} },
|
|
43
|
-
React.createElement(MezoCircle, { size: theme.sizing.scale700, color: theme.colors.accent, symbolColor: theme.colors.white, overrides: {
|
|
44
|
-
Svg: {
|
|
45
|
-
style: {
|
|
46
|
-
backgroundColor: theme.colors.accent,
|
|
47
|
-
overflow: "hidden",
|
|
48
|
-
borderRadius: theme.borders.radius200,
|
|
49
|
-
flexShrink: 0,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
} }),
|
|
53
|
-
React.createElement(MonoLabelXSmall, null, walletAccount.accountAddress)),
|
|
54
|
-
React.createElement(Button, { onClick: handleCopyAddress, size: "medium", overrides: {
|
|
55
|
-
BaseButton: {
|
|
56
|
-
style: {
|
|
57
|
-
marginBottom: theme.sizing.scale500,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
} }, isCopiedMessageVisible ? "Copied!" : "Copy Mezo address"),
|
|
61
|
-
React.createElement(Button, { kind: "secondary", size: "medium", "$as": "a", href: blockExplorerUrl, target: "_blank" }, "View Mezo explorer")));
|
|
62
|
-
}
|
|
63
|
-
export default Receive;
|
|
64
|
-
//# sourceMappingURL=Receive.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Receive.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Receive/Receive.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,UAAU,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,gBAAgB,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,gBAAgB,MAAM,iCAAiC,CAAA;AAE9D,SAAS,OAAO;IACd,MAAM,EAAE,WAAW,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAE5C,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IAExC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,kBAAkB,EAAE,CAAA;IAErC,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,QAAQ,CAAC,KAAK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AK,EAAE;oBACL,KAAK,EAAE;wBACL,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;wBAC1B,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS;qBACtC;iBACF;aACF;YAED,oBAAC,UAAU,IACT,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC3B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAC1B,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAC/B,SAAS,EAAE;oBACT,GAAG,EAAE;wBACH,KAAK,EAAE;4BACL,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;4BACpC,QAAQ,EAAE,QAAQ;4BAClB,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS;4BACrC,UAAU,EAAE,CAAC;yBACd;qBACF;iBACF,GACD;YAEF,oBAAC,eAAe,QAAE,aAAa,CAAC,cAAc,CAAmB,CAC3D;QAER,oBAAC,MAAM,IACL,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE;gBACT,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;qBACpC;iBACF;aACF,IAEA,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAClD;QAET,oBAAC,MAAM,IACL,IAAI,EAAC,WAAW,EAChB,IAAI,EAAC,QAAQ,SACT,GAAG,EACP,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAC,QAAQ,yBAGR,CACQ,CACpB,CAAA;AACH,CAAC;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountAddressActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAddressActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAKX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AA0BzB,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,UAAU,qBA+D9D"}
|