@mezo-org/passport 0.4.0-dev.81 → 0.4.0-dev.83
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 +1 -1
- package/dist/src/api/auth.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Content.d.ts +0 -15
- package/dist/src/components/Dropdown/Content.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Content.js +3 -3
- package/dist/src/components/Dropdown/Content.js.map +1 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +0 -4
- package/dist/src/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Dropdown.js +10 -33
- package/dist/src/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/src/components/Dropdown/ListingItem.d.ts +8 -7
- package/dist/src/components/Dropdown/ListingItem.d.ts.map +1 -1
- package/dist/src/components/Dropdown/ListingItem.js +36 -28
- package/dist/src/components/Dropdown/ListingItem.js.map +1 -1
- package/dist/src/components/Dropdown/NestedViewLayout.d.ts +2 -1
- package/dist/src/components/Dropdown/NestedViewLayout.d.ts.map +1 -1
- package/dist/src/components/Dropdown/NestedViewLayout.js +13 -15
- package/dist/src/components/Dropdown/NestedViewLayout.js.map +1 -1
- package/dist/src/components/Dropdown/Receive/Receive.d.ts +1 -4
- package/dist/src/components/Dropdown/Receive/Receive.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Receive/Receive.js +36 -19
- package/dist/src/components/Dropdown/Receive/Receive.js.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts +2 -5
- package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountAddressActions.js +28 -12
- package/dist/src/components/Dropdown/Root/AccountAddressActions.js.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts +2 -4
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountBalance.js +24 -8
- package/dist/src/components/Dropdown/Root/AccountBalance.js.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts +6 -0
- package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountBtcListing.js +27 -0
- package/dist/src/components/Dropdown/Root/AccountBtcListing.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountError.d.ts +8 -0
- package/dist/src/components/Dropdown/Root/AccountError.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountError.js +17 -0
- package/dist/src/components/Dropdown/Root/AccountError.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts +4 -0
- package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountMusdListing.js +21 -0
- package/dist/src/components/Dropdown/Root/AccountMusdListing.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts +2 -3
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js +34 -39
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js.map +1 -1
- package/dist/src/components/Dropdown/Root/Root.d.ts +0 -15
- package/dist/src/components/Dropdown/Root/Root.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/Root.js +22 -34
- package/dist/src/components/Dropdown/Root/Root.js.map +1 -1
- package/dist/src/components/Dropdown/Root/WalletAddress.d.ts +2 -6
- package/dist/src/components/Dropdown/Root/WalletAddress.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/WalletAddress.js +43 -34
- package/dist/src/components/Dropdown/Root/WalletAddress.js.map +1 -1
- package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts +2 -4
- package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js +60 -16
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js.map +1 -1
- package/dist/src/components/Dropdown/SlotNumber.d.ts +19 -0
- package/dist/src/components/Dropdown/SlotNumber.d.ts.map +1 -0
- package/dist/src/components/Dropdown/SlotNumber.js +67 -0
- package/dist/src/components/Dropdown/SlotNumber.js.map +1 -0
- package/dist/src/config.d.ts +1 -11
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +3 -40
- package/dist/src/config.js.map +1 -1
- package/dist/src/constants.d.ts +0 -2
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +0 -2
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/useAssetsConversionRates.d.ts +8 -13
- package/dist/src/hooks/useAssetsConversionRates.d.ts.map +1 -1
- package/dist/src/hooks/useAssetsConversionRates.js +44 -67
- package/dist/src/hooks/useAssetsConversionRates.js.map +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.d.ts.map +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.js +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.js.map +1 -1
- package/dist/src/hooks/useBorrowData.d.ts +31 -5
- package/dist/src/hooks/useBorrowData.d.ts.map +1 -1
- package/dist/src/hooks/useBorrowData.js +53 -11
- package/dist/src/hooks/useBorrowData.js.map +1 -1
- package/dist/src/hooks/useCreateAccount.d.ts.map +1 -1
- package/dist/src/hooks/useCreateAccount.js +3 -3
- package/dist/src/hooks/useCreateAccount.js.map +1 -1
- package/dist/src/hooks/useGetCurrentAccount.d.ts +2 -2
- package/dist/src/hooks/useGetCurrentAccount.d.ts.map +1 -1
- package/dist/src/hooks/useGetCurrentAccount.js +4 -6
- package/dist/src/hooks/useGetCurrentAccount.js.map +1 -1
- package/dist/src/hooks/useLinkAccount.d.ts.map +1 -1
- package/dist/src/hooks/useLinkAccount.js +3 -3
- package/dist/src/hooks/useLinkAccount.js.map +1 -1
- package/dist/src/hooks/useTokensBalances.d.ts +36 -35
- package/dist/src/hooks/useTokensBalances.d.ts.map +1 -1
- package/dist/src/hooks/useTokensBalances.js +93 -52
- package/dist/src/hooks/useTokensBalances.js.map +1 -1
- package/dist/src/hooks/useWalletAccount.d.ts +8 -10
- package/dist/src/hooks/useWalletAccount.d.ts.map +1 -1
- package/dist/src/hooks/useWalletAccount.js +22 -19
- package/dist/src/hooks/useWalletAccount.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- 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 +4 -0
- package/dist/src/lib/contracts/index.js.map +1 -1
- package/dist/src/provider.d.ts +7 -1
- package/dist/src/provider.d.ts.map +1 -1
- package/dist/src/provider.js +4 -1
- package/dist/src/provider.js.map +1 -1
- package/dist/src/utils/assets.d.ts +145 -0
- package/dist/src/utils/assets.d.ts.map +1 -0
- package/dist/src/utils/assets.js +100 -0
- package/dist/src/utils/assets.js.map +1 -0
- package/dist/src/utils/assets.test.d.ts +2 -0
- package/dist/src/utils/assets.test.d.ts.map +1 -0
- package/dist/src/utils/assets.test.js +46 -0
- package/dist/src/utils/assets.test.js.map +1 -0
- package/dist/src/utils/currency.d.ts +6 -3
- package/dist/src/utils/currency.d.ts.map +1 -1
- package/dist/src/utils/currency.js +13 -10
- package/dist/src/utils/currency.js.map +1 -1
- package/dist/src/utils/currency.test.js +44 -2
- package/dist/src/utils/currency.test.js.map +1 -1
- package/dist/src/utils/numbers.d.ts +13 -53
- package/dist/src/utils/numbers.d.ts.map +1 -1
- package/dist/src/utils/numbers.js +16 -118
- package/dist/src/utils/numbers.js.map +1 -1
- package/dist/src/utils/numbers.test.js +24 -142
- package/dist/src/utils/numbers.test.js.map +1 -1
- package/package.json +2 -1
- package/src/api/auth.ts +1 -1
- package/src/components/Dropdown/Content.tsx +3 -48
- package/src/components/Dropdown/Dropdown.tsx +7 -55
- package/src/components/Dropdown/ListingItem.tsx +155 -59
- package/src/components/Dropdown/NestedViewLayout.tsx +32 -20
- package/src/components/Dropdown/Receive/Receive.tsx +69 -32
- package/src/components/Dropdown/Root/AccountAddressActions.tsx +64 -35
- package/src/components/Dropdown/Root/AccountBalance.tsx +54 -16
- package/src/components/Dropdown/Root/AccountBtcListing.tsx +52 -0
- package/src/components/Dropdown/Root/AccountError.tsx +34 -0
- package/src/components/Dropdown/Root/AccountMusdListing.tsx +45 -0
- package/src/components/Dropdown/Root/AccountOtherAssets.tsx +63 -46
- package/src/components/Dropdown/Root/Root.tsx +28 -98
- package/src/components/Dropdown/Root/WalletAddress.tsx +95 -89
- package/src/components/Dropdown/Root/WelcomeBlock.tsx +109 -29
- package/src/components/Dropdown/SlotNumber.tsx +131 -0
- package/src/config.ts +3 -59
- package/src/constants.ts +0 -6
- package/src/hooks/useAssetsConversionRates.ts +49 -67
- package/src/hooks/useAuthenticateWithWallet.ts +7 -5
- package/src/hooks/useBorrowData.ts +71 -12
- package/src/hooks/useCreateAccount.ts +5 -4
- package/src/hooks/useGetCurrentAccount.ts +5 -7
- package/src/hooks/useLinkAccount.ts +5 -4
- package/src/hooks/useTokensBalances.ts +152 -74
- package/src/hooks/useWalletAccount.ts +27 -36
- package/src/index.ts +0 -1
- package/src/lib/contracts/index.ts +8 -1
- package/src/provider.ts +11 -3
- package/src/utils/assets.test.ts +57 -0
- package/src/utils/assets.ts +103 -0
- package/src/utils/currency.test.ts +76 -2
- package/src/utils/currency.ts +20 -15
- package/src/utils/numbers.test.ts +29 -180
- package/src/utils/numbers.ts +22 -171
- package/dist/src/components/Dropdown/Root/AccountAssetItem.d.ts +0 -11
- package/dist/src/components/Dropdown/Root/AccountAssetItem.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountAssetItem.js +0 -9
- package/dist/src/components/Dropdown/Root/AccountAssetItem.js.map +0 -1
- package/dist/src/hooks/useDropdownData.d.ts +0 -47
- package/dist/src/hooks/useDropdownData.d.ts.map +0 -1
- package/dist/src/hooks/useDropdownData.js +0 -97
- package/dist/src/hooks/useDropdownData.js.map +0 -1
- package/dist/src/utils/cryptoAssets.d.ts +0 -44
- package/dist/src/utils/cryptoAssets.d.ts.map +0 -1
- package/dist/src/utils/cryptoAssets.js +0 -129
- package/dist/src/utils/cryptoAssets.js.map +0 -1
- package/dist/src/utils/cryptoAssets.test.d.ts +0 -2
- package/dist/src/utils/cryptoAssets.test.d.ts.map +0 -1
- package/dist/src/utils/cryptoAssets.test.js +0 -67
- package/dist/src/utils/cryptoAssets.test.js.map +0 -1
- package/src/components/Dropdown/Root/AccountAssetItem.tsx +0 -26
- package/src/hooks/useDropdownData.ts +0 -152
- package/src/utils/cryptoAssets.test.ts +0 -79
- package/src/utils/cryptoAssets.ts +0 -171
package/dist/src/api/auth.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export type CreateSessionResponse = Session | AuthenticationProviderRedirectResp
|
|
|
45
45
|
export type DeleteSessionResponse = {
|
|
46
46
|
message: string;
|
|
47
47
|
};
|
|
48
|
-
export type GetCurrentAccountResponse =
|
|
48
|
+
export type GetCurrentAccountResponse = Account | null;
|
|
49
49
|
export type GetAccountByMezoIdOrAddressResponse = {
|
|
50
50
|
mezoId?: string;
|
|
51
51
|
linkedAccounts?: Extract<LinkedAccount, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/api/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGpC,KAAK,YAAY,GAAG,SAAS,CAAA;AAE7B,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,QAAQ,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,YAAY,CAAA;IAClB,IAAI,EAAE,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AG,OAAO,GAAG,IAAI,CAAA;AAEtD,MAAM,MAAM,mCAAmC,GAAG;IAChD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,OAAO,CAAC,aAAa,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC,EAAE,CAAA;CAC9D,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAA;AAC3E,MAAM,MAAM,mBAAmB,GAC3B,OAAO,GACP,sCAAsC,CAAA;AAE1C,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG,aAAa,GAAG;IACpE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AACH,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAA;AAE3C,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAE1C,eAAO,MAAM,yBAAyB;;;CAGrC,CAAA;AAED,qBAAa,aAAc,SAAQ,SAAS;gBAExC,WAAW,GAAE,MAAM,OAAO,yBAAqC,EAC/D,MAAM,CAAC,EAAE,MAAM;IAOX,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM;IASxB,aAAa,CAAC,oBAAoB,EAAE,oBAAoB;IASxD,aAAa;IAQb,iBAAiB;IAWjB,2BAA2B,CAAC,eAAe,EAAE,MAAM;IAqBnD,WAAW,CAAC,kBAAkB,EAAE,kBAAkB;IAYlD,aAAa,CAAC,oBAAoB,EAAE,oBAAoB;IASxD,YAAY,CAAC,SAAS,EAAE,MAAM;CAWrC"}
|
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { DetailedCryptoAsset } from "../../utils/cryptoAssets";
|
|
3
2
|
type ContentProps = {
|
|
4
|
-
mezoId: string;
|
|
5
|
-
matsBalance: number;
|
|
6
|
-
accountAddress: string;
|
|
7
|
-
walletAddress: string;
|
|
8
|
-
walletType: "bitcoin" | "evm";
|
|
9
|
-
usdTotalBalance: number;
|
|
10
|
-
usdTroveDebt: number;
|
|
11
|
-
usdCollateral: number;
|
|
12
|
-
assets: {
|
|
13
|
-
btc: DetailedCryptoAsset;
|
|
14
|
-
musd: DetailedCryptoAsset;
|
|
15
|
-
};
|
|
16
|
-
otherAssetsCount: number;
|
|
17
|
-
otherAssetsUsdTotal: number;
|
|
18
3
|
onSignOut?: () => void;
|
|
19
4
|
onOtherAssetsClick?: () => void;
|
|
20
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/Content.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAA;
|
|
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"}
|
|
@@ -5,7 +5,7 @@ import Root from "./Root/Root";
|
|
|
5
5
|
import Receive from "./Receive/Receive";
|
|
6
6
|
import TestnetTopBanner from "./TestnetTopBanner";
|
|
7
7
|
function Content(props) {
|
|
8
|
-
const {
|
|
8
|
+
const { onSignOut, onOtherAssetsClick } = props;
|
|
9
9
|
const [_, theme] = useStyletron();
|
|
10
10
|
const currentView = useDropdownStore((state) => state.view);
|
|
11
11
|
const setView = useDropdownStore((state) => state.setView);
|
|
@@ -20,8 +20,8 @@ function Content(props) {
|
|
|
20
20
|
},
|
|
21
21
|
} },
|
|
22
22
|
React.createElement(TestnetTopBanner, null),
|
|
23
|
-
currentView === DropdownView.ROOT && (React.createElement(Root, {
|
|
24
|
-
currentView === DropdownView.RECEIVE &&
|
|
23
|
+
currentView === DropdownView.ROOT && (React.createElement(Root, { onSignOut: onSignOut, onOtherAssetsClick: onOtherAssetsClick })),
|
|
24
|
+
currentView === DropdownView.RECEIVE && React.createElement(Receive, null)));
|
|
25
25
|
}
|
|
26
26
|
export default Content;
|
|
27
27
|
//# sourceMappingURL=Content.js.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -13,10 +13,6 @@ export type DropdownProps = {
|
|
|
13
13
|
signedOut?: Omit<ButtonProps, "onClick">;
|
|
14
14
|
};
|
|
15
15
|
onOtherAssetsClick?: () => void;
|
|
16
|
-
/** Time in milliseconds after which account data (like mats or mezo id) in dropdown should be re-fetched. Default is 90000 (90 secs) */
|
|
17
|
-
accountDataRefetchInterval?: number;
|
|
18
|
-
/** Time in milliseconds after which native balance in dropdown should be re-fetched. Default is 90000 (90 secs) */
|
|
19
|
-
nativeBalanceRefetchInterval?: number;
|
|
20
16
|
} & Omit<StatefulPopoverProps, "children" | "content">;
|
|
21
17
|
/**
|
|
22
18
|
* Passport Dropdown component that displays user's wallet and assets information.
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,61 +1,38 @@
|
|
|
1
1
|
import { StatefulPopover, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
2
|
import { useConnectModal } from "@rainbow-me/rainbowkit";
|
|
3
|
-
import React
|
|
4
|
-
import { useDisconnect } from "wagmi";
|
|
3
|
+
import React from "react";
|
|
5
4
|
import DefaultAvatar from "../../assets/DefaultAvatar";
|
|
6
|
-
import useWalletAccount from "../../hooks/useWalletAccount";
|
|
7
5
|
import ConnectedTrigger from "./ConnectedTrigger";
|
|
8
6
|
import Content from "./Content";
|
|
9
7
|
import DisconnectedTrigger from "./DisconnectedTrigger";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import useWalletAccount from "../../hooks/useWalletAccount";
|
|
9
|
+
import { useWatchTransferEventsForAllTokens } from "../../hooks/useWatchTransferEvents";
|
|
12
10
|
/**
|
|
13
11
|
* Passport Dropdown component that displays user's wallet and assets information.
|
|
14
12
|
* @param {DropdownProps} props - Component props.
|
|
15
13
|
* @returns {JSX.Element}
|
|
16
14
|
*/
|
|
17
15
|
export function Dropdown(props) {
|
|
18
|
-
const { placement = "bottomRight", animateOutTime = 120, onSignIn, onSignOut, overrides, triggerProps, onOtherAssetsClick,
|
|
16
|
+
const { placement = "bottomRight", animateOutTime = 120, onSignIn, onSignOut, overrides, triggerProps, onOtherAssetsClick, ...restProps } = props;
|
|
19
17
|
const [, theme] = useStyletron();
|
|
20
|
-
const data =
|
|
21
|
-
|
|
22
|
-
nativeBalanceRefetchInterval,
|
|
23
|
-
});
|
|
24
|
-
const isCriticalDropdownDataLoaded = useMemo(() => Boolean(data.mezoId && data.accountAddress && data.walletAddress), [data]);
|
|
18
|
+
const { data: walletAccountData } = useWalletAccount();
|
|
19
|
+
useWatchTransferEventsForAllTokens();
|
|
25
20
|
const { openConnectModal } = useConnectModal();
|
|
26
|
-
|
|
27
|
-
const { signInWithWalletAsync, isPending } = useSignInWithWallet();
|
|
28
|
-
const { disconnectAsync } = useDisconnect();
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (onSignIn)
|
|
31
|
-
return;
|
|
32
|
-
const handleSignIn = async () => {
|
|
33
|
-
if (!isConnected)
|
|
34
|
-
return;
|
|
35
|
-
try {
|
|
36
|
-
await signInWithWalletAsync();
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
await disconnectAsync();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
handleSignIn();
|
|
43
|
-
}, [disconnectAsync, isConnected, onSignIn, signInWithWalletAsync]);
|
|
44
|
-
if (!isConnected || !isCriticalDropdownDataLoaded) {
|
|
21
|
+
if (!walletAccountData?.isConnected) {
|
|
45
22
|
return (React.createElement(DisconnectedTrigger
|
|
46
23
|
// If connect wallet flow is not provided it fallbacks to RainbowKit's
|
|
47
24
|
// connect modal
|
|
48
25
|
, {
|
|
49
26
|
// If connect wallet flow is not provided it fallbacks to RainbowKit's
|
|
50
27
|
// connect modal
|
|
51
|
-
onClick: onSignIn || openConnectModal,
|
|
28
|
+
onClick: onSignIn || openConnectModal, ...triggerProps?.signedOut }, "Sign in"));
|
|
52
29
|
}
|
|
53
|
-
return (React.createElement(StatefulPopover, { content: React.createElement(Content, {
|
|
30
|
+
return (React.createElement(StatefulPopover, { content: React.createElement(Content, { onSignOut: onSignOut, onOtherAssetsClick: onOtherAssetsClick }), placement: placement, animateOutTime: animateOutTime, overrides: {
|
|
54
31
|
...overrides,
|
|
55
32
|
Body: {
|
|
56
33
|
...overrides?.Body,
|
|
57
34
|
style: {
|
|
58
|
-
width: "
|
|
35
|
+
width: "402px",
|
|
59
36
|
borderRadius: theme.borders.radius500,
|
|
60
37
|
boxShadow: theme.lighting.shadow500,
|
|
61
38
|
overflow: "hidden",
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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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AAS,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,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, {
|
|
1
|
+
import { BlockProps } from "@mezo-org/mezo-clay";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
3
|
type ListingItemProps = {
|
|
4
|
-
icon?:
|
|
5
|
-
label
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
label?: string;
|
|
6
6
|
subLabel?: string;
|
|
7
|
-
value
|
|
8
|
-
subValue?:
|
|
9
|
-
overrides?:
|
|
7
|
+
value?: number;
|
|
8
|
+
subValue?: number;
|
|
9
|
+
overrides?: BlockProps["overrides"];
|
|
10
|
+
isLoading?: boolean;
|
|
10
11
|
};
|
|
11
12
|
export default function ListingItem(props: ListingItemProps): React.JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/ListingItem.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
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,34 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mergeOverrides, Block, useStyletron, Skeleton, LabelMedium, ParagraphSmall, } from "@mezo-org/mezo-clay";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export default function ListingItem(props) {
|
|
11
|
-
const { icon: Icon, label, subLabel = "", value, subValue = "", overrides, } = props;
|
|
12
|
-
return (React.createElement(ListItem, { artwork: Icon,
|
|
13
|
-
// eslint-disable-next-line react/no-unstable-nested-components
|
|
14
|
-
endEnhancer: () => (React.createElement(ListItemLabel, { description: subValue, overrides: mergeOverrides({
|
|
15
|
-
LabelRoot: {
|
|
16
|
-
style: {
|
|
17
|
-
textAlign: "right",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
}, SHARED_LABEL_OVERRIDES) }, value)), overrides: mergeOverrides({
|
|
21
|
-
Root: {
|
|
22
|
-
style: {
|
|
23
|
-
backgroundColor: "transparent",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
Content: {
|
|
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: {
|
|
27
10
|
style: {
|
|
28
|
-
|
|
11
|
+
gap: theme.sizing.scale600,
|
|
12
|
+
minHeight: "72px",
|
|
29
13
|
},
|
|
30
14
|
},
|
|
31
|
-
}, overrides) },
|
|
32
|
-
|
|
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 }));
|
|
33
41
|
}
|
|
34
42
|
//# sourceMappingURL=ListingItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingItem.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/ListingItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,
|
|
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,K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;YAEpC,oBAAC,UAAU,IAAC,cAAc,EAAE,SAAS,IAAG,QAAQ,CAAc,CAC/C,CAClB,EAEH,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { BlockProps } from "@mezo-org/mezo-clay";
|
|
1
2
|
import React, { ReactNode } from "react";
|
|
2
3
|
type NestedViewLayoutProps = {
|
|
3
4
|
children: ReactNode;
|
|
4
|
-
};
|
|
5
|
+
} & BlockProps;
|
|
5
6
|
declare function NestedViewLayout(props: NestedViewLayoutProps): React.JSX.Element;
|
|
6
7
|
export default NestedViewLayout;
|
|
7
8
|
//# sourceMappingURL=NestedViewLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestedViewLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/NestedViewLayout.tsx"],"names":[],"mappings":"
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import { ArrowLeft, Block, ButtonIcon,
|
|
1
|
+
import { ArrowLeft, Block, ButtonIcon, HeadingSmall, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import useDropdownStore, { DropdownView } from "../../stores/dropdownStore";
|
|
4
4
|
const getHeaderTitle = (view) => {
|
|
5
5
|
const titleMap = {
|
|
6
|
-
[DropdownView.RECEIVE]: "
|
|
6
|
+
[DropdownView.RECEIVE]: "Scan to receive",
|
|
7
7
|
};
|
|
8
8
|
return titleMap[view];
|
|
9
9
|
};
|
|
@@ -11,24 +11,22 @@ function NestedViewLayout(props) {
|
|
|
11
11
|
const { children, ...restProps } = props;
|
|
12
12
|
const currentView = useDropdownStore((state) => state.view);
|
|
13
13
|
const setView = useDropdownStore((state) => state.setView);
|
|
14
|
-
const isNested = useDropdownStore((state) => state.isNestedView());
|
|
15
14
|
const [, theme] = useStyletron();
|
|
16
15
|
const handleOnButtonClick = useCallback(() => {
|
|
17
16
|
setView(DropdownView.ROOT);
|
|
18
17
|
}, [setView]);
|
|
19
|
-
return (React.createElement(Block, { display: "flex", flexDirection: "column", minHeight: "588px",
|
|
20
|
-
React.createElement(Block, { display: "flex", alignItems: "center", paddingTop: theme.sizing.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
background: theme.colors.backgroundPrimary,
|
|
25
|
-
marginRight: isNested ? theme.sizing.scale300 : undefined,
|
|
26
|
-
},
|
|
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,
|
|
27
23
|
},
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
React.createElement(
|
|
31
|
-
|
|
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)));
|
|
32
30
|
}
|
|
33
31
|
export default NestedViewLayout;
|
|
34
32
|
//# sourceMappingURL=NestedViewLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestedViewLayout.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/NestedViewLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,
|
|
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,CAAA;IAExC,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,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,mBAAmB,GAAG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|
-
address: string;
|
|
4
|
-
};
|
|
5
|
-
declare function Receive(props: ReceiveProps): React.JSX.Element;
|
|
2
|
+
declare function Receive(): React.JSX.Element | "Error loading wallet account data" | "Loading wallet account data...";
|
|
6
3
|
export default Receive;
|
|
7
4
|
//# sourceMappingURL=Receive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Receive.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Receive/Receive.tsx"],"names":[],"mappings":"
|
|
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,+FAwIf;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,30 +1,35 @@
|
|
|
1
|
-
import { Block, Button,
|
|
2
|
-
import React, {
|
|
1
|
+
import { Block, Button, LabelLarge, MezoCircle, MonoLabelXSmall, ParagraphSmall, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
3
|
import { useCopyToClipboard } from "usehooks-ts";
|
|
4
4
|
import { QRCodeSVG } from "qrcode.react";
|
|
5
5
|
import NestedViewLayout from "../NestedViewLayout";
|
|
6
6
|
import { getAddressExplorerUrl } from "../../../utils/address";
|
|
7
7
|
import { usePassportContext } from "../../../hooks/usePassportContext";
|
|
8
8
|
import useWalletAccount from "../../../hooks/useWalletAccount";
|
|
9
|
-
function Receive(
|
|
10
|
-
const { address } = props;
|
|
9
|
+
function Receive() {
|
|
11
10
|
const { environment } = usePassportContext();
|
|
12
|
-
const
|
|
11
|
+
const { data: walletAccountData, isError: isWalletAccountDataError, isPending: isWalletAccountDataPending, } = useWalletAccount();
|
|
13
12
|
const [, theme] = useStyletron();
|
|
14
13
|
const [, copy] = useCopyToClipboard();
|
|
15
14
|
const [isCopiedMessageVisible, setIsCopiedMessageVisible] = useState(false);
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
if (isWalletAccountDataError) {
|
|
16
|
+
return "Error loading wallet account data";
|
|
17
|
+
}
|
|
18
|
+
if (isWalletAccountDataPending) {
|
|
19
|
+
return "Loading wallet account data...";
|
|
20
|
+
}
|
|
21
|
+
const handleCopyAddress = () => {
|
|
22
|
+
copy(walletAccountData.accountAddress);
|
|
18
23
|
setIsCopiedMessageVisible(true);
|
|
19
24
|
setTimeout(() => {
|
|
20
25
|
setIsCopiedMessageVisible(false);
|
|
21
26
|
}, 2000);
|
|
22
|
-
}
|
|
23
|
-
const
|
|
27
|
+
};
|
|
28
|
+
const blockExplorerUrl = getAddressExplorerUrl(walletAccountData.accountAddress, "mezo", environment === "testnet");
|
|
24
29
|
return (React.createElement(NestedViewLayout, null,
|
|
25
|
-
React.createElement(
|
|
26
|
-
React.createElement(ParagraphSmall, { marginTop:
|
|
27
|
-
React.createElement(Block, { as: QRCodeSVG, value:
|
|
30
|
+
React.createElement(LabelLarge, null, "Your Mezo Address"),
|
|
31
|
+
React.createElement(ParagraphSmall, { marginTop: 0, marginBottom: theme.sizing.scale800, color: theme.colors.contentTertiary }, walletAccountData.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."))),
|
|
32
|
+
React.createElement(Block, { as: QRCodeSVG, value: walletAccountData.accountAddress, flex: 1, overrides: {
|
|
28
33
|
Block: {
|
|
29
34
|
style: {
|
|
30
35
|
aspectRatio: 1,
|
|
@@ -33,21 +38,33 @@ function Receive(props) {
|
|
|
33
38
|
},
|
|
34
39
|
},
|
|
35
40
|
} }),
|
|
36
|
-
React.createElement(
|
|
41
|
+
React.createElement(Block, { display: "flex", alignItems: "center", backgroundColor: theme.colors.backgroundSecondary, marginTop: theme.sizing.scale800, marginBottom: theme.sizing.scale600, padding: theme.sizing.scale300, overrides: {
|
|
37
42
|
Block: {
|
|
38
43
|
style: {
|
|
39
|
-
|
|
44
|
+
gap: theme.sizing.scale300,
|
|
45
|
+
borderRadius: theme.borders.radius400,
|
|
40
46
|
},
|
|
41
47
|
},
|
|
42
|
-
} },
|
|
43
|
-
|
|
48
|
+
} },
|
|
49
|
+
React.createElement(MezoCircle, { size: theme.sizing.scale700, color: theme.colors.accent, symbolColor: theme.colors.white, overrides: {
|
|
50
|
+
Svg: {
|
|
51
|
+
style: {
|
|
52
|
+
backgroundColor: theme.colors.accent,
|
|
53
|
+
overflow: "hidden",
|
|
54
|
+
borderRadius: theme.borders.radius200,
|
|
55
|
+
flexShrink: 0,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
} }),
|
|
59
|
+
React.createElement(MonoLabelXSmall, null, walletAccountData.accountAddress)),
|
|
60
|
+
React.createElement(Button, { onClick: handleCopyAddress, size: "medium", overrides: {
|
|
44
61
|
BaseButton: {
|
|
45
62
|
style: {
|
|
46
|
-
marginBottom: theme.sizing.
|
|
63
|
+
marginBottom: theme.sizing.scale500,
|
|
47
64
|
},
|
|
48
65
|
},
|
|
49
|
-
} }, isCopiedMessageVisible ? "Copied!" : "Copy Mezo
|
|
50
|
-
React.createElement(Button, { kind: "secondary", "$as": "a", href: blockExplorerUrl, target: "_blank" }, "View
|
|
66
|
+
} }, isCopiedMessageVisible ? "Copied!" : "Copy Mezo address"),
|
|
67
|
+
React.createElement(Button, { kind: "secondary", size: "medium", "$as": "a", href: blockExplorerUrl, target: "_blank" }, "View Mezo explorer")));
|
|
51
68
|
}
|
|
52
69
|
export default Receive;
|
|
53
70
|
//# sourceMappingURL=Receive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Receive.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Receive/Receive.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,
|
|
1
|
+
{"version":3,"file":"Receive.js","sourceR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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,iBAAiB,CAAC,cAAc,CAAmB,CAC/D;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,7 +1,4 @@
|
|
|
1
|
+
import { BlockProps } from "@mezo-org/mezo-clay";
|
|
1
2
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
address: string;
|
|
4
|
-
};
|
|
5
|
-
export default function AccountAddressActions(props: AccountAddressActionsProps): React.JSX.Element;
|
|
6
|
-
export {};
|
|
3
|
+
export default function AccountAddressActions(props: BlockProps): React.JSX.Element;
|
|
7
4
|
//# sourceMappingURL=AccountAddressActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountAddressActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAddressActions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccountAddressActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAddressActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAMX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AA2BzB,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,UAAU,qBA4F9D"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { ArrowNarrowLeft, Block, Button,
|
|
2
|
-
import React
|
|
1
|
+
import { ArrowNarrowLeft, Block, Button, mergeOverrides, Skeleton, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { usePassportContext } from "../../../hooks/usePassportContext";
|
|
4
4
|
import { getAddressExplorerUrl } from "../../../utils/address";
|
|
5
5
|
import useDropdownStore, { DropdownView } from "../../../stores/dropdownStore";
|
|
6
|
+
import useWalletAccount from "../../../hooks/useWalletAccount";
|
|
7
|
+
import AccountError from "./AccountError";
|
|
6
8
|
const buttonStartEnhancerSize = 12;
|
|
7
9
|
const commonButtonProps = {
|
|
8
10
|
kind: "secondary",
|
|
9
|
-
size: "
|
|
11
|
+
size: "small",
|
|
12
|
+
shape: "pill",
|
|
10
13
|
overrides: {
|
|
11
14
|
BaseButton: {
|
|
12
15
|
style: {
|
|
@@ -21,28 +24,41 @@ const commonButtonProps = {
|
|
|
21
24
|
},
|
|
22
25
|
};
|
|
23
26
|
export default function AccountAddressActions(props) {
|
|
24
|
-
const {
|
|
27
|
+
const { overrides, ...restProps } = props;
|
|
25
28
|
const [, theme] = useStyletron();
|
|
26
29
|
const { environment } = usePassportContext();
|
|
27
|
-
const blockExplorerUrl = getAddressExplorerUrl(address, "mezo", environment === "testnet");
|
|
28
30
|
const setDropdownView = useDropdownStore((state) => state.setView);
|
|
29
|
-
const handleReceiveClick =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const handleReceiveClick = () => setDropdownView(DropdownView.RECEIVE);
|
|
32
|
+
const { data: walletAccountData, isError: isWalletAccountDataError, isPending: isWalletAccountDataPending, } = useWalletAccount();
|
|
33
|
+
if (isWalletAccountDataError) {
|
|
34
|
+
return React.createElement(AccountError, { topic: "wallet account data" });
|
|
35
|
+
}
|
|
36
|
+
if (isWalletAccountDataPending) {
|
|
37
|
+
return (React.createElement(Block, { display: "flex", alignItems: "center", backgroundColor: "transparent", marginBottom: theme.sizing.scale600, overrides: {
|
|
38
|
+
Block: {
|
|
39
|
+
style: {
|
|
40
|
+
gap: theme.sizing.scale600,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
} },
|
|
44
|
+
React.createElement(Skeleton, { animation: true, width: "100%", height: "28px" }),
|
|
45
|
+
React.createElement(Skeleton, { animation: true, width: "100%", height: "28px" })));
|
|
46
|
+
}
|
|
47
|
+
const blockExplorerUrl = getAddressExplorerUrl(walletAccountData.accountAddress, "mezo", environment === "testnet");
|
|
48
|
+
return (React.createElement(Block, { display: "flex", alignItems: "center", backgroundColor: "transparent", padding: `0 ${theme.sizing.scale600} ${theme.sizing.scale800}`, overrides: mergeOverrides({
|
|
33
49
|
Block: {
|
|
34
50
|
style: {
|
|
35
51
|
gap: theme.sizing.scale600,
|
|
36
52
|
},
|
|
37
53
|
},
|
|
38
|
-
} },
|
|
39
|
-
React.createElement(Button, { startEnhancer: React.createElement(Cube01, { size: buttonStartEnhancerSize }), "$as": "a", href: blockExplorerUrl, target: "_blank", ...commonButtonProps }, "View Mezo Explorer"),
|
|
54
|
+
}, overrides), ...restProps },
|
|
40
55
|
React.createElement(Button, { onClick: handleReceiveClick, startEnhancer: React.createElement(ArrowNarrowLeft, { size: buttonStartEnhancerSize, overrides: {
|
|
41
56
|
Svg: {
|
|
42
57
|
style: {
|
|
43
58
|
transform: "rotate(-45deg)",
|
|
44
59
|
},
|
|
45
60
|
},
|
|
46
|
-
} }), ...commonButtonProps }, "Receive")
|
|
61
|
+
} }), ...commonButtonProps }, "Receive"),
|
|
62
|
+
React.createElement(Button, { "$as": "a", href: blockExplorerUrl, target: "_blank", ...commonButtonProps }, "Block Explorer")));
|
|
47
63
|
}
|
|
48
64
|
//# sourceMappingURL=AccountAddressActions.js.map
|