@rango-dev/widget-embedded 0.24.2-next.1 → 0.24.2-next.3
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/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/RefreshModal/RefreshModal.d.ts +4 -0
- package/dist/components/RefreshModal/RefreshModal.d.ts.map +1 -0
- package/dist/components/RefreshModal/RefreshModal.styles.d.ts +446 -0
- package/dist/components/RefreshModal/RefreshModal.styles.d.ts.map +1 -0
- package/dist/components/RefreshModal/RefreshModal.types.d.ts +5 -0
- package/dist/components/RefreshModal/RefreshModal.types.d.ts.map +1 -0
- package/dist/components/RefreshModal/index.d.ts +2 -0
- package/dist/components/RefreshModal/index.d.ts.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/package.json +7 -7
- package/src/components/Layout/Layout.tsx +12 -1
- package/src/components/RefreshModal/RefreshModal.styles.ts +9 -0
- package/src/components/RefreshModal/RefreshModal.tsx +39 -0
- package/src/components/RefreshModal/RefreshModal.types.ts +4 -0
- package/src/components/RefreshModal/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.24.2-next.
|
|
3
|
+
"version": "0.24.2-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"@lingui/core": "4.2.1",
|
|
23
23
|
"@lingui/react": "4.2.1",
|
|
24
24
|
"@rango-dev/logging-core": "^0.2.0",
|
|
25
|
-
"@rango-dev/provider-all": "^0.29.0",
|
|
25
|
+
"@rango-dev/provider-all": "^0.29.1-next.0",
|
|
26
26
|
"@rango-dev/queue-manager-core": "^0.26.0",
|
|
27
|
-
"@rango-dev/queue-manager-rango-preset": "^0.29.
|
|
27
|
+
"@rango-dev/queue-manager-rango-preset": "^0.29.2-next.0",
|
|
28
28
|
"@rango-dev/queue-manager-react": "^0.26.0",
|
|
29
|
-
"@rango-dev/ui": "^0.30.1-next.
|
|
30
|
-
"@rango-dev/wallets-react": "^0.15.0",
|
|
31
|
-
"@rango-dev/wallets-shared": "^0.29.0",
|
|
29
|
+
"@rango-dev/ui": "^0.30.1-next.1",
|
|
30
|
+
"@rango-dev/wallets-react": "^0.15.1-next.0",
|
|
31
|
+
"@rango-dev/wallets-shared": "^0.29.1-next.0",
|
|
32
32
|
"bignumber.js": "^9.1.1",
|
|
33
33
|
"copy-to-clipboard": "^3.3.3",
|
|
34
34
|
"dayjs": "^1.11.7",
|
|
@@ -49,4 +49,4 @@
|
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|
|
@@ -4,7 +4,7 @@ import type { PropsWithChildren } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { useManager } from '@rango-dev/queue-manager-react';
|
|
6
6
|
import { BottomLogo, Divider, Header } from '@rango-dev/ui';
|
|
7
|
-
import React, { useEffect, useRef } from 'react';
|
|
7
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
import { WIDGET_UI_ID } from '../../constants';
|
|
10
10
|
import { useIframe } from '../../hooks/useIframe';
|
|
@@ -20,6 +20,7 @@ import { isFeatureHidden } from '../../utils/settings';
|
|
|
20
20
|
import { ActivateTabAlert } from '../common/ActivateTabAlert';
|
|
21
21
|
import { ActivateTabModal } from '../common/ActivateTabModal';
|
|
22
22
|
import { BackButton, CancelButton, WalletButton } from '../HeaderButtons';
|
|
23
|
+
import { RefreshModal } from '../RefreshModal';
|
|
23
24
|
|
|
24
25
|
import { onScrollContentAttachStatusToContainer } from './Layout.helpers';
|
|
25
26
|
import { Container, Content, Footer, LayoutContainer } from './Layout.styles';
|
|
@@ -27,6 +28,8 @@ import { Container, Content, Footer, LayoutContainer } from './Layout.styles';
|
|
|
27
28
|
function Layout(props: PropsWithChildren<PropTypes>) {
|
|
28
29
|
const { connectHeightObserver, disconnectHeightObserver } = useIframe();
|
|
29
30
|
const { children, header, footer, height = 'fixed' } = props;
|
|
31
|
+
const { fetchStatus } = useAppStore();
|
|
32
|
+
const [openRefreshModal, setOpenRefreshModal] = useState(false);
|
|
30
33
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
31
34
|
const {
|
|
32
35
|
config: { features, theme },
|
|
@@ -94,6 +97,10 @@ function Layout(props: PropsWithChildren<PropTypes>) {
|
|
|
94
97
|
};
|
|
95
98
|
}, []);
|
|
96
99
|
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
setOpenRefreshModal(fetchStatus === 'failed');
|
|
102
|
+
}, [fetchStatus]);
|
|
103
|
+
|
|
97
104
|
return (
|
|
98
105
|
<Container
|
|
99
106
|
height={height}
|
|
@@ -156,6 +163,10 @@ function Layout(props: PropsWithChildren<PropTypes>) {
|
|
|
156
163
|
<BottomLogo />
|
|
157
164
|
</div>
|
|
158
165
|
</Footer>
|
|
166
|
+
<RefreshModal
|
|
167
|
+
open={openRefreshModal}
|
|
168
|
+
onClose={() => setOpenRefreshModal(false)}
|
|
169
|
+
/>
|
|
159
170
|
</Container>
|
|
160
171
|
);
|
|
161
172
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PropTypes } from './RefreshModal.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { Divider, MessageBox, RefreshIcon } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { getContainer } from '../../utils/common';
|
|
8
|
+
import { WatermarkedModal } from '../common/WatermarkedModal';
|
|
9
|
+
|
|
10
|
+
import { RefreshButton } from './RefreshModal.styles';
|
|
11
|
+
|
|
12
|
+
export function RefreshModal(props: PropTypes) {
|
|
13
|
+
const { open, onClose } = props;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<WatermarkedModal
|
|
17
|
+
open={open}
|
|
18
|
+
dismissible
|
|
19
|
+
onClose={onClose}
|
|
20
|
+
container={getContainer()}>
|
|
21
|
+
<MessageBox
|
|
22
|
+
title={i18n.t('Something wrong')}
|
|
23
|
+
type="error"
|
|
24
|
+
description={i18n.t('Something Wrong. Please refresh the app')}>
|
|
25
|
+
<Divider size={30} />
|
|
26
|
+
<RefreshButton
|
|
27
|
+
variant="outlined"
|
|
28
|
+
size="large"
|
|
29
|
+
type="primary"
|
|
30
|
+
fullWidth
|
|
31
|
+
onClick={() => location.reload()}>
|
|
32
|
+
<RefreshIcon size={20} color="primary" />
|
|
33
|
+
<Divider size={4} direction="horizontal" />
|
|
34
|
+
{i18n.t('Refresh')}
|
|
35
|
+
</RefreshButton>
|
|
36
|
+
</MessageBox>
|
|
37
|
+
</WatermarkedModal>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RefreshModal } from './RefreshModal';
|