@rango-dev/widget-embedded 0.14.1-next.20 → 0.14.1-next.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.14.1-next.20",
3
+ "version": "0.14.1-next.21",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -52,7 +52,7 @@ export function WalletList(props: PropTypes) {
52
52
  const [showExperimentalChainModal, setShowExperimentalChainModal] =
53
53
  useState(false);
54
54
  const [addingExperimentalChainStatus, setAddingExperimentalChainStatus] =
55
- useState<'in-progress' | 'completed' | null>(null);
55
+ useState<'in-progress' | 'completed' | 'rejected' | null>(null);
56
56
  const { suggestAndConnect } = useWallets();
57
57
  let modalTimerId: ReturnType<typeof setTimeout> | null = null;
58
58
  const { list, error, handleClick } = useWalletList({
@@ -83,7 +83,7 @@ export function WalletList(props: PropTypes) {
83
83
  await suggestAndConnect(wallet.walletType, wallet.chain);
84
84
  setAddingExperimentalChainStatus('completed');
85
85
  } catch (e) {
86
- setAddingExperimentalChainStatus(null);
86
+ setAddingExperimentalChainStatus('rejected');
87
87
  }
88
88
  };
89
89
 
@@ -110,7 +110,10 @@ export function WalletList(props: PropTypes) {
110
110
 
111
111
  useEffect(() => {
112
112
  let timeout: ReturnType<typeof setTimeout> | null = null;
113
- if (addingExperimentalChainStatus === 'completed') {
113
+ if (
114
+ addingExperimentalChainStatus === 'completed' ||
115
+ addingExperimentalChainStatus === 'rejected'
116
+ ) {
114
117
  timeout = setTimeout(
115
118
  () => setAddingExperimentalChainStatus(null),
116
119
  TIME_TO_CLOSE_MODAL
@@ -227,7 +230,7 @@ export function WalletList(props: PropTypes) {
227
230
  open={!!addingExperimentalChainStatus}
228
231
  onClose={setAddingExperimentalChainStatus.bind(null, null)}
229
232
  container={modalContainer}>
230
- {addingExperimentalChainStatus === 'in-progress' ? (
233
+ {addingExperimentalChainStatus === 'in-progress' && (
231
234
  <MessageBox
232
235
  type="loading"
233
236
  title={i18n.t({
@@ -247,7 +250,9 @@ export function WalletList(props: PropTypes) {
247
250
  </LogoContainer>
248
251
  }
249
252
  />
250
- ) : (
253
+ )}
254
+
255
+ {addingExperimentalChainStatus === 'completed' && (
251
256
  <MessageBox
252
257
  type="success"
253
258
  title={i18n.t({
@@ -260,6 +265,18 @@ export function WalletList(props: PropTypes) {
260
265
  })}
261
266
  />
262
267
  )}
268
+
269
+ {addingExperimentalChainStatus === 'rejected' && (
270
+ <MessageBox
271
+ type="error"
272
+ title={i18n.t('Request Rejected')}
273
+ description={i18n.t({
274
+ id: "You've rejected adding {blockchainDisplayName} chain to your wallet.",
275
+ values: { blockchainDisplayName },
276
+ })}
277
+ />
278
+ )}
279
+
263
280
  <Divider direction="vertical" size={32} />
264
281
  </Modal>
265
282
  )}