@arcblock/ux 2.6.8 → 2.7.0

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.
Files changed (164) hide show
  1. package/babel.config.es.js +12 -0
  2. package/es/ActionButton/index.js +99 -0
  3. package/es/ActivityIndicator/index.js +180 -0
  4. package/es/Address/compact-text.js +105 -0
  5. package/es/Address/did-address.js +211 -0
  6. package/es/Address/index.js +23 -0
  7. package/es/Address/responsive-did-address.js +88 -0
  8. package/es/Alert/index.js +134 -0
  9. package/es/AnimationWaiter/default-animation.json +1 -0
  10. package/es/AnimationWaiter/index.js +239 -0
  11. package/es/Async/index.js +38 -0
  12. package/es/Avatar/did-motif.js +64 -0
  13. package/es/Avatar/etherscan-blockies.js +83 -0
  14. package/es/Avatar/index.js +176 -0
  15. package/es/Badge/index.js +98 -0
  16. package/es/Blocklet/blocklet.js +298 -0
  17. package/es/Blocklet/index.js +4 -0
  18. package/es/Blocklet/utils.js +52 -0
  19. package/es/BlockletNFT/index.js +412 -0
  20. package/es/Button/index.js +8 -0
  21. package/es/Button/wrap.js +140 -0
  22. package/es/ButtonGroup/index.js +6 -0
  23. package/es/CardSelector/index.js +131 -0
  24. package/es/Center/index.js +41 -0
  25. package/es/ClickToCopy/copy-button.js +72 -0
  26. package/es/ClickToCopy/hook.js +39 -0
  27. package/es/ClickToCopy/index.js +93 -0
  28. package/es/CodeBlock/LightBox.js +85 -0
  29. package/es/CodeBlock/index.js +226 -0
  30. package/es/Colors/index.js +2 -0
  31. package/es/Colors/themes/default.js +78 -0
  32. package/es/ContactForm/index.js +230 -0
  33. package/es/CookieConsent/index.js +113 -0
  34. package/es/CountDown/index.js +178 -0
  35. package/es/DID/index.js +105 -0
  36. package/es/Datatable/CustomToolbar.js +396 -0
  37. package/es/Datatable/DatatableContext.js +34 -0
  38. package/es/Datatable/TableSearch.js +165 -0
  39. package/es/Datatable/index.js +627 -0
  40. package/es/Datatable/utils.js +132 -0
  41. package/es/Dialog/confirm.js +90 -0
  42. package/es/Dialog/dialog.js +192 -0
  43. package/es/Dialog/index.js +3 -0
  44. package/es/DidLogo/index.js +31 -0
  45. package/es/DriftBot/index.js +70 -0
  46. package/es/Earth/countries.json +8057 -0
  47. package/es/Earth/index.js +521 -0
  48. package/es/Earth/util.js +51 -0
  49. package/es/Empty/index.js +64 -0
  50. package/es/ErrorBoundary/fallback.js +73 -0
  51. package/es/ErrorBoundary/index.js +1 -0
  52. package/es/Footer/index.js +172 -0
  53. package/es/Header/auto-hidden.js +35 -0
  54. package/es/Header/header.js +211 -0
  55. package/es/Header/index.js +2 -0
  56. package/es/Header/responsive-header.js +111 -0
  57. package/es/Icon/image.js +65 -0
  58. package/es/Icon/index.js +84 -0
  59. package/es/Img/index.js +217 -0
  60. package/es/InfoRow/index.js +87 -0
  61. package/es/Layout/dashboard/external-link.js +58 -0
  62. package/es/Layout/dashboard/full-page.js +53 -0
  63. package/es/Layout/dashboard/index.js +275 -0
  64. package/es/Layout/dashboard/sidebar.js +209 -0
  65. package/es/Layout/dashboard-legacy/header.js +174 -0
  66. package/es/Layout/dashboard-legacy/index.js +149 -0
  67. package/es/Layout/dashboard-legacy/sidebar.js +129 -0
  68. package/es/Layout/index.js +335 -0
  69. package/es/Locale/browser-lang.js +52 -0
  70. package/es/Locale/context.js +114 -0
  71. package/es/Locale/languages.js +60 -0
  72. package/es/Locale/selector.js +180 -0
  73. package/es/Locale/util.js +13 -0
  74. package/es/Logo/images/logo-dark-text.svg +3 -0
  75. package/es/Logo/images/logo-dark-top.svg +6 -0
  76. package/es/Logo/images/logo-light-text.svg +3 -0
  77. package/es/Logo/images/logo-light-top.svg +6 -0
  78. package/es/Logo/index.js +136 -0
  79. package/es/Metric/index.js +132 -0
  80. package/es/NFTDisplay/README.md +59 -0
  81. package/es/NFTDisplay/aspect-ratio-container.js +39 -0
  82. package/es/NFTDisplay/broken.js +18 -0
  83. package/es/NFTDisplay/demo/data/asset-state-display-url.json +7 -0
  84. package/es/NFTDisplay/demo/data/asset-state-gzipped-svg-1-1.json +10 -0
  85. package/es/NFTDisplay/demo/data/asset-state-gzipped-svg-374-130.json +10 -0
  86. package/es/NFTDisplay/demo/data/asset-state-gzipped-svg-with-foreign-object.json +20 -0
  87. package/es/NFTDisplay/demo/data/asset-state-svg.json +29 -0
  88. package/es/NFTDisplay/demo/data/asset-state-url.json +10 -0
  89. package/es/NFTDisplay/index.js +323 -0
  90. package/es/NFTDisplay/loading.js +18 -0
  91. package/es/NFTDisplay/svg-embedder/img.js +45 -0
  92. package/es/NFTDisplay/svg-embedder/inline-svg.js +39 -0
  93. package/es/NavMenu/index.js +2 -0
  94. package/es/NavMenu/nav-menu.js +286 -0
  95. package/es/NavMenu/style.js +176 -0
  96. package/es/PageScroller/index.js +286 -0
  97. package/es/PageScroller/story/FifthComponent.js +9 -0
  98. package/es/PageScroller/story/FirstComponent.js +9 -0
  99. package/es/PageScroller/story/FourthComponent.js +12 -0
  100. package/es/PageScroller/story/FullPage.js +47 -0
  101. package/es/PageScroller/story/PageContain.js +59 -0
  102. package/es/PageScroller/story/SecondComponent.js +9 -0
  103. package/es/PageScroller/story/ThirdComponent.js +9 -0
  104. package/es/PageScroller/story/index.css +115 -0
  105. package/es/PageScroller/usePrevValue.js +9 -0
  106. package/es/PricingTable/PricingPlan.js +124 -0
  107. package/es/PricingTable/index.js +53 -0
  108. package/es/QRCode/index.js +72 -0
  109. package/es/RelativeTime/index.js +98 -0
  110. package/es/Result/common.js +140 -0
  111. package/es/Result/demo/fixtures/result-image-404.svg +1 -0
  112. package/es/Result/index.js +33 -0
  113. package/es/Result/result.js +59 -0
  114. package/es/Result/translations.js +54 -0
  115. package/es/Screenshot/BaseScreenshot/index.js +91 -0
  116. package/es/Screenshot/BaseScreenshot/shells/Macbook.js +51 -0
  117. package/es/Screenshot/BaseScreenshot/shells/Phone.js +36 -0
  118. package/es/Screenshot/demo/images/bg-00.jpg +0 -0
  119. package/es/Screenshot/demo/images/bg-01.jpg +0 -0
  120. package/es/Screenshot/demo/images/bg-02.jpg +0 -0
  121. package/es/Screenshot/demo/images/bg-03.jpg +0 -0
  122. package/es/Screenshot/demo/images/bg-04.jpg +0 -0
  123. package/es/Screenshot/demo/images/bg-05.jpg +0 -0
  124. package/es/Screenshot/demo/images/bg-06.jpg +0 -0
  125. package/es/Screenshot/demo/images/bg-07.jpg +0 -0
  126. package/es/Screenshot/demo/images/bg-08.jpg +0 -0
  127. package/es/Screenshot/demo/images/bg-09.jpg +0 -0
  128. package/es/Screenshot/devices.css +1366 -0
  129. package/es/Screenshot/index.js +299 -0
  130. package/es/SessionManager/federated-login-detecter.js +166 -0
  131. package/es/SessionManager/index.js +468 -0
  132. package/es/SessionManager/user-popper.js +132 -0
  133. package/es/Sparkline/index.js +193 -0
  134. package/es/Spinner/index.js +28 -0
  135. package/es/SplitButton/index.js +144 -0
  136. package/es/Switch/index.js +96 -0
  137. package/es/Tabs/index.js +48 -0
  138. package/es/Tag/index.js +108 -0
  139. package/es/TextCollapse/index.js +92 -0
  140. package/es/Theme/index.js +16 -0
  141. package/es/Theme/theme-provider.js +39 -0
  142. package/es/Theme/theme.js +133 -0
  143. package/es/Toast/index.js +95 -0
  144. package/es/Util/deprecate.js +28 -0
  145. package/es/Util/index.js +298 -0
  146. package/es/Util/wallet.js +32 -0
  147. package/es/Video/index.js +89 -0
  148. package/es/Wallet/Action.js +119 -0
  149. package/es/Wallet/Download.js +331 -0
  150. package/es/Wallet/Open.js +45 -0
  151. package/es/Wallet/images/abtwallet.png +0 -0
  152. package/es/Wallet/images/android_download.svg +23 -0
  153. package/es/Wallet/images/app-store.svg +20 -0
  154. package/es/Wallet/images/google-play.svg +70 -0
  155. package/es/WebWalletSWKeeper/index.js +115 -0
  156. package/es/WechatPrompt/images/android.png +0 -0
  157. package/es/WechatPrompt/images/ios.png +0 -0
  158. package/es/WechatPrompt/index.js +88 -0
  159. package/es/index.js +38 -0
  160. package/es/withTheme/index.js +69 -0
  161. package/es/withTracker/README.md +34 -0
  162. package/es/withTracker/error_boundary.js +34 -0
  163. package/es/withTracker/index.js +56 -0
  164. package/package.json +272 -5
