@web3jskit/walletkit 0.0.4 → 0.0.5
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/package.json +6 -3
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -3
- package/src/assets/svg/dataBase.ts +0 -11
- package/src/assets/svg/metaMaskWallet.ts +0 -35
- package/src/components/ConnectButton/ConnectedInfo.tsx +0 -17
- package/src/components/ConnectButton/index.tsx +0 -48
- package/src/components/Connecting/index.tsx +0 -26
- package/src/components/Connecting/style.ts +0 -53
- package/src/components/GetWallet/index.tsx +0 -82
- package/src/components/GetWallet/style.ts +0 -118
- package/src/components/Header/ModalHeader.tsx +0 -24
- package/src/components/Header/style.ts +0 -74
- package/src/components/Icon/index.tsx +0 -120
- package/src/components/Introduce/index.tsx +0 -30
- package/src/components/Introduce/style.ts +0 -73
- package/src/components/Modal/ConnectModal.tsx +0 -155
- package/src/components/Modal/WalletInfoModal.tsx +0 -82
- package/src/components/Modal/index.tsx +0 -80
- package/src/components/Modal/style.ts +0 -190
- package/src/components/SVGs/backArrowSvg.tsx +0 -10
- package/src/components/SVGs/closeSvg.tsx +0 -11
- package/src/components/SVGs/copiedSvg.tsx +0 -11
- package/src/components/SVGs/copySvg.tsx +0 -11
- package/src/components/SVGs/exitSvg.tsx +0 -11
- package/src/components/SVGs/spinSvg.tsx +0 -10
- package/src/components/Text/index.tsx +0 -67
- package/src/components/WalletKitProvider/ChainProvider.tsx +0 -34
- package/src/components/WalletKitProvider/I18nProvider.tsx +0 -52
- package/src/components/WalletKitProvider/ThemeProvider.tsx +0 -16
- package/src/components/WalletKitProvider/index.tsx +0 -40
- package/src/components/WalletList/index.tsx +0 -42
- package/src/components/WalletList/style.ts +0 -102
- package/src/components/WalletTriggerButton/index.tsx +0 -50
- package/src/components/WalletTriggerButton/style.ts +0 -53
- package/src/default.d.ts +0 -18
- package/src/hooks/useWalletKit.ts +0 -42
- package/src/index.ts +0 -9
- package/src/locals/i18n.ts +0 -19
- package/src/locals/languages/en.json +0 -30
- package/src/locals/languages/zh.json +0 -30
- package/src/locals/resources.ts +0 -11
- package/src/stores/SlotsWalletStore.ts +0 -48
- package/src/stores/index.ts +0 -75
- package/src/styled/index.ts +0 -79
- package/src/test/getwalletprovider.test.ts +0 -9
- package/src/test/setup.ts +0 -7
- package/src/theme/index.ts +0 -93
- package/src/theme/styled.d.ts +0 -30
- package/src/types/configType.ts +0 -2
- package/src/types/slotsType.ts +0 -23
- package/src/utils/formatter.ts +0 -4
- package/src/utils/generateAvatar.ts +0 -35
- package/src/wallets/GelWallet/index.ts +0 -0
- package/src/wallets/SlotsWallets/index.ts +0 -30
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -55
- package/vitest.config.ts +0 -10
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web3jskit/walletkit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "walletkit",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
6
9
|
"scripts": {
|
|
7
10
|
"build": "tsc --build tsconfig.build.json",
|
|
8
11
|
"watch": "tsc --watch"
|
|
@@ -11,7 +14,8 @@
|
|
|
11
14
|
"dependencies": {
|
|
12
15
|
"@reach/dialog": "^0.18.0",
|
|
13
16
|
"@react-spring/web": "^9.7.1",
|
|
14
|
-
"@
|
|
17
|
+
"@tanstack/react-query": "^5.0.0",
|
|
18
|
+
"@web3jskit/wallethelper": "0.0.5",
|
|
15
19
|
"copy-to-clipboard": "^3.3.3",
|
|
16
20
|
"i18next": "^22.4.13",
|
|
17
21
|
"i18next-browser-languagedetector": "^7.0.1",
|
|
@@ -35,7 +39,6 @@
|
|
|
35
39
|
"vitest": "2.0.5"
|
|
36
40
|
},
|
|
37
41
|
"peerDependencies": {
|
|
38
|
-
"@tanstack/react-query": ">=5.0.0",
|
|
39
42
|
"react": ">=18",
|
|
40
43
|
"react-dom": ">=18"
|
|
41
44
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const closeIcon =
|
|
2
|
-
'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0iIzAwMDAwMCIgdmlld0JveD0iMCAwIDI1NiAyNTYiPgo8cGF0aCBkPSJNMjA1LjY2LDE5NC4zNGE4LDgsMCwwLDEtMTEuMzIsMTEuMzJMMTI4LDEzOS4zMSw2MS42NiwyMDUuNjZhOCw4LDAsMCwxLTExLjMyLTExLjMyTDExNi42OSwxMjgsNTAuMzQsNjEuNjZBOCw4LDAsMCwxLDYxLjY2LDUwLjM0TDEyOCwxMTYuNjlsNjYuMzQtNjYuMzVhOCw4LDAsMCwxLDExLjMyLDExLjMyTDEzOS4zMSwxMjhaIj48L3BhdGg+Cjwvc3ZnPg==';
|
|
3
|
-
|
|
4
|
-
export const b =
|
|
5
|
-
'data:image/svg+xml;base64,PHN2ZyB4bLjM0TDEyOCwxMTYuNjlsNjYuMzQtNjYuMzVhOCw4LDAsMCwxLDExLjMyLDExLjMyTDEzOS4zMSwxMjhaIj48L3BhdGg+Cjwvc3ZnPg==';
|
|
6
|
-
|
|
7
|
-
export const chromeIcon =
|
|
8
|
-
'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 78 78"><path fill="url(%23a)" d="M71.034 20.5a37.001 37.001 0 0 0-64.084 0l2.22 39.96L71.034 20.5Z"/><path fill="url(%23b)" d="M22.979 48.25 6.958 20.5A37 37 0 0 0 39 76l36.26-37-52.281 9.25Z"/><path fill="url(%23c)" d="M55.021 48.25 39 76a37.001 37.001 0 0 0 32.035-55.5H39l16.021 27.75Z"/><path fill="%23fff" d="M39 57.5a18.5 18.5 0 1 0 0-37 18.5 18.5 0 0 0 0 37Z"/><path fill="%231A73E8" d="M39 53.652a14.65 14.65 0 0 0 13.536-20.26A14.653 14.653 0 1 0 39 53.653Z"/><defs><linearGradient id="a" x1="6.958" x2="71.034" y1="25.125" y2="25.125" gradientUnits="userSpaceOnUse"><stop stop-color="%23D93025"/><stop offset="1" stop-color="%23EA4335"/></linearGradient><linearGradient id="b" x1="43.003" x2="10.961" y1="73.684" y2="18.184" gradientUnits="userSpaceOnUse"><stop stop-color="%231E8E3E"/><stop offset="1" stop-color="%2334A853"/></linearGradient><linearGradient id="c" x1="33.598" x2="65.64" y1="76" y2="20.596" gradientUnits="userSpaceOnUse"><stop stop-color="%23FCC934"/><stop offset="1" stop-color="%23FBBC04"/></linearGradient></defs></svg>';
|
|
9
|
-
|
|
10
|
-
export const gel =
|
|
11
|
-
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAALDSURBVHgB1Zg/aBNRHMe/1kIrRHJDwbSDSQbTrSkKupmDglOhzSDoolMGBzV0cRPpKFJI1w6tVbGLhEC7uIS4KbYmHSNyyVLtYhMSIRVB3++Sd17i3buX1z85P/C7u7z3cu97v/d7v3f3AGd0ZqvMDGa/j9k+de49DwkizPInIMLNjE6fjkwzOzhFMdwOOn3/45lBiLGLitgFGQMUwy3Pxcz7QAw3/Sw7PILDGA6KYSiKGY9omL0zhfPaKALBUau8WW9hY/kD9io1KKCfQdtVffNqO4VL8QuOdduFKu7NvIAKQ1AkoI241k2ENahCMfREpiENzVgoYJ5vPbiKxNyksG2j1sL3/R/mNfGz9QsySA0ZxcvLjyl28xGoQOJoCMulfc+2w5CgHbzdYlYW35nBS531srB0w/Qih7wUmw5JCVKOoa31XUcxxGsmtJdAUM67Qg/F4iFcToQxezfeVd6oHbqKIZqsjtrYvXr74TXTU/QgopQgjKHcl/sYDwctEVvrJXazOnbYtC6XvkEExd2VxEXmmXNIPb5uiaMHmRl75vo/oYe4GGJlsWDGDEfTNOi6jmKxiEql4li22fHERCRoxRSfdUqC7DTrh12/s9ms2Tl1HI1GXcsI0fD2ohzU5A2Zsn5RFpRMJpHJZMyzqKxfpIesFxqWdDrtWdYv0h6SzSNHReihzee7LAdNmdeURz6zTPu1WrfqG2a+6Q7YGHsDsM8kuuZ5jKcOEZ5rmc4W0advbrrWLy28tdIB5RsyN2g9o1cTEZ5D5jVlJ1k251BWPyrKs+yk+P8Eeb0y7FX/LpQ7gviggLZPCDcoqA0IPmcJWvUTczHHTjaW33eV0Yyyr4GcQq7suSAzinRYg3++y1aHOoL8Qo5f5DF47xh2ZRH4bLOB8NV2jN1TximKycNjhnNoR2QN7e234xZhoL2lpzt1/AfLekgsXhgSgQAAAABJRU5ErkJggg==';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { svg } from 'lit';
|
|
2
|
-
|
|
3
|
-
export const x = svg`<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
-
<rect width="28" height="28" fill="white"/>
|
|
5
|
-
<path d="M24.0891 3.1199L15.3446 9.61456L16.9617 5.7828L24.0891 3.1199Z" fill="#E2761B" stroke="#E2761B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
-
<path d="M3.90207 3.1199L12.5763 9.67608L11.0383 5.7828L3.90207 3.1199Z" fill="#E4761B" stroke="#E4761B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
-
<path d="M20.9429 18.1745L18.6139 21.7426L23.597 23.1136L25.0295 18.2536L20.9429 18.1745Z" fill="#E4761B" stroke="#E4761B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8
|
-
<path d="M2.97929 18.2536L4.40301 23.1136L9.38607 21.7426L7.05713 18.1745L2.97929 18.2536Z" fill="#E4761B" stroke="#E4761B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9
|
-
<path d="M9.10483 12.1456L7.71626 14.2461L12.6642 14.4658L12.4884 9.14877L9.10483 12.1456Z" fill="#E4761B" stroke="#E4761B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
10
|
-
<path d="M18.8864 12.1456L15.4589 9.08725L15.3446 14.4658L20.2837 14.2461L18.8864 12.1456Z" fill="#E4761B" stroke="#E4761B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
11
|
-
<path d="M9.38606 21.7426L12.3566 20.2925L9.79033 18.2888L9.38606 21.7426Z" fill="#E4761B" stroke="#E4761B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
12
|
-
<path d="M15.6347 20.2925L18.6139 21.7426L18.2009 18.2888L15.6347 20.2925Z" fill="#E4761B" stroke="#E4761B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
13
|
-
<path d="M18.6139 21.7426L15.6347 20.2925L15.8719 22.2348L15.8456 23.0521L18.6139 21.7426Z" fill="#D7C1B3" stroke="#D7C1B3" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
14
|
-
<path d="M9.38606 21.7426L12.1544 23.0521L12.1368 22.2348L12.3566 20.2925L9.38606 21.7426Z" fill="#D7C1B3" stroke="#D7C1B3" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
15
|
-
<path d="M12.1984 17.0056L9.72002 16.2762L11.4689 15.4765L12.1984 17.0056Z" fill="#233447" stroke="#233447" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
16
|
-
<path d="M15.7928 17.0056L16.5223 15.4765L18.28 16.2762L15.7928 17.0056Z" fill="#233447" stroke="#233447" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
17
|
-
<path d="M9.38606 21.7426L9.80791 18.1745L7.05712 18.2536L9.38606 21.7426Z" fill="#CD6116" stroke="#CD6116" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
18
|
-
<path d="M18.1921 18.1745L18.6139 21.7426L20.9429 18.2536L18.1921 18.1745Z" fill="#CD6116" stroke="#CD6116" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
19
|
-
<path d="M20.2837 14.2461L15.3446 14.4658L15.8016 17.0057L16.5311 15.4765L18.2888 16.2762L20.2837 14.2461Z" fill="#CD6116" stroke="#CD6116" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
20
|
-
<path d="M9.72002 16.2762L11.4777 15.4765L12.1984 17.0057L12.6642 14.4658L7.71626 14.2461L9.72002 16.2762Z" fill="#CD6116" stroke="#CD6116" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
21
|
-
<path d="M7.71626 14.2461L9.79033 18.2888L9.72002 16.2762L7.71626 14.2461Z" fill="#E4751F" stroke="#E4751F" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
22
|
-
<path d="M18.2888 16.2762L18.2009 18.2888L20.2837 14.2461L18.2888 16.2762Z" fill="#E4751F" stroke="#E4751F" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
23
|
-
<path d="M12.6642 14.4658L12.1984 17.0057L12.7784 20.0025L12.9102 16.0565L12.6642 14.4658Z" fill="#E4751F" stroke="#E4751F" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
24
|
-
<path d="M15.3446 14.4658L15.1073 16.0477L15.2128 20.0025L15.8016 17.0057L15.3446 14.4658Z" fill="#E4751F" stroke="#E4751F" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
25
|
-
<path d="M15.8016 17.0056L15.2128 20.0025L15.6347 20.2925L18.2009 18.2888L18.2888 16.2762L15.8016 17.0056Z" fill="#F6851B" stroke="#F6851B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
26
|
-
<path d="M9.72002 16.2762L9.79033 18.2888L12.3566 20.2925L12.7784 20.0025L12.1984 17.0056L9.72002 16.2762Z" fill="#F6851B" stroke="#F6851B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
27
|
-
<path d="M15.8456 23.0521L15.8719 22.2348L15.6522 22.0414H12.339L12.1368 22.2348L12.1544 23.0521L9.38606 21.7426L10.3528 22.5336L12.3126 23.8958H15.6786L17.6472 22.5336L18.6139 21.7426L15.8456 23.0521Z" fill="#C0AD9E" stroke="#C0AD9E" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
28
|
-
<path d="M15.6347 20.2925L15.2128 20.0025H12.7784L12.3566 20.2925L12.1368 22.2348L12.339 22.0414H15.6522L15.8719 22.2348L15.6347 20.2925Z" fill="#161616" stroke="#161616" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
29
|
-
<path d="M24.4583 10.0364L25.2053 6.45072L24.0891 3.1199L15.6347 9.39485L18.8864 12.1456L23.4827 13.4903L24.5022 12.3038L24.0628 11.9874L24.7658 11.3459L24.221 10.924L24.924 10.3879L24.4583 10.0364Z" fill="#763D16" stroke="#763D16" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
30
|
-
<path d="M2.79472 6.45072L3.54174 10.0364L3.06717 10.3879L3.77024 10.924L3.23415 11.3459L3.93722 11.9874L3.4978 12.3038L4.50847 13.4903L9.10483 12.1456L12.3566 9.39485L3.90207 3.1199L2.79472 6.45072Z" fill="#763D16" stroke="#763D16" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
31
|
-
<path d="M23.4827 13.4903L18.8864 12.1456L20.2837 14.2461L18.2009 18.2888L20.9429 18.2536H25.0295L23.4827 13.4903Z" fill="#F6851B" stroke="#F6851B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
32
|
-
<path d="M9.10484 12.1456L4.50848 13.4903L2.97929 18.2536H7.05713L9.79033 18.2888L7.71626 14.2461L9.10484 12.1456Z" fill="#F6851B" stroke="#F6851B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
33
|
-
<path d="M15.3446 14.4658L15.6347 9.39485L16.9705 5.7828H11.0383L12.3566 9.39485L12.6642 14.4658L12.7696 16.0653L12.7784 20.0025H15.2128L15.2304 16.0653L15.3446 14.4658Z" fill="#F6851B" stroke="#F6851B" stroke-width="0.0878845" stroke-linecap="round" stroke-linejoin="round"/>
|
|
34
|
-
</svg>
|
|
35
|
-
`;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { styled } from 'styled-components';
|
|
2
|
-
import { formatAddress } from '../../utils/formatter';
|
|
3
|
-
|
|
4
|
-
const WalletInfoButton = styled.button`
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
gap: 10px;
|
|
8
|
-
`;
|
|
9
|
-
|
|
10
|
-
export function ConnectedInfo({ avatar, walletAddress, onClick, className }: any) {
|
|
11
|
-
return (
|
|
12
|
-
<WalletInfoButton className={className} onClick={() => onClick()}>
|
|
13
|
-
{avatar?.text}
|
|
14
|
-
<span>{formatAddress(walletAddress)}</span>
|
|
15
|
-
</WalletInfoButton>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import { useWalletKit, AppModal } from '../../hooks/useWalletKit';
|
|
3
|
-
import { ConnectedInfo } from './ConnectedInfo';
|
|
4
|
-
import { SupportWallet } from '@web3jskit/wallethelper';
|
|
5
|
-
import { useEffect } from 'react';
|
|
6
|
-
|
|
7
|
-
interface ConnectButtonProps {
|
|
8
|
-
text?: string;
|
|
9
|
-
showAvatar?: boolean;
|
|
10
|
-
buttonClass?: string;
|
|
11
|
-
infoClass?: string;
|
|
12
|
-
supportWallets?: SupportWallet[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function ConnectButton(props: ConnectButtonProps) {
|
|
16
|
-
const { t } = useTranslation();
|
|
17
|
-
|
|
18
|
-
const { text = t('connectWallet'), showAvatar = true, buttonClass, infoClass, supportWallets = [] } = props;
|
|
19
|
-
const { avatar, connectStatus, walletAddress, openModal, setSupportWallets } = useWalletKit();
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
setSupportWallets(supportWallets);
|
|
23
|
-
}, []);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div>
|
|
27
|
-
{connectStatus === 'connected' ? (
|
|
28
|
-
<ConnectedInfo
|
|
29
|
-
className={infoClass}
|
|
30
|
-
avatar={showAvatar ? avatar : undefined}
|
|
31
|
-
walletAddress={walletAddress}
|
|
32
|
-
onClick={() => {
|
|
33
|
-
openModal(AppModal.InfoModal);
|
|
34
|
-
}}
|
|
35
|
-
/>
|
|
36
|
-
) : (
|
|
37
|
-
<button
|
|
38
|
-
className={buttonClass}
|
|
39
|
-
onClick={() => {
|
|
40
|
-
openModal(AppModal.ConnectModal);
|
|
41
|
-
}}
|
|
42
|
-
>
|
|
43
|
-
{text}
|
|
44
|
-
</button>
|
|
45
|
-
)}
|
|
46
|
-
</div>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import ModalHeader from '../Header/ModalHeader';
|
|
3
|
-
import SpinSvg from '../SVGs/spinSvg';
|
|
4
|
-
import ConnectingContainer from './style';
|
|
5
|
-
|
|
6
|
-
interface ConnectingProps {
|
|
7
|
-
wallet: any;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function Connecting({ wallet }: ConnectingProps) {
|
|
11
|
-
const { t } = useTranslation();
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<>
|
|
15
|
-
<ModalHeader className="mainTitle" />
|
|
16
|
-
<ConnectingContainer>
|
|
17
|
-
<div className="logo">
|
|
18
|
-
<img src={wallet?.icon} alt={wallet?.name} />
|
|
19
|
-
</div>
|
|
20
|
-
<div className="introduce">{`${t('opening')} ${wallet?.name} ${t('title')}...`}</div>
|
|
21
|
-
<div className="detail">{t('confirmConnection')}</div>
|
|
22
|
-
<SpinSvg className="loading" />
|
|
23
|
-
</ConnectingContainer>
|
|
24
|
-
</>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { styled } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const ConnectingContainer = styled.div`
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
align-items: center;
|
|
7
|
-
margin-top: 72px;
|
|
8
|
-
font-family: Manrope;
|
|
9
|
-
|
|
10
|
-
.logo {
|
|
11
|
-
img {
|
|
12
|
-
width: 66px;
|
|
13
|
-
height: 66px;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.introduce {
|
|
18
|
-
margin-top: 44px;
|
|
19
|
-
font-size: 14px;
|
|
20
|
-
font-weight: 700;
|
|
21
|
-
line-height: 14px;
|
|
22
|
-
color: ${({ theme }) => theme.textColor};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.detail {
|
|
26
|
-
margin-top: 30px;
|
|
27
|
-
font-size: 14px;
|
|
28
|
-
font-weight: 700;
|
|
29
|
-
line-height: 14px;
|
|
30
|
-
color: ${({ theme }) => theme.textColor5};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.loading {
|
|
34
|
-
margin-top: 24px;
|
|
35
|
-
animation: spin 1s linear infinite;
|
|
36
|
-
|
|
37
|
-
path {
|
|
38
|
-
fill: ${({ theme }) => theme.spinColor};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@keyframes spin {
|
|
43
|
-
100% {
|
|
44
|
-
transform: rotate(360deg);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@media (max-width: 768px) {
|
|
49
|
-
margin-top: 36px;
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
|
|
53
|
-
export default ConnectingContainer;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import ModalHeader from '../Header/ModalHeader';
|
|
4
|
-
import GetWalletContainer from './style';
|
|
5
|
-
import { chromeIcon } from '../../assets/svg/dataBase';
|
|
6
|
-
// import QRCode from 'react-qr-code';
|
|
7
|
-
import { QRCodeSVG } from 'qrcode.react';
|
|
8
|
-
|
|
9
|
-
interface GetWalletProps {
|
|
10
|
-
wallet: any;
|
|
11
|
-
onBack?: () => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function GetWallet({ wallet, onBack }: GetWalletProps) {
|
|
15
|
-
const { t } = useTranslation();
|
|
16
|
-
|
|
17
|
-
const [showQRCode, setShowQRCode] = useState(false);
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<GetWalletContainer>
|
|
21
|
-
<ModalHeader
|
|
22
|
-
title={`${t('get')} ${wallet.name}`}
|
|
23
|
-
onBack={() => {
|
|
24
|
-
if (showQRCode) {
|
|
25
|
-
return setShowQRCode(false);
|
|
26
|
-
}
|
|
27
|
-
onBack && onBack();
|
|
28
|
-
}}
|
|
29
|
-
/>
|
|
30
|
-
{showQRCode ? (
|
|
31
|
-
<div className="qrCodeBox">
|
|
32
|
-
<div className="downloadTip">{t('getAppTip')}</div>
|
|
33
|
-
<div className="qrCode">
|
|
34
|
-
{/* <QRCode value={wallet.downloadUrl} /> */}
|
|
35
|
-
<QRCodeSVG
|
|
36
|
-
value={wallet.downloadUrl}
|
|
37
|
-
size={270}
|
|
38
|
-
imageSettings={{
|
|
39
|
-
src: wallet.icon,
|
|
40
|
-
height: 24,
|
|
41
|
-
width: 24,
|
|
42
|
-
excavate: true
|
|
43
|
-
}}
|
|
44
|
-
/>
|
|
45
|
-
,
|
|
46
|
-
</div>
|
|
47
|
-
<div className="button" onClick={() => setShowQRCode(false)}>
|
|
48
|
-
{t('continue')}
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
) : (
|
|
52
|
-
<div className="cardBox">
|
|
53
|
-
<div className="card">
|
|
54
|
-
<img src={chromeIcon} alt="Chrome" />
|
|
55
|
-
<div>
|
|
56
|
-
<div className="title">{`${wallet.name} ${t('forChrome')}`}</div>
|
|
57
|
-
<div className="description">{t('chromeDescription')}</div>
|
|
58
|
-
<div
|
|
59
|
-
className="button"
|
|
60
|
-
onClick={() => {
|
|
61
|
-
window.open(wallet.extension, '_blank');
|
|
62
|
-
}}
|
|
63
|
-
>
|
|
64
|
-
{t('addToChrome')}
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
<div className="card">
|
|
69
|
-
<img src={wallet.icon} alt={wallet.name} />
|
|
70
|
-
<div>
|
|
71
|
-
<div className="title">{`${wallet.name} ${t('forMobile')}`}</div>
|
|
72
|
-
<div className="description">{t('mobileDescription')}</div>
|
|
73
|
-
<div className="button" onClick={() => setShowQRCode(true)}>
|
|
74
|
-
{t('getMobileApp')}
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
)}
|
|
80
|
-
</GetWalletContainer>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { styled } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const GetWalletContainer = styled.div`
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
font-family: Manrope;
|
|
7
|
-
color: ${({ theme }) => theme.textColor1};
|
|
8
|
-
height: 100%;
|
|
9
|
-
|
|
10
|
-
.cardBox {
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
margin: 0 64px 24px;
|
|
14
|
-
gap: 24px;
|
|
15
|
-
flex: 1;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.card {
|
|
19
|
-
display: flex;
|
|
20
|
-
gap: 24px;
|
|
21
|
-
padding: 40px 60px 0;
|
|
22
|
-
border: 1px solid ${({ theme }) => theme.borderColor};
|
|
23
|
-
border-radius: 12px;
|
|
24
|
-
flex: 1;
|
|
25
|
-
background: ${({ theme }) => theme.cardBg};
|
|
26
|
-
|
|
27
|
-
img {
|
|
28
|
-
width: 60px;
|
|
29
|
-
height: 60px;
|
|
30
|
-
border-radius: 12px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.title {
|
|
34
|
-
font-size: 14px;
|
|
35
|
-
font-weight: 700;
|
|
36
|
-
line-height: 14px;
|
|
37
|
-
color: ${({ theme }) => theme.textColor};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.description {
|
|
41
|
-
margin-top: 10px;
|
|
42
|
-
font-size: 12px;
|
|
43
|
-
font-weight: 500;
|
|
44
|
-
line-height: 14px;
|
|
45
|
-
color: ${({ theme }) => theme.textColor3};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.button {
|
|
49
|
-
margin-top: 18px;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.button {
|
|
54
|
-
display: inline-block;
|
|
55
|
-
padding: 11px 16px;
|
|
56
|
-
color: ${({ theme }) => theme.buttonColor};
|
|
57
|
-
background: ${({ theme }) => theme.buttonBg};
|
|
58
|
-
font-size: 14px;
|
|
59
|
-
font-weight: 700;
|
|
60
|
-
line-height: 14px;
|
|
61
|
-
text-align: center;
|
|
62
|
-
border-radius: 8px;
|
|
63
|
-
box-sizing: border-box;
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
height: 36px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.qrCodeBox {
|
|
69
|
-
display: flex;
|
|
70
|
-
flex-direction: column;
|
|
71
|
-
align-items: center;
|
|
72
|
-
justify-content: space-between;
|
|
73
|
-
flex: 1;
|
|
74
|
-
|
|
75
|
-
.downloadTip {
|
|
76
|
-
text-align: center;
|
|
77
|
-
font-size: 14px;
|
|
78
|
-
font-weight: 600;
|
|
79
|
-
line-height: 18px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.qrCode {
|
|
83
|
-
margin-top: 24px;
|
|
84
|
-
display: flex;
|
|
85
|
-
justify-content: center;
|
|
86
|
-
align-items: center;
|
|
87
|
-
width: 270px;
|
|
88
|
-
height: 270px;
|
|
89
|
-
border-radius: 12px;
|
|
90
|
-
border: 1px solid ${({ theme }) => theme.borderColor};
|
|
91
|
-
font-size: 0;
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.button {
|
|
96
|
-
margin-top: auto;
|
|
97
|
-
margin-bottom: 24px;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@media (max-width: 768px) {
|
|
102
|
-
.cardBox {
|
|
103
|
-
margin: 0 24px 24px;
|
|
104
|
-
|
|
105
|
-
.card {
|
|
106
|
-
padding: 35px 24px;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.qrCodeBox {
|
|
111
|
-
.button {
|
|
112
|
-
margin-top: 16px;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
`;
|
|
117
|
-
|
|
118
|
-
export default GetWalletContainer;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { walletKitStore } from '../../stores';
|
|
2
|
-
import ModalHeaderBox from './style';
|
|
3
|
-
import BackArrowSvg from '../SVGs/backArrowSvg';
|
|
4
|
-
import CloseSvg from '../SVGs/closeSvg';
|
|
5
|
-
|
|
6
|
-
interface ModalHeaderProps {
|
|
7
|
-
title?: string | null;
|
|
8
|
-
onBack?: () => void;
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default function ModalHeader({ title = '', onBack, className }: ModalHeaderProps) {
|
|
13
|
-
const useCloseModal = walletKitStore((state: any) => state.closeModal);
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<ModalHeaderBox className={className}>
|
|
17
|
-
{onBack ? <BackArrowSvg className="backBtn" onClick={onBack} /> : <div className="backBtn"></div>}
|
|
18
|
-
{title ? <div className="title">{title}</div> : <div></div>}
|
|
19
|
-
<div className="closeBtn" onClick={useCloseModal}>
|
|
20
|
-
<CloseSvg />
|
|
21
|
-
</div>
|
|
22
|
-
</ModalHeaderBox>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { styled } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const ModalHeaderBox = styled.div`
|
|
4
|
-
width: 100%;
|
|
5
|
-
height: 56px;
|
|
6
|
-
position: relative;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: space-between;
|
|
10
|
-
flex-shrink: 0;
|
|
11
|
-
|
|
12
|
-
.backBtn {
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
margin-left: 16px;
|
|
15
|
-
|
|
16
|
-
path {
|
|
17
|
-
fill: ${({ theme }) => theme.backArrowColor};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.title {
|
|
22
|
-
color: ${({ theme }) => theme.textColor};
|
|
23
|
-
font-size: 16px;
|
|
24
|
-
font-weight: 700;
|
|
25
|
-
line-height: 170%;
|
|
26
|
-
letter-spacing: 0.3px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.closeBtn {
|
|
30
|
-
margin-right: 16px;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
width: 24px;
|
|
36
|
-
height: 24px;
|
|
37
|
-
border-radius: 12px;
|
|
38
|
-
transition: all 0.2s;
|
|
39
|
-
color: ${({ theme }) => theme.closeBtnColor};
|
|
40
|
-
transform-origin: 50% 50%;
|
|
41
|
-
background-color: ${({ theme }) => theme.closeBtnBg};
|
|
42
|
-
z-index: 1;
|
|
43
|
-
|
|
44
|
-
&:hover {
|
|
45
|
-
background-color: ${({ theme }) => theme.closeBtnHoverBg};
|
|
46
|
-
transform: rotate(180deg);
|
|
47
|
-
transition: all 0.2s;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&.asideTitle {
|
|
52
|
-
justify-content: flex-start;
|
|
53
|
-
|
|
54
|
-
.closeBtn {
|
|
55
|
-
display: none;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@media (max-width: 768px) {
|
|
60
|
-
&.mainTitle {
|
|
61
|
-
display: none;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&.asideTitle {
|
|
65
|
-
justify-content: space-between;
|
|
66
|
-
|
|
67
|
-
.closeBtn {
|
|
68
|
-
display: flex;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
|
-
export default ModalHeaderBox;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { styled } from 'styled-components';
|
|
3
|
-
|
|
4
|
-
interface IconImageArg {
|
|
5
|
-
src: any;
|
|
6
|
-
width?: number | string;
|
|
7
|
-
height?: number | string;
|
|
8
|
-
borderRadius?: string;
|
|
9
|
-
isRadius?: boolean;
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface FoldIconImageArg {
|
|
14
|
-
src: Array<string>;
|
|
15
|
-
width?: number | string;
|
|
16
|
-
height?: number | string;
|
|
17
|
-
offset?: number;
|
|
18
|
-
proportion?: number;
|
|
19
|
-
className?: string;
|
|
20
|
-
isRadius?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const IconImage = styled.img`
|
|
24
|
-
display: block;
|
|
25
|
-
transition: all 0.2s;
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
const IconImageBox = styled.div`
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
display: flex;
|
|
31
|
-
position: relative;
|
|
32
|
-
`;
|
|
33
|
-
const IconItem = styled.div`
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
float: left;
|
|
36
|
-
display: flex;
|
|
37
|
-
justify-items: center;
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
export const Icon: React.FC<IconImageArg> = ({ src, width, height, className }) => {
|
|
41
|
-
return (
|
|
42
|
-
<IconImage
|
|
43
|
-
className={className}
|
|
44
|
-
src={src}
|
|
45
|
-
width={width ? width + 'px' : '24px'}
|
|
46
|
-
height={height ? height + 'px' : '24px'}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const Image: React.FC<IconImageArg> = ({ src, width, height, isRadius = true, className, borderRadius }) => {
|
|
52
|
-
return (
|
|
53
|
-
<IconImage
|
|
54
|
-
className={className}
|
|
55
|
-
src={src}
|
|
56
|
-
width={width ? width : 'auto'}
|
|
57
|
-
height={height ? height : 'auto'}
|
|
58
|
-
style={{ borderRadius: borderRadius ? borderRadius : isRadius ? '50%' : '0' }}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const FoldIconBox: React.FC<FoldIconImageArg> = ({ src, width, height, offset = 0, isRadius = true }) => {
|
|
64
|
-
return (
|
|
65
|
-
<IconImageBox>
|
|
66
|
-
{src.map((item, index) => {
|
|
67
|
-
return (
|
|
68
|
-
<IconItem
|
|
69
|
-
key={index}
|
|
70
|
-
style={{
|
|
71
|
-
zIndex: index + 1,
|
|
72
|
-
marginLeft: index == 0 ? '0px' : offset + 'px',
|
|
73
|
-
width: width ? width + 'px' : '24px',
|
|
74
|
-
height: height ? height + 'px' : '24px'
|
|
75
|
-
}}
|
|
76
|
-
>
|
|
77
|
-
<IconImage
|
|
78
|
-
src={item}
|
|
79
|
-
width={width ? width : 24}
|
|
80
|
-
height={height ? height : 24}
|
|
81
|
-
style={{ borderRadius: isRadius ? '50%' : '0' }}
|
|
82
|
-
/>
|
|
83
|
-
</IconItem>
|
|
84
|
-
);
|
|
85
|
-
})}
|
|
86
|
-
</IconImageBox>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
89
|
-
export const FoldIconBoxBig: React.FC<FoldIconImageArg> = ({ src, width, height, offset = 0, proportion = 1 }) => {
|
|
90
|
-
return (
|
|
91
|
-
<IconImageBox>
|
|
92
|
-
{src.map((item, index) => {
|
|
93
|
-
return (
|
|
94
|
-
<IconItem
|
|
95
|
-
key={index}
|
|
96
|
-
style={{
|
|
97
|
-
zIndex: index + 1,
|
|
98
|
-
marginLeft: index == 0 ? '0px' : offset + 'px',
|
|
99
|
-
marginTop: index == 0 ? '0px' : -(offset / 2) + 'px',
|
|
100
|
-
width: width ? width + 'px' : '24px',
|
|
101
|
-
height: height ? height + 'px' : '24px'
|
|
102
|
-
}}
|
|
103
|
-
>
|
|
104
|
-
{index === src.length - 1 ? (
|
|
105
|
-
<IconImage
|
|
106
|
-
src={item}
|
|
107
|
-
width={width ? Number(width) * proportion : 24 * proportion}
|
|
108
|
-
height={height ? Number(height) * proportion : 24 * proportion}
|
|
109
|
-
/>
|
|
110
|
-
) : (
|
|
111
|
-
<IconImage src={item} width={width ? width : 24} height={height ? height : 24} />
|
|
112
|
-
)}
|
|
113
|
-
</IconItem>
|
|
114
|
-
);
|
|
115
|
-
})}
|
|
116
|
-
</IconImageBox>
|
|
117
|
-
);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export default Icon;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import ModalHeader from '../Header/ModalHeader';
|
|
3
|
-
import IntroduceContainer from './style';
|
|
4
|
-
|
|
5
|
-
interface IntroduceProps {
|
|
6
|
-
onGetWallet?: () => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function Introduce({ onGetWallet }: IntroduceProps) {
|
|
10
|
-
const { t } = useTranslation();
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<>
|
|
14
|
-
<ModalHeader className="mainTitle" />
|
|
15
|
-
<IntroduceContainer>
|
|
16
|
-
<div className="title">{t('introduceQuestion')}</div>
|
|
17
|
-
<div className="introduce">{t('introduceAnswer')}</div>
|
|
18
|
-
<div className="detail">{t('introduceDetail')}</div>
|
|
19
|
-
<div className="footer">
|
|
20
|
-
<div className="button" onClick={() => onGetWallet?.()}>
|
|
21
|
-
{t('getWallet')}
|
|
22
|
-
</div>
|
|
23
|
-
{/* <span className="more" onClick={() => {}}>
|
|
24
|
-
{t('learnMore')}
|
|
25
|
-
</span> */}
|
|
26
|
-
</div>
|
|
27
|
-
</IntroduceContainer>
|
|
28
|
-
</>
|
|
29
|
-
);
|
|
30
|
-
}
|