@rango-dev/widget-embedded 0.23.1-next.26 → 0.23.1-next.28

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.
@@ -1 +1 @@
1
- {"version":3,"file":"LanguagePage.d.ts","sourceRoot":"","sources":["../../src/pages/LanguagePage.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,wBAAgB,YAAY,sBA8C3B"}
1
+ {"version":3,"file":"LanguagePage.d.ts","sourceRoot":"","sources":["../../src/pages/LanguagePage.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,wBAAgB,YAAY,sBAkD3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.23.1-next.26",
3
+ "version": "0.23.1-next.28",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -109,6 +109,8 @@ export function SwapDetails(props: SwapDetailsProps) {
109
109
  if (swap.status === 'success' || swap.status === 'failed') {
110
110
  setShowCompletedModal(swap.status);
111
111
  setAsRead(swap.requestId);
112
+ } else if (showCompletedModal) {
113
+ setShowCompletedModal(null);
112
114
  }
113
115
  }
114
116
  }, [swap.status, swap.requestId]);
@@ -29,6 +29,7 @@ import { useNavigate } from 'react-router-dom';
29
29
  import { SlippageTooltipContainer as TooltipContainer } from '../../components/Slippage/Slippage.styles';
30
30
  import { navigationRoutes } from '../../constants/navigationRoutes';
31
31
  import { ThemeModeEnum } from '../../constants/settings';
32
+ import { useLanguage } from '../../hooks/useLanguage';
32
33
  import { useAppStore } from '../../store/AppStore';
33
34
  import { getContainer } from '../../utils/common';
34
35
  import { getUniqueSwappersGroups, isFeatureHidden } from '../../utils/settings';
@@ -85,6 +86,10 @@ export function SettingsLists() {
85
86
  const navigate = useNavigate();
86
87
  const { theme: themeConfig } = useAppStore().config;
87
88
  const { setTheme, theme } = useAppStore();
89
+ const { activeLanguage, languages } = useLanguage();
90
+ const currentLanguage = languages.find(
91
+ (language) => language.local === activeLanguage
92
+ )?.label;
88
93
 
89
94
  const fetchStatus = useAppStore().fetchStatus;
90
95
  const swappers = useAppStore().swappers();
@@ -122,7 +127,7 @@ export function SettingsLists() {
122
127
  (uniqueItem) => uniqueItem.selected
123
128
  ).length;
124
129
 
125
- const handleEndItem = (totalSelected: number, total: number) => {
130
+ const handleSwapperEndItem = (totalSelected: number, total: number) => {
126
131
  switch (fetchStatus) {
127
132
  case 'loading':
128
133
  return <Skeleton variant="text" size="medium" width={50} />;
@@ -150,7 +155,7 @@ export function SettingsLists() {
150
155
  ),
151
156
  end: (
152
157
  <>
153
- {handleEndItem(totalSelectedBridgeSources, totalBridgeSources)}
158
+ {handleSwapperEndItem(totalSelectedBridgeSources, totalBridgeSources)}
154
159
  <Divider direction="horizontal" size={8} />
155
160
  <ChevronRightIcon color="black" />
156
161
  </>
@@ -168,7 +173,10 @@ export function SettingsLists() {
168
173
  ),
169
174
  end: (
170
175
  <>
171
- {handleEndItem(totalSelectedExchangeSources, totalExchangeSources)}
176
+ {handleSwapperEndItem(
177
+ totalSelectedExchangeSources,
178
+ totalExchangeSources
179
+ )}
172
180
  <Divider direction="horizontal" size={8} />
173
181
  <ChevronRightIcon color="gray" />
174
182
  </>
@@ -185,7 +193,15 @@ export function SettingsLists() {
185
193
  </Typography>
186
194
  ),
187
195
  start: <LanguageIcon color="gray" size={14} />,
188
- end: <ChevronRightIcon color="gray" />,
196
+ end: (
197
+ <>
198
+ <Typography variant="body" size="medium">
199
+ {currentLanguage}
200
+ </Typography>
201
+ <Divider direction="horizontal" size={8} />
202
+ <ChevronRightIcon color="gray" />,
203
+ </>
204
+ ),
189
205
  onClick: () => navigate(navigationRoutes.languages),
190
206
  };
191
207
 
@@ -12,9 +12,11 @@ import React from 'react';
12
12
 
13
13
  import { Layout, PageContainer } from '../components/Layout';
14
14
  import { useLanguage } from '../hooks/useLanguage';
15
+ import { useNavigateBack } from '../hooks/useNavigateBack';
15
16
 
16
17
  export function LanguagePage() {
17
18
  const { activeLanguage, changeLanguage, languages } = useLanguage();
19
+ const navigateBack = useNavigateBack();
18
20
 
19
21
  const languageList = languages.map((languageItem) => {
20
22
  const { local, label, SVGFlag } = languageItem;
@@ -26,7 +28,10 @@ export function LanguagePage() {
26
28
  {label}
27
29
  </Typography>
28
30
  ),
29
- onClick: () => changeLanguage(languageItem.local),
31
+ onClick: () => {
32
+ changeLanguage(languageItem.local);
33
+ navigateBack();
34
+ },
30
35
  end: <Radio value={local} />,
31
36
  start: <SVGFlag />,
32
37
  };