@@ -0,0 +1,32 @@
1
+ /* eslint-disable import/prefer-default-export */
2
+ export const providerName = 'wallet_url';
3
+
4
+ /**
5
+ * 获取 web wallet url, 常用于为 did connect 组件传递 webWalletUrl 参数,
6
+ * 更明确的说, 这里获取的应该是 **default web wallet url**,
7
+ * 如果用户使用自定义的 web wallet url, 不应该使用该方法, 应该显式的将自定义的 web wallet url 传递给 did connect 组件
8
+ * (参考: https://github.com/blocklet/ocap-playground/issues/98)
9
+ *
10
+ * 获取优先级:
11
+ * - localStorage 使用 provider 注册
12
+ * - window.env.webWalletUrl
13
+ * - window.blocklet.webWalletUrl
14
+ * - production web wallet url
15
+ */
16
+ export const getWebWalletUrl = () => {
17
+ return window.localStorage.getItem(providerName) || window.env?.webWalletUrl || window.blocklet?.webWalletUrl || 'https://web.abtwallet.io/';
18
+ };
19
+
20
+ // 检查 wallet url protocol 和当前页面地址的 protocol 是否一致
21
+ export const checkSameProtocol = webWalletUrl => {
22
+ const {
23
+ protocol
24
+ } = window.location;
25
+ let walletProtocol = '';
26
+ try {
27
+ walletProtocol = new URL(webWalletUrl).protocol;
28
+ } catch (error) {
29
+ walletProtocol = '';
30
+ }
31
+ return protocol === walletProtocol;
32
+ };
@@ -0,0 +1,89 @@
1
+ import { useState } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import Player from 'react-player';
4
+ import CircularProgress from '@mui/material/CircularProgress';
5
+ import { mergeProps } from '../Util';
6
+ import { styled } from '../Theme';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ const {
10
+ string,
11
+ number,
12
+ array,
13
+ oneOfType,
14
+ object
15
+ } = PropTypes;
16
+ export default function Video(props) {
17
+ const newProps = mergeProps(props, Video, ['style']);
18
+ const {
19
+ url,
20
+ width,
21
+ height,
22
+ style
23
+ } = newProps;
24
+ const [loaded, setLoaded] = useState(false);
25
+ const styles = Object.assign({
26
+ border: 'none'
27
+ }, style, {
28
+ width,
29
+ height,
30
+ visibility: loaded ? 'visible' : 'hidden'
31
+ });
32
+ if (url.indexOf('v.qq.com') > 0) {
33
+ return /*#__PURE__*/_jsxs(Placeholder, {
34
+ style: {
35
+ width,
36
+ height
37
+ },
38
+ children: [/*#__PURE__*/_jsx("iframe", {
39
+ title: url,
40
+ style: styles,
41
+ src: url,
42
+ onLoad: () => setLoaded(true),
43
+ allowFullScreen: true
44
+ }), !loaded && /*#__PURE__*/_jsx(CircularProgress, {
45
+ className: "loading-indicator",
46
+ color: "primary"
47
+ })]
48
+ });
49
+ }
50
+ return /*#__PURE__*/_jsxs(Placeholder, {
51
+ style: {
52
+ width,
53
+ height
54
+ },
55
+ children: [/*#__PURE__*/_jsx(Player, {
56
+ style: styles,
57
+ ...newProps,
58
+ onReady: () => setLoaded(true)
59
+ }), !loaded && /*#__PURE__*/_jsx(CircularProgress, {
60
+ className: "loading-indicator",
61
+ color: "primary"
62
+ })]
63
+ });
64
+ }
65
+ Video.propTypes = {
66
+ url: oneOfType([string, array, object]).isRequired,
67
+ width: oneOfType([string, number]),
68
+ height: oneOfType([string, number]),
69
+ style: oneOfType([string, object])
70
+ };
71
+ Video.defaultProps = {
72
+ width: 640,
73
+ height: 400,
74
+ style: {}
75
+ };
76
+ const Placeholder = styled('div')`
77
+ background-color: #222222;
78
+ display: flex;
79
+ justify-content: center;
80
+ align-items: center;
81
+ position: relative;
82
+
83
+ .loading-indicator {
84
+ position: absolute;
85
+ top: 45%;
86
+ left: 47%;
87
+ z-index: 2;
88
+ }
89
+ `;
@@ -0,0 +1,119 @@
1
+ import PropTypes from 'prop-types';
2
+ import Typography from '@mui/material/Typography';
3
+ import logo from './images/abtwallet.png';
4
+ import { mergeProps } from '../Util';
5
+ import colors from '../Colors';
6
+ import Button from '../Button';
7
+ import { styled } from '../Theme';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ export default function WalletAction(props) {
11
+ const newProps = mergeProps(props, WalletAction, ['style']);
12
+ const {
13
+ action,
14
+ size,
15
+ textLayout,
16
+ style = {},
17
+ ...rest
18
+ } = newProps;
19
+ const styles = Object.assign({}, style, {
20
+ border: 'none',
21
+ padding: 0
22
+ });
23
+ return /*#__PURE__*/_jsx(Button, {
24
+ style: styles,
25
+ ...rest,
26
+ variant: "outlined",
27
+ children: /*#__PURE__*/_jsxs(Content, {
28
+ size: size,
29
+ color: styles.color,
30
+ children: [/*#__PURE__*/_jsx("img", {
31
+ src: logo,
32
+ className: "wallet-action__logo",
33
+ alt: "DID Wallet"
34
+ }), textLayout === 'vertical' && /*#__PURE__*/_jsxs(Typography, {
35
+ className: "wallet-action__text",
36
+ component: "div",
37
+ children: [/*#__PURE__*/_jsxs("span", {
38
+ className: "wallet-action__action",
39
+ children: [action, " with"]
40
+ }), /*#__PURE__*/_jsx("span", {
41
+ className: "wallet-action__title",
42
+ children: "DID Wallet"
43
+ })]
44
+ }), textLayout === 'horizontal' && /*#__PURE__*/_jsxs("span", {
45
+ className: "wallet-action__title",
46
+ style: {
47
+ padding: 8
48
+ },
49
+ children: [action, " with DID Wallet"]
50
+ })]
51
+ })
52
+ });
53
+ }
54
+ WalletAction.propTypes = {
55
+ action: PropTypes.string,
56
+ size: PropTypes.oneOf(['xlarge', 'large', 'medium', 'small']),
57
+ textLayout: PropTypes.oneOf(['vertical', 'horizontal']),
58
+ style: PropTypes.oneOfType([PropTypes.object, PropTypes.string])
59
+ };
60
+ WalletAction.defaultProps = {
61
+ action: 'Login',
62
+ textLayout: 'vertical',
63
+ size: 'medium',
64
+ style: {}
65
+ };
66
+ const sizes = {
67
+ logo: {
68
+ small: 32,
69
+ medium: 44,
70
+ large: 56,
71
+ xlarge: 88
72
+ },
73
+ font: {
74
+ small: 9,
75
+ medium: 11,
76
+ large: 13,
77
+ xlarge: 18
78
+ }
79
+ };
80
+ const Content = styled('div')`
81
+ display: flex;
82
+ justify-content: center;
83
+ align-items: center;
84
+
85
+ &:hover {
86
+ opacity: 0.9;
87
+ }
88
+
89
+ .wallet-action__logo {
90
+ width: auto;
91
+ height: auto;
92
+ max-width: ${props => sizes.logo[props.size]}px;
93
+ margin-left: 5px;
94
+ }
95
+
96
+ .wallet-action__text {
97
+ padding: 8px;
98
+ display: flex;
99
+ height: 100%;
100
+ flex-direction: column;
101
+ justify-content: space-between;
102
+ align-items: flex-start;
103
+ }
104
+
105
+ .wallet-action__action {
106
+ font-size: ${props => sizes.font[props.size]}px;
107
+ text-transform: capitalize;
108
+ margin-bottom: 1px;
109
+ color: ${props => props.color || colors.primary.main};
110
+ letter-spacing: 1px;
111
+ }
112
+
113
+ .wallet-action__title {
114
+ font-size: ${props => sizes.font[props.size] * 1.5}px;
115
+ text-transform: capitalize;
116
+ color: ${props => props.color || colors.primary.main};
117
+ letter-spacing: 1px;
118
+ }
119
+ `;
@@ -0,0 +1,331 @@
1
+ import React from "react";
2
+ import PropTypes from 'prop-types';
3
+ import Typography from '@mui/material/Typography';
4
+ import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
5
+ var AppStoreIcon = function AppStoreIcon(props) {
6
+ return /*#__PURE__*/_jsxs("svg", {
7
+ ...props,
8
+ children: [/*#__PURE__*/_jsx("title", {
9
+ children: "Appstore"
10
+ }), /*#__PURE__*/_jsxs("g", {
11
+ fill: "none",
12
+ fillRule: "evenodd",
13
+ children: [/*#__PURE__*/_jsx("path", {
14
+ d: "M.198 3.792v42.064a3.594 3.594 0 0 0 3.595 3.594h164.414a3.594 3.594 0 0 0 3.595-3.594V3.792a3.594 3.594 0 0 0-3.595-3.594H3.793A3.594 3.594 0 0 0 .198 3.792z",
15
+ fill: "#000",
16
+ fillRule: "nonzero"
17
+ }), /*#__PURE__*/_jsx("path", {
18
+ d: "M65.788 38.665h2.924l-6.402-17.73H59.35l-6.402 17.73h2.826l1.634-4.706h6.759l1.622 4.706zm-5.1-14.512h.21l2.567 7.496h-5.357l2.58-7.496zm15.778.91c-1.818 0-3.391.91-4.202 2.433h-.197v-2.212h-2.543v17.719h2.642v-6.365h.209c.7 1.413 2.211 2.248 4.116 2.248 3.38 0 5.53-2.666 5.53-6.918 0-4.251-2.15-6.905-5.555-6.905zm-.75 11.452c-2.21 0-3.6-1.745-3.6-4.534 0-2.802 1.39-4.547 3.613-4.547 2.237 0 3.576 1.708 3.576 4.534 0 2.839-1.34 4.547-3.588 4.547zm14.452-11.452c-1.819 0-3.391.91-4.202 2.433h-.197v-2.212h-2.544v17.719h2.642v-6.365h.21c.7 1.413 2.211 2.248 4.116 2.248 3.379 0 5.529-2.666 5.529-6.918 0-4.251-2.15-6.905-5.554-6.905zm-.75 11.452c-2.211 0-3.6-1.745-3.6-4.534 0-2.802 1.389-4.547 3.613-4.547 2.236 0 3.575 1.708 3.575 4.534 0 2.839-1.339 4.547-3.588 4.547zm11.896-2.617c.197 3.17 2.839 5.197 6.771 5.197 4.202 0 6.832-2.125 6.832-5.517 0-2.666-1.5-4.14-5.136-4.989l-1.954-.479c-2.31-.54-3.244-1.266-3.244-2.531 0-1.598 1.45-2.642 3.625-2.642 2.064 0 3.49 1.02 3.748 2.654h2.678c-.16-2.986-2.789-5.087-6.39-5.087-3.87 0-6.45 2.101-6.45 5.26 0 2.604 1.462 4.152 4.669 4.902l2.286.553c2.346.553 3.379 1.364 3.379 2.716 0 1.572-1.622 2.715-3.834 2.715-2.372 0-4.018-1.069-4.252-2.752h-2.728zm15.877-11.858v3.305h-2.2v2.224h2.2v7.557c0 2.58 1.167 3.613 4.104 3.613.516 0 .995-.061 1.413-.135v-2.2c-.368.037-.577.062-.983.062-1.315 0-1.892-.615-1.892-2.015v-6.882h2.998v-2.224h-2.998V22.04h-2.642zm12.19 14.536c-2.298 0-3.588-1.683-3.588-4.608 0-2.9 1.29-4.595 3.588-4.595 2.286 0 3.588 1.696 3.588 4.595 0 2.913-1.302 4.608-3.588 4.608zm0 2.347c3.908 0 6.304-2.617 6.304-6.955 0-4.313-2.409-6.942-6.304-6.942-3.907 0-6.316 2.63-6.316 6.942 0 4.338 2.396 6.955 6.316 6.955zm7.509-.258h2.642v-7.9c0-1.88 1.413-3.146 3.403-3.146.443 0 1.254.086 1.463.16v-2.606c-.283-.073-.787-.11-1.168-.11-1.745 0-3.22.958-3.6 2.273h-.197v-2.052h-2.543v13.381zm13.456-11.39c1.953 0 3.231 1.363 3.293 3.465h-6.759c.148-2.09 1.512-3.465 3.466-3.465zm3.28 7.778c-.491 1.044-1.585 1.622-3.182 1.622-2.114 0-3.478-1.487-3.564-3.834v-.148h9.45v-.921c0-4.203-2.249-6.746-5.972-6.746-3.773 0-6.169 2.715-6.169 6.992 0 4.276 2.347 6.905 6.181 6.905 3.06 0 5.198-1.474 5.8-3.87h-2.544zM55.423 7.094v8.443h3.048c2.516 0 3.973-1.55 3.973-4.248 0-2.656-1.468-4.195-3.973-4.195h-3.048zm1.31 1.193h1.592c1.75 0 2.785 1.112 2.785 3.02 0 1.936-1.018 3.037-2.785 3.037h-1.592V8.287zm10.323 6.255c-1.094 0-1.708-.801-1.708-2.194 0-1.38.614-2.188 1.708-2.188 1.089 0 1.709.807 1.709 2.188 0 1.387-.62 2.194-1.709 2.194zm0 1.118c1.861 0 3.002-1.246 3.002-3.312 0-2.054-1.147-3.306-3.002-3.306-1.86 0-3.007 1.252-3.007 3.306 0 2.066 1.14 3.312 3.007 3.312zM79.92 9.165H78.66l-1.136 4.863h-.099l-1.31-4.863H74.91l-1.31 4.863h-.094l-1.141-4.863h-1.276l1.755 6.372h1.294l1.31-4.693h.1l1.316 4.693h1.305l1.75-6.372zm1.598 6.372h1.258V11.81c0-.995.62-1.615 1.633-1.615.936 0 1.392.509 1.392 1.533v3.81h1.258v-4.126c0-1.515-.801-2.37-2.223-2.37-.96 0-1.703.427-2.013 1.135h-.094V9.165h-1.21v6.372zm7.667 0h1.258V6.678h-1.258v8.86zm6.133-.995c-1.094 0-1.709-.801-1.709-2.194 0-1.38.615-2.188 1.709-2.188 1.088 0 1.708.807 1.708 2.188 0 1.387-.62 2.194-1.708 2.194zm0 1.118c1.86 0 3.002-1.246 3.002-3.312 0-2.054-1.147-3.306-3.002-3.306-1.86 0-3.008 1.252-3.008 3.306 0 2.066 1.141 3.312 3.008 3.312zm6.894-1.077c-.685 0-1.182-.333-1.182-.907 0-.561.398-.86 1.276-.918l1.556-.1v.533c0 .79-.702 1.392-1.65 1.392zm-.322 1.06c.837 0 1.533-.363 1.913-1.001h.1v.895h1.211v-4.353c0-1.346-.9-2.142-2.498-2.142-1.446 0-2.475.702-2.604 1.797h1.217c.14-.451.626-.708 1.328-.708.86 0 1.305.38 1.305 1.053v.55l-1.726.1c-1.516.093-2.37.754-2.37 1.901 0 1.164.895 1.908 2.124 1.908zm7.643 0c.878 0 1.62-.416 2.001-1.112h.1v1.006h1.205V6.678h-1.258v3.5h-.094c-.345-.703-1.082-1.118-1.954-1.118-1.609 0-2.645 1.275-2.645 3.288 0 2.019 1.024 3.295 2.645 3.295zm.357-5.454c1.053 0 1.714.837 1.714 2.165 0 1.334-.655 2.16-1.714 2.16-1.065 0-1.703-.814-1.703-2.166 0-1.34.644-2.159 1.703-2.159zm11.4 4.353c-1.094 0-1.708-.801-1.708-2.194 0-1.38.614-2.188 1.709-2.188 1.088 0 1.708.807 1.708 2.188 0 1.387-.62 2.194-1.708 2.194zm0 1.118c1.861 0 3.002-1.246 3.002-3.312 0-2.054-1.146-3.306-3.001-3.306-1.861 0-3.008 1.252-3.008 3.306 0 2.066 1.141 3.312 3.008 3.312zm4.812-.123h1.258V11.81c0-.995.62-1.615 1.632-1.615.936 0 1.393.509 1.393 1.533v3.81h1.258v-4.126c0-1.515-.802-2.37-2.224-2.37-.96 0-1.702.427-2.013 1.135h-.093V9.165H126.1v6.372zM137.73 7.62v1.574h-1.048v1.06h1.048v3.598c0 1.229.555 1.72 1.954 1.72.246 0 .474-.029.673-.064V14.46c-.176.017-.275.029-.468.029-.626 0-.901-.293-.901-.96v-3.277h1.427V9.194h-1.427V7.62h-1.258zm4.477 7.917h1.258v-3.721c0-.966.638-1.615 1.668-1.615.947 0 1.421.515 1.421 1.533v3.803h1.258v-4.113c0-1.516-.819-2.376-2.252-2.376-.96 0-1.697.427-2.007 1.141h-.1V6.68h-1.246v8.858zm10.294-5.424c.93 0 1.538.65 1.568 1.65h-3.219c.07-.995.72-1.65 1.65-1.65zm1.562 3.704c-.234.497-.755.772-1.516.772-1.006 0-1.656-.708-1.697-1.825v-.07h4.5v-.44c0-2-1.07-3.212-2.844-3.212-1.796 0-2.937 1.293-2.937 3.33 0 2.036 1.118 3.288 2.943 3.288 1.457 0 2.475-.702 2.762-1.843h-1.211z",
19
+ fill: "#FFF"
20
+ }), /*#__PURE__*/_jsx("g", {
21
+ fill: "#FFF",
22
+ children: /*#__PURE__*/_jsx("path", {
23
+ d: "M37.747 25.07c-.038-4.285 3.51-6.37 3.672-6.468-2.01-2.93-5.124-3.33-6.218-3.361-2.616-.276-5.153 1.565-6.486 1.565-1.359 0-3.41-1.539-5.622-1.493-2.846.043-5.508 1.691-6.968 4.25-3.013 5.216-.766 12.883 2.121 17.1 1.444 2.066 3.132 4.37 5.34 4.29 2.161-.088 2.969-1.378 5.576-1.378 2.584 0 3.342 1.377 5.595 1.324 2.319-.034 3.779-2.073 5.173-4.158 1.669-2.365 2.339-4.698 2.365-4.818-.053-.017-4.502-1.715-4.548-6.852M33.492 12.467c1.162-1.454 1.958-3.431 1.737-5.438-1.682.075-3.786 1.164-4.998 2.585-1.071 1.253-2.029 3.306-1.781 5.237 1.89.141 3.83-.953 5.042-2.384"
24
+ })
25
+ })]
26
+ })]
27
+ });
28
+ };
29
+ AppStoreIcon.defaultProps = {
30
+ width: "172",
31
+ height: "50",
32
+ viewBox: "0 0 172 50",
33
+ xmlns: "http://www.w3.org/2000/svg"
34
+ };
35
+ var GooglePlayIcon = function GooglePlayIcon(props) {
36
+ return /*#__PURE__*/_jsxs("svg", {
37
+ ...props,
38
+ children: [/*#__PURE__*/_jsx("title", {
39
+ children: "Playstore"
40
+ }), /*#__PURE__*/_jsxs("defs", {
41
+ children: [/*#__PURE__*/_jsxs("linearGradient", {
42
+ x1: "50%",
43
+ y1: "0%",
44
+ x2: "50%",
45
+ y2: "38.913%",
46
+ id: "b",
47
+ children: [/*#__PURE__*/_jsx("stop", {
48
+ stopColor: "#FBDA09",
49
+ offset: "0%"
50
+ }), /*#__PURE__*/_jsx("stop", {
51
+ stopColor: "#FFBC00",
52
+ offset: "100%"
53
+ })]
54
+ }), /*#__PURE__*/_jsx("path", {
55
+ d: "M28.354 14.689c1.77 1.006 1.77 2.638 0 3.645L3.228 32.625C1.458 33.632.023 32.8.023 30.763V2.26C.023.225 1.458-.609 3.228.398l25.126 14.29z",
56
+ id: "a"
57
+ }), /*#__PURE__*/_jsxs("linearGradient", {
58
+ x1: "0%",
59
+ y1: "58.476%",
60
+ x2: "69.306%",
61
+ y2: "39.083%",
62
+ id: "c",
63
+ children: [/*#__PURE__*/_jsx("stop", {
64
+ stopColor: "#01E2FF",
65
+ offset: "0%"
66
+ }), /*#__PURE__*/_jsx("stop", {
67
+ stopColor: "#01C4FF",
68
+ offset: "100%"
69
+ })]
70
+ }), /*#__PURE__*/_jsxs("linearGradient", {
71
+ x1: "20.281%",
72
+ y1: "20.102%",
73
+ x2: "83.82%",
74
+ y2: "83.621%",
75
+ id: "e",
76
+ children: [/*#__PURE__*/_jsx("stop", {
77
+ stopColor: "#28D781",
78
+ offset: "0%"
79
+ }), /*#__PURE__*/_jsx("stop", {
80
+ stopColor: "#02F076",
81
+ offset: "100%"
82
+ })]
83
+ }), /*#__PURE__*/_jsxs("linearGradient", {
84
+ x1: "74.488%",
85
+ y1: "17.43%",
86
+ x2: "10.108%",
87
+ y2: "91.184%",
88
+ id: "f",
89
+ children: [/*#__PURE__*/_jsx("stop", {
90
+ stopColor: "#F2414E",
91
+ offset: "0%"
92
+ }), /*#__PURE__*/_jsx("stop", {
93
+ stopColor: "#E02554",
94
+ offset: "100%"
95
+ })]
96
+ })]
97
+ }), /*#__PURE__*/_jsxs("g", {
98
+ fill: "none",
99
+ fillRule: "evenodd",
100
+ children: [/*#__PURE__*/_jsx("path", {
101
+ d: "M.17 4.852V44.54a4.681 4.681 0 0 0 4.682 4.681h162.296a4.682 4.682 0 0 0 4.682-4.681V4.85a4.681 4.681 0 0 0-4.682-4.68H4.852A4.682 4.682 0 0 0 .17 4.85z",
102
+ fill: "#000",
103
+ fillRule: "nonzero"
104
+ }), /*#__PURE__*/_jsx("g", {
105
+ fill: "#FFF",
106
+ children: /*#__PURE__*/_jsx("path", {
107
+ d: "M91.207 16.084a4.213 4.213 0 1 1 0-8.425 4.213 4.213 0 0 1 0 8.425zm0-1.287a2.925 2.925 0 1 0 0-5.85 2.925 2.925 0 0 0 0 5.85zM62.656 12.34v2.574h3.393v.936h-4.68V8.01h4.68v.936h-3.393v2.457h3.042v.937h-3.042zM70.613 8.946v6.904h-1.288V8.946h-1.989V8.01h5.266v.936h-1.99zM82.08 8.946v6.904h-1.287V8.946h-1.99V8.01h5.266v.936H82.08zM76.346 8.01h1.287v7.84h-1.287zM97.233 8.01h-.76v7.84h1.287V9.731l3.744 6.119h1.288V8.01h-1.288v5.737l-3.51-5.737h-.76zM59.376 8.916c-.686-.723-1.69-1.14-2.883-1.14a4.133 4.133 0 0 0-4.135 4.13 4.135 4.135 0 0 0 4.135 4.13c2.322.022 4.258-1.614 3.871-4.454v-.042h-1.03c.009.119.012.241.01.366.002 2.029-1.168 2.98-2.816 2.98a2.982 2.982 0 0 1-2.983-2.98 2.982 2.982 0 0 1 2.983-2.98c.824 0 1.539.282 2.042.796l.806-.806z"
108
+ })
109
+ }), /*#__PURE__*/_jsxs("g", {
110
+ fill: "#FFF",
111
+ children: [/*#__PURE__*/_jsx("path", {
112
+ d: "M125.375 22.052h6.634s3.82.65 3.82 5.035-3.82 5.035-3.82 5.035h-6.634v-10.07zm1.287 2.436v5.404h4.504s2.05 0 2.05-2.702-2.05-2.702-2.05-2.702h-4.504z"
113
+ }), /*#__PURE__*/_jsx("path", {
114
+ d: "M124.79 22.052h2.34v16.382h-2.34zM137.193 22.052h2.34v16.382h-2.34zM148.208 37.262c-.645.532-1.675 1.033-3.303 1.135-3.729.232-3.73-3.17-3.73-3.4 0-.23-.185-3.004 2.782-3.445 2.1-.313 3.571.208 4.251.538v-.481c-.167-.637-.684-1.809-2.235-1.809-2.131 0-2.602 1.152-2.602 1.152l-1.949-1.152s1.09-2.249 4.364-2.249c4.07 0 4.763 2.808 4.763 3.753V38.428h-2.341v-1.166zm-.167-3.508s-4.509-1.216-4.666 1.317c-.156 2.533 4.326 1.317 4.726-.479 0-.57-.06-.838-.06-.838zM154.94 37.812l-2.183 5.185h2.34l6.331-15.038h-2.34l-2.978 7.074-3.002-7.13h-2.34l4.172 9.91zM119.55 31.732l-7.4 3.059s.477 1.692 2.703 1.703c1.742.009 2.726-1.545 2.726-1.545l1.878 1.272s-1.516 2.451-4.62 2.451c-3.813 0-5.493-3.335-5.493-5.5 0-2.087 1.334-5.62 5.257-5.62 3.924 0 4.95 4.18 4.95 4.18zm-2.815-.867s-.931-1.417-2.36-1.155c-3.02.552-2.64 3.196-2.64 3.196l5-2.04zM105.834 22.052h2.476V38.4h-2.476zM101.872 27.907l2.288.02V38.24c0 2.636-1.569 5.418-5.262 5.418-3.694 0-4.887-3.273-4.887-3.273l2.102-.884s.64 2.017 2.894 2.017c2.566 0 2.865-2.334 2.865-3.133v-1.12s-.888 1.39-3.093 1.39c-2.39 0-5.232-2.049-5.232-5.54 0-3.493 2.676-5.49 5.26-5.563 2.07-.058 3.065 1.374 3.065 1.374v-1.02zm-2.897 8.653c1.669 0 3.022-1.53 3.022-3.415 0-1.886-1.353-3.415-3.022-3.415-1.67 0-3.022 1.529-3.022 3.415 0 1.886 1.353 3.415 3.022 3.415zM86.949 38.668a5.564 5.564 0 0 1-5.571-5.558 5.564 5.564 0 0 1 5.57-5.559 5.564 5.564 0 0 1 5.571 5.559 5.564 5.564 0 0 1-5.57 5.558zm-.037-2.18c1.73 0 3.132-1.512 3.132-3.378s-1.402-3.379-3.132-3.379c-1.73 0-3.131 1.513-3.131 3.379s1.402 3.378 3.131 3.378zM74.896 38.668a5.564 5.564 0 0 1-5.57-5.558 5.564 5.564 0 0 1 5.57-5.559 5.564 5.564 0 0 1 5.57 5.559 5.564 5.564 0 0 1-5.57 5.558zm-.036-2.18c1.73 0 3.131-1.512 3.131-3.378S76.59 29.73 74.86 29.73c-1.73 0-3.131 1.513-3.131 3.379s1.401 3.378 3.13 3.378z"
115
+ }), /*#__PURE__*/_jsxs("g", {
116
+ children: [/*#__PURE__*/_jsx("path", {
117
+ d: "M60.512 29.314h7.355l-.073 2.325h-7.282z"
118
+ }), /*#__PURE__*/_jsx("path", {
119
+ d: "M66.42 23.843c-1.432-1.508-3.526-2.376-6.017-2.376-4.766 0-8.63 3.854-8.63 8.61 0 4.754 3.864 8.602 8.63 8.61 4.845.043 8.886-3.366 8.078-9.287v-.086h-2.149c.018.247.024.501.018.762.005 4.23-2.436 6.212-5.875 6.212-3.438 0-6.226-2.78-6.226-6.212 0-3.43 2.788-6.212 6.226-6.212 1.72 0 3.212.587 4.261 1.658l1.683-1.679z"
120
+ })]
121
+ })]
122
+ }), /*#__PURE__*/_jsxs("g", {
123
+ transform: "translate(11.755 8.127)",
124
+ children: [/*#__PURE__*/_jsx("mask", {
125
+ id: "d",
126
+ fill: "#fff",
127
+ children: /*#__PURE__*/_jsx("use", {
128
+ xlinkHref: "#a"
129
+ })
130
+ }), /*#__PURE__*/_jsx("use", {
131
+ fill: "url(#b)",
132
+ xlinkHref: "#a"
133
+ }), /*#__PURE__*/_jsx("path", {
134
+ fill: "url(#c)",
135
+ mask: "url(#d)",
136
+ d: "M0-.012l16.357 16.258-16.568 16.9z"
137
+ }), /*#__PURE__*/_jsx("path", {
138
+ fill: "url(#e)",
139
+ mask: "url(#d)",
140
+ d: "M-3.364-3.358l19.72 19.609 5.862-5.593z"
141
+ }), /*#__PURE__*/_jsx("path", {
142
+ fill: "url(#f)",
143
+ mask: "url(#d)",
144
+ d: "M16.358 16.247l8.975 9.046L-1.48 34.34z"
145
+ })]
146
+ })]
147
+ })]
148
+ });
149
+ };
150
+ GooglePlayIcon.defaultProps = {
151
+ width: "172",
152
+ height: "50",
153
+ viewBox: "0 0 172 50",
154
+ xmlns: "http://www.w3.org/2000/svg",
155
+ xmlnsXlink: "http://www.w3.org/1999/xlink"
156
+ };
157
+ var AndroidDownloadIcon = function AndroidDownloadIcon(props) {
158
+ return /*#__PURE__*/_jsxs("svg", {
159
+ ...props,
160
+ children: [/*#__PURE__*/_jsx("title", {
161
+ children: "android"
162
+ }), /*#__PURE__*/_jsxs("g", {
163
+ fill: "none",
164
+ fillRule: "evenodd",
165
+ children: [/*#__PURE__*/_jsx("path", {
166
+ d: "M172 44.328c0 3.133-2.794 5.672-6.24 5.672H6.24c-1.654 0-3.242-.598-4.412-1.661C.658 47.275 0 45.832 0 44.329V5.671C0 2.539 2.794 0 6.24 0h159.52c3.446 0 6.24 2.54 6.24 5.672v38.656",
167
+ fill: "#100F0D",
168
+ fillRule: "nonzero"
169
+ }), /*#__PURE__*/_jsx("text", {
170
+ fill: "#FFF",
171
+ fontFamily: "Arial-BoldMT, Arial",
172
+ fontSize: "23.441",
173
+ fontWeight: "bold",
174
+ children: /*#__PURE__*/_jsx("tspan", {
175
+ x: "63.624",
176
+ y: "42.135",
177
+ children: "Android"
178
+ })
179
+ }), /*#__PURE__*/_jsx("text", {
180
+ fill: "#FFF",
181
+ fillRule: "nonzero",
182
+ fontFamily: "ArialMT, Arial",
183
+ fontSize: "11.721",
184
+ children: /*#__PURE__*/_jsx("tspan", {
185
+ x: "64",
186
+ y: "19",
187
+ children: "Download for"
188
+ })
189
+ }), /*#__PURE__*/_jsx("g", {
190
+ fill: "#9FC732",
191
+ fillRule: "nonzero",
192
+ children: /*#__PURE__*/_jsx("path", {
193
+ d: "M40.48 18.031H20.153a.818.818 0 0 0-.818.817v17.01c0 .45.366.816.818.816h3.625v5.732c0 1.33 1.08 2.409 2.413 2.409a2.411 2.411 0 0 0 2.414-2.409v-5.732h3.376v5.732c0 1.33 1.08 2.409 2.413 2.409a2.41 2.41 0 0 0 2.414-2.409v-5.732h3.674a.82.82 0 0 0 .819-.817V18.848a.818.818 0 0 0-.82-.817m-24.588-.004a2.411 2.411 0 0 0-2.413 2.408v9.782a2.41 2.41 0 0 0 2.413 2.408 2.41 2.41 0 0 0 2.414-2.408v-9.782a2.41 2.41 0 0 0-2.414-2.408M44.877 17.66c-1.33 0-2.41 1.091-2.41 2.436v9.895c0 1.345 1.08 2.436 2.41 2.436s2.41-1.09 2.41-2.436v-9.895c0-1.345-1.08-2.436-2.41-2.436m-19.441-6.768a.924.924 0 0 1 .813.464.945.945 0 0 1 0 .945.924.924 0 0 1-.813.464.932.932 0 0 1-.913-.936c0-.512.406-.93.913-.937zm10.96.937a.939.939 0 0 1-.454.836.918.918 0 0 1-.944 0 .939.939 0 0 1-.454-.836.931.931 0 0 1 .926-.906c.5 0 .91.4.926.906zm-15.902 4.628h19.918c.52 0 .907-.483.8-.998a11.12 11.12 0 0 0-5.37-7.395l1.702-3.106a.44.44 0 0 0-.168-.592.426.426 0 0 0-.585.17l-1.716 3.129a10.856 10.856 0 0 0-4.622-1.027 10.854 10.854 0 0 0-4.622 1.027l-1.716-3.13a.428.428 0 0 0-.58-.16.438.438 0 0 0-.173.582l1.702 3.107a11.123 11.123 0 0 0-5.37 7.395.825.825 0 0 0 .8.998"
194
+ })
195
+ })]
196
+ })]
197
+ });
198
+ };
199
+ AndroidDownloadIcon.defaultProps = {
200
+ width: "172",
201
+ height: "50",
202
+ viewBox: "0 0 172 50",
203
+ xmlns: "http://www.w3.org/2000/svg"
204
+ };
205
+ import Button from '../Button';
206
+ import { mergeProps } from '../Util';
207
+ import { styled } from '../Theme';
208
+ import { jsx as _jsx } from "react/jsx-runtime";
209
+ import { jsxs as _jsxs } from "react/jsx-runtime";
210
+ export default function WalletDownload(props) {
211
+ const browser = useBrowser();
212
+ const newProps = mergeProps(props, WalletDownload, ['style']);
213
+ const {
214
+ title,
215
+ children,
216
+ iosLink,
217
+ androidLink,
218
+ androidDownLoadUrl,
219
+ locale,
220
+ ...rest
221
+ } = newProps;
222
+ const isAndroid = browser.mobile.android.phone || browser.mobile.android.tablet;
223
+ const isIOS = browser.mobile.apple.phone || browser.mobile.apple.tablet;
224
+ return /*#__PURE__*/_jsxs(Container, {
225
+ ...rest,
226
+ children: [/*#__PURE__*/_jsxs("div", {
227
+ className: "download-text",
228
+ children: [!!title && /*#__PURE__*/_jsx(Typography, {
229
+ className: "download-title",
230
+ component: "div",
231
+ children: title
232
+ }), children && /*#__PURE__*/_jsx(Typography, {
233
+ className: "download-extra",
234
+ component: "div",
235
+ children: children
236
+ })]
237
+ }), !browser.mobile.any && /*#__PURE__*/_jsxs("div", {
238
+ className: "download-store-list",
239
+ children: [/*#__PURE__*/_jsx(Button, {
240
+ className: "download-link",
241
+ component: "a",
242
+ href: iosLink,
243
+ children: /*#__PURE__*/_jsx(AppStoreIcon, {})
244
+ }), locale === 'zh' && /*#__PURE__*/_jsx(Button, {
245
+ component: "a",
246
+ className: "download-link",
247
+ href: androidDownLoadUrl,
248
+ children: /*#__PURE__*/_jsx(AndroidDownloadIcon, {})
249
+ }), locale === 'en' && /*#__PURE__*/_jsx(Button, {
250
+ component: "a",
251
+ className: "download-link",
252
+ href: androidLink,
253
+ children: /*#__PURE__*/_jsx(GooglePlayIcon, {})
254
+ })]
255
+ }), isAndroid && /*#__PURE__*/_jsxs("div", {
256
+ className: "download-store-list",
257
+ children: [locale === 'zh' && /*#__PURE__*/_jsx(Button, {
258
+ component: "a",
259
+ href: androidDownLoadUrl,
260
+ variant: "outlined",
261
+ color: "primary",
262
+ children: "\u672C\u5730\u4E0B\u8F7D"
263
+ }), locale === 'en' && /*#__PURE__*/_jsx(Button, {
264
+ component: "a",
265
+ href: androidLink,
266
+ variant: "outlined",
267
+ color: "primary",
268
+ children: "Download"
269
+ })]
270
+ }), isIOS && /*#__PURE__*/_jsx("div", {
271
+ className: "download-store-list",
272
+ children: /*#__PURE__*/_jsx(Button, {
273
+ component: "a",
274
+ href: iosLink,
275
+ variant: "outlined",
276
+ color: "primary",
277
+ children: "Download"
278
+ })
279
+ })]
280
+ });
281
+ }
282
+ WalletDownload.propTypes = {
283
+ title: PropTypes.string,
284
+ layout: PropTypes.oneOf(['vertical', 'horizontal']),
285
+ storeLayout: PropTypes.oneOf(['vertical', 'horizontal']),
286
+ style: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
287
+ iosLink: PropTypes.string,
288
+ androidLink: PropTypes.string,
289
+ androidDownLoadUrl: PropTypes.string,
290
+ locale: PropTypes.oneOf(['en', 'zh'])
291
+ };
292
+ WalletDownload.defaultProps = {
293
+ title: 'Download DID Wallet',
294
+ layout: 'vertical',
295
+ storeLayout: 'horizontal',
296
+ iosLink: 'https://itunes.apple.com/app/id1460083542',
297
+ androidLink: 'https://play.google.com/store/apps/details?id=com.arcblock.wallet.app.product',
298
+ androidDownLoadUrl: 'https://releases.arcblockio.cn/arcwallet_android/latest/abtwallet.apk',
299
+ style: {},
300
+ locale: 'zh'
301
+ };
302
+ const Container = styled('div')`
303
+ display: flex;
304
+ flex-direction: ${props => props.layout === 'vertical' ? 'column' : 'row'};
305
+ align-items: center;
306
+
307
+ .download-title {
308
+ margin-right: ${props => props.layout === 'vertical' ? '0' : '16px'};
309
+ margin-bottom: ${props => props.layout === 'vertical' ? '16px' : '0'};
310
+ }
311
+
312
+ .download-store-list {
313
+ display: flex;
314
+ flex-direction: ${props => props.storeLayout === 'vertical' ? 'column' : 'row'};
315
+ justify-content: space-between;
316
+ align-items: center;
317
+
318
+ .download-link {
319
+ padding: 0;
320
+ margin: 0;
321
+
322
+ margin-right: ${props => props.storeLayout === 'vertical' ? '0' : '16px'};
323
+ margin-bottom: ${props => props.storeLayout === 'vertical' ? '16px' : '0'};
324
+
325
+ &:last-of-type {
326
+ margin-right: 0;
327
+ margin-bottom: 0;
328
+ }
329
+ }
330
+ }
331
+ `;
@@ -0,0 +1,45 @@
1
+ import PropTypes from 'prop-types';
2
+ import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
3
+ import Fab from '@mui/material/Fab';
4
+ import { styled } from '../Theme';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ export default function OpenInWallet({
7
+ locale,
8
+ link
9
+ }) {
10
+ const buttonText = locale === 'zh' ? '在 DID 钱包打开' : 'Open in DID Wallet';
11
+ const browser = useBrowser();
12
+ if (browser.mobile.any && !browser.wallet && !browser.wechat) {
13
+ const deepLink = `abt://abtwallet.io/i?action=requestOpenUrl&url=${encodeURIComponent(link)}`;
14
+ return /*#__PURE__*/_jsx(Button, {
15
+ size: "small",
16
+ href: deepLink,
17
+ variant: "extended",
18
+ color: "primary",
19
+ rounded: true,
20
+ target: "_blank",
21
+ className: "open-in-wallet-button",
22
+ children: buttonText
23
+ });
24
+ }
25
+ return null;
26
+ }
27
+ OpenInWallet.propTypes = {
28
+ locale: PropTypes.oneOf(['en', 'zh']),
29
+ link: PropTypes.string.isRequired
30
+ };
31
+ OpenInWallet.defaultProps = {
32
+ locale: 'zh'
33
+ };
34
+ const Button = styled(Fab)`
35
+ && {
36
+ font-size: 12px;
37
+ position: fixed;
38
+ bottom: 24px;
39
+ left: 50%;
40
+ transform-origin: 50% 50%;
41
+ transform: translateX(-50%);
42
+ min-width: 120px;
43
+ z-index: ${props => props.theme.zIndex.tooltip};
44
+ }
45
+ `;
Binary file
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="172px" height="50px" viewBox="0 0 172 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 62 (91390) - https://sketch.com -->
4
+ <title>android</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="android" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <path d="M172,44.3280578 C172,47.460585 169.20589,50 165.759181,50 L6.24081931,50 C4.58565112,50 2.99827431,49.4024221 1.82789366,48.3387266 C0.657513004,47.2750311 0,45.8323504 0,44.3280578 L0,5.67194218 C0,2.53941501 2.79410998,0 6.24081931,0 L165.759181,0 C169.20589,0 172,2.53941501 172,5.67194218 L172,44.3280578" id="bg" fill="#100F0D" fill-rule="nonzero"></path>
8
+ <text id="Android" fill="#FFFFFF" font-family="Arial-BoldMT, Arial" font-size="23.4412266" font-weight="bold">
9
+ <tspan x="63.6237138" y="42.1351959">Android</tspan>
10
+ </text>
11
+ <text id="Download-for" fill="#FFFFFF" fill-rule="nonzero" font-family="ArialMT, Arial" font-size="11.7206133" font-weight="normal">
12
+ <tspan x="64" y="19">Download for</tspan>
13
+ </text>
14
+ <g id="Android" transform="translate(13.478705, 3.102215)" fill="#9FC732" fill-rule="nonzero">
15
+ <g id="shapeB" transform="translate(14.000000, 28.229131) scale(-1, 1) rotate(-180.000000) translate(-14.000000, -28.229131) translate(0.000000, 14.729131)">
16
+ <path d="M27.0021559,26.7999654 L6.67361202,26.7999654 C6.22172319,26.7999654 5.85537086,26.4342314 5.85537086,25.9833492 L5.85537086,8.97407348 C5.85537086,8.52300474 6.22153629,8.15719149 6.67361202,8.15686385 L10.2979028,8.15686385 L10.2979028,2.42512051 C10.2979028,1.09475625 11.3786473,0.0164193655 12.711387,0.0164193655 C14.0445233,0.0164193655 15.1250695,1.09475625 15.1250695,2.42512051 L15.1250695,8.15686385 L18.5009338,8.15686385 L18.5009338,2.42512051 C18.5009338,1.09475625 19.5816783,0.0164193655 20.914418,0.0164193655 C22.2475543,0.0164193655 23.3279023,1.09475625 23.3279023,2.42512051 L23.3279023,8.15686385 L27.0021559,8.15686385 C27.2193934,8.15681136 27.4277485,8.24289313 27.5813587,8.39616104 C27.7349688,8.54942896 27.8211902,8.75731992 27.8211902,8.97407348 L27.8211902,25.9833492 C27.8211902,26.4344951 27.4543091,26.7999654 27.0021559,26.7999654 M2.41368249,26.8043175 C1.08094274,26.8043175 0,25.7257828 0,24.396012 L0,14.6142245 C0,13.2846515 1.08054621,12.2065124 2.41368249,12.2065124 C3.74622398,12.2065124 4.82696846,13.2846515 4.82696846,14.6142245 L4.82696846,24.396012 C4.82696846,25.7259806 3.74642224,26.8043175 2.41368249,26.8043175" id="形状"></path>
17
+ </g>
18
+ <g id="shapeA" transform="translate(20.153322, 14.922487) scale(-1, 1) rotate(-180.000000) translate(-20.153322, -14.922487) translate(6.153322, 0.422487)">
19
+ <path d="M25.2453809,14.8645837 C23.9142872,14.8645837 22.835755,13.7735501 22.835755,12.428369 L22.835755,2.53322312 C22.835755,1.18824212 23.9142872,0.0976088161 25.2453809,0.0976088161 C26.5758807,0.0976088161 27.6548088,1.18824212 27.6548088,2.53322312 L27.6548088,12.428369 C27.6548088,13.7737503 26.5758807,14.8645837 25.2453809,14.8645837 M5.80349633,21.6325137 C6.13763097,21.6374522 6.44849574,21.460055 6.61698905,21.1682882 C6.78548236,20.8765215 6.78548236,20.5156183 6.61698905,20.2238515 C6.44849574,19.9320848 6.13763097,19.7546876 5.80349633,19.7596261 C5.29723671,19.7671087 4.89071419,20.1841693 4.89071419,20.6960699 C4.89071419,21.2079705 5.29723671,21.6250311 5.80349633,21.6325137 L5.80349633,21.6325137 Z M16.7639886,20.6959698 C16.7750405,20.3542555 16.6010357,20.033606 16.3100354,19.8594415 C16.0190351,19.6852771 15.657287,19.6852771 15.3662867,19.8594415 C15.0752864,20.033606 14.9012817,20.3542555 14.9123335,20.6959698 C14.928668,21.2010236 15.3383524,21.6019059 15.8381611,21.6019059 C16.3379697,21.6019059 16.7476541,21.2010236 16.7639886,20.6959698 Z M0.862120431,16.0672821 L20.7800318,16.0672821 C21.2992078,16.0672821 21.6869569,16.5509629 21.5798756,17.0654617 C20.9213553,20.239905 18.9224386,22.9154586 16.2093828,24.4611562 L17.9119951,27.5667596 C17.9674152,27.6677193 17.9808653,27.7868122 17.9493827,27.8978044 C17.9179001,28.0087966 17.8440674,28.1025826 17.7441486,28.1585032 C17.6443377,28.2146597 17.5265257,28.2283484 17.4167169,28.1965478 C17.306908,28.1647472 17.2141307,28.0900719 17.1588633,27.9890047 L15.4433854,24.8597877 C13.9950906,25.5385247 12.4175937,25.8891002 10.821274,25.8869841 C9.22481328,25.8892295 7.6471602,25.5386493 6.19876682,24.8597877 L4.48289309,27.989405 C4.36428298,28.1925314 4.10726669,28.2632426 3.9032069,28.1488902 C3.69914712,28.0345378 3.62224629,27.7767039 3.72976129,27.5673599 L5.43237357,24.4611562 C2.71991151,22.9154586 0.720203086,20.239905 0.0616828527,17.0654617 C-0.0452005035,16.551163 0.342548561,16.0672821 0.862120431,16.0672821" id="形状"></path>
20
+ </g>
21
+ </g>
22
+ </g>
23
+ </svg>