@rango-dev/widget-embedded 0.23.1-next.1 → 0.23.1-next.10
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/AppRoutes.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts +162 -0
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.types.d.ts +2 -0
- package/dist/components/Quote/Quote.types.d.ts.map +1 -1
- package/dist/components/Quote/QuoteCostDetails.d.ts.map +1 -1
- package/dist/components/Quote/{QuoteTrigger .d.ts → QuoteTrigger.d.ts} +1 -1
- package/dist/components/Quote/QuoteTrigger.d.ts.map +1 -0
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +1 -1
- package/dist/components/Quotes/Quotes.d.ts +4 -0
- package/dist/components/Quotes/Quotes.d.ts.map +1 -0
- package/dist/components/Quotes/Quotes.styles.d.ts +487 -0
- package/dist/components/Quotes/Quotes.styles.d.ts.map +1 -0
- package/dist/components/Quotes/Quotes.types.d.ts +9 -0
- package/dist/components/Quotes/Quotes.types.d.ts.map +1 -0
- package/dist/components/Quotes/SelectStrategy.d.ts +5 -0
- package/dist/components/Quotes/SelectStrategy.d.ts.map +1 -0
- package/dist/components/Quotes/index.d.ts +2 -0
- package/dist/components/Quotes/index.d.ts.map +1 -0
- package/dist/components/common/ActivateTabAlert/ActivateTabAlert.d.ts.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/navigationRoutes.d.ts +0 -1
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/quote.d.ts +4 -3
- package/dist/constants/quote.d.ts.map +1 -1
- package/dist/constants/settings.d.ts +6 -0
- package/dist/constants/settings.d.ts.map +1 -0
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.d.ts +5 -0
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.d.ts.map +1 -0
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts +325 -0
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts.map +1 -0
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.types.d.ts +9 -0
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.types.d.ts.map +1 -0
- package/dist/containers/ExpandedQuotes/index.d.ts +2 -0
- package/dist/containers/ExpandedQuotes/index.d.ts.map +1 -0
- package/dist/containers/Inputs/Inputs.d.ts +4 -0
- package/dist/containers/Inputs/Inputs.d.ts.map +1 -0
- package/dist/containers/Inputs/Inputs.styles.d.ts +325 -0
- package/dist/containers/Inputs/Inputs.styles.d.ts.map +1 -0
- package/dist/containers/Inputs/Inputs.types.d.ts +7 -0
- package/dist/containers/Inputs/Inputs.types.d.ts.map +1 -0
- package/dist/containers/Inputs/index.d.ts +2 -0
- package/dist/containers/Inputs/index.d.ts.map +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/containers/Settings/Lists.d.ts +3 -0
- package/dist/containers/Settings/Lists.d.ts.map +1 -0
- package/dist/hooks/useMobileDetect.d.ts +3 -0
- package/dist/hooks/useMobileDetect.d.ts.map +1 -0
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts +1 -0
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/Routes.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/types/config.d.ts +5 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/common.d.ts +1 -0
- package/dist/utils/common.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/AppRoutes.tsx +0 -5
- package/src/components/Layout/Layout.styles.ts +12 -7
- package/src/components/Layout/Layout.tsx +6 -6
- package/src/components/NoResult/NoResult.styles.ts +0 -2
- package/src/components/NoResult/NoResult.tsx +1 -0
- package/src/components/Quote/Quote.styles.ts +1 -1
- package/src/components/Quote/Quote.tsx +4 -2
- package/src/components/Quote/Quote.types.ts +2 -0
- package/src/components/Quote/QuoteCostDetails.tsx +10 -6
- package/src/components/Quote/{QuoteTrigger .tsx → QuoteTrigger.tsx} +3 -16
- package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +15 -12
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +0 -1
- package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +16 -13
- package/src/components/Quotes/Quotes.styles.ts +18 -0
- package/src/components/Quotes/Quotes.tsx +134 -0
- package/src/components/Quotes/Quotes.types.ts +9 -0
- package/src/components/Quotes/SelectStrategy.tsx +33 -0
- package/src/components/Quotes/index.ts +1 -0
- package/src/components/common/ActivateTabAlert/ActivateTabAlert.tsx +2 -4
- package/src/constants/index.ts +1 -0
- package/src/constants/navigationRoutes.ts +0 -1
- package/src/constants/quote.ts +22 -7
- package/src/constants/settings.ts +5 -0
- package/src/containers/ExpandedQuotes/ExpandedQuotes.styles.ts +30 -0
- package/src/containers/ExpandedQuotes/ExpandedQuotes.tsx +71 -0
- package/src/containers/ExpandedQuotes/ExpandedQuotes.types.ts +9 -0
- package/src/containers/ExpandedQuotes/index.ts +1 -0
- package/src/containers/Inputs/Inputs.styles.ts +12 -0
- package/src/containers/Inputs/Inputs.tsx +165 -0
- package/src/containers/Inputs/Inputs.types.ts +7 -0
- package/src/containers/Inputs/index.ts +1 -0
- package/src/containers/QuoteInfo/QuoteInfo.tsx +2 -0
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +1 -0
- package/src/containers/Settings/Lists.tsx +265 -0
- package/src/hooks/useMobileDetect.ts +21 -0
- package/src/hooks/useSwapInput.ts +3 -1
- package/src/index.ts +2 -0
- package/src/pages/ConfirmSwapPage.tsx +0 -1
- package/src/pages/Home.tsx +146 -230
- package/src/pages/Routes.tsx +6 -69
- package/src/pages/SettingsPage.tsx +6 -184
- package/src/types/config.ts +6 -0
- package/src/utils/common.ts +3 -0
- package/dist/components/Quote/QuoteTrigger .d.ts.map +0 -1
- package/dist/pages/ThemePage.d.ts +0 -3
- package/dist/pages/ThemePage.d.ts.map +0 -1
- package/src/pages/ThemePage.tsx +0 -90
|
@@ -1,194 +1,21 @@
|
|
|
1
1
|
import { i18n } from '@lingui/core';
|
|
2
|
-
import {
|
|
3
|
-
Alert,
|
|
4
|
-
Button,
|
|
5
|
-
ChevronRightIcon,
|
|
6
|
-
Divider,
|
|
7
|
-
InfoIcon,
|
|
8
|
-
List,
|
|
9
|
-
ListItemButton,
|
|
10
|
-
Skeleton,
|
|
11
|
-
styled,
|
|
12
|
-
Switch,
|
|
13
|
-
Tooltip,
|
|
14
|
-
Typography,
|
|
15
|
-
} from '@rango-dev/ui';
|
|
2
|
+
import { Alert, Button, styled } from '@rango-dev/ui';
|
|
16
3
|
import React from 'react';
|
|
17
|
-
import {
|
|
18
|
-
useInRouterContext,
|
|
19
|
-
useNavigate,
|
|
20
|
-
useSearchParams,
|
|
21
|
-
} from 'react-router-dom';
|
|
4
|
+
import { useInRouterContext, useSearchParams } from 'react-router-dom';
|
|
22
5
|
|
|
23
6
|
import { Layout, PageContainer } from '../components/Layout';
|
|
24
7
|
import { Slippage } from '../components/Slippage';
|
|
25
|
-
import { SlippageTooltipContainer as TooltipContainer } from '../components/Slippage/Slippage.styles';
|
|
26
|
-
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
27
8
|
import { SearchParams } from '../constants/searchParams';
|
|
9
|
+
import { SettingsLists } from '../containers/Settings/Lists';
|
|
28
10
|
import { useAppStore } from '../store/AppStore';
|
|
29
|
-
import { getContainer } from '../utils/common';
|
|
30
|
-
import { getUniqueSwappersGroups, isFeatureHidden } from '../utils/settings';
|
|
31
11
|
|
|
32
12
|
const ResetAction = styled('div', {
|
|
33
13
|
paddingLeft: '$8',
|
|
34
14
|
});
|
|
35
15
|
|
|
36
16
|
export function SettingsPage() {
|
|
37
|
-
const
|
|
38
|
-
const { theme } = useAppStore().config;
|
|
39
|
-
const fetchStatus = useAppStore().fetchStatus;
|
|
40
|
-
const swappers = useAppStore().swappers();
|
|
41
|
-
const disabledLiquiditySources = useAppStore().getDisabledLiquiditySources();
|
|
42
|
-
const {
|
|
43
|
-
config: { features },
|
|
44
|
-
isInCampaignMode,
|
|
45
|
-
updateCampaignMode,
|
|
46
|
-
} = useAppStore();
|
|
17
|
+
const { isInCampaignMode, updateCampaignMode } = useAppStore();
|
|
47
18
|
const campaignMode = isInCampaignMode();
|
|
48
|
-
const isThemeHidden = isFeatureHidden('theme', features);
|
|
49
|
-
|
|
50
|
-
const isLiquidityHidden = isFeatureHidden('liquiditySource', features);
|
|
51
|
-
|
|
52
|
-
const isLanguageHidden = isFeatureHidden('language', features);
|
|
53
|
-
|
|
54
|
-
const infiniteApprove = useAppStore().infiniteApprove;
|
|
55
|
-
const toggleInfiniteApprove = useAppStore().toggleInfiniteApprove;
|
|
56
|
-
|
|
57
|
-
const supportedUniqueSwappersGroups = getUniqueSwappersGroups(
|
|
58
|
-
swappers,
|
|
59
|
-
disabledLiquiditySources
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const bridgeSources = supportedUniqueSwappersGroups.filter(
|
|
63
|
-
(uniqueItem) =>
|
|
64
|
-
uniqueItem.type === 'BRIDGE' || uniqueItem.type === 'AGGREGATOR'
|
|
65
|
-
);
|
|
66
|
-
const totalBridgeSources = bridgeSources.length;
|
|
67
|
-
const totalSelectedBridgeSources = bridgeSources.filter(
|
|
68
|
-
(uniqueItem) => uniqueItem.selected
|
|
69
|
-
).length;
|
|
70
|
-
|
|
71
|
-
const exchangeSources = supportedUniqueSwappersGroups.filter(
|
|
72
|
-
(uniqueItem) => uniqueItem.type === 'DEX'
|
|
73
|
-
);
|
|
74
|
-
const totalExchangeSources = exchangeSources.length;
|
|
75
|
-
const totalSelectedExchangeSources = exchangeSources.filter(
|
|
76
|
-
(uniqueItem) => uniqueItem.selected
|
|
77
|
-
).length;
|
|
78
|
-
|
|
79
|
-
const handleEndItem = (totalSelected: number, total: number) => {
|
|
80
|
-
switch (fetchStatus) {
|
|
81
|
-
case 'loading':
|
|
82
|
-
return <Skeleton variant="text" size="medium" width={50} />;
|
|
83
|
-
case 'failed':
|
|
84
|
-
return (
|
|
85
|
-
<Typography variant="body" size="medium" color="$error500">
|
|
86
|
-
{i18n.t('Loading failed')}
|
|
87
|
-
</Typography>
|
|
88
|
-
);
|
|
89
|
-
default:
|
|
90
|
-
return (
|
|
91
|
-
<Typography variant="body" size="medium">
|
|
92
|
-
{`${totalSelected} / ${total}`}
|
|
93
|
-
</Typography>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const bridgeItem = {
|
|
99
|
-
id: 'bridge-item',
|
|
100
|
-
title: (
|
|
101
|
-
<Typography variant="title" size="xmedium">
|
|
102
|
-
{i18n.t('Enabled bridges')}
|
|
103
|
-
</Typography>
|
|
104
|
-
),
|
|
105
|
-
end: (
|
|
106
|
-
<>
|
|
107
|
-
{handleEndItem(totalSelectedBridgeSources, totalBridgeSources)}
|
|
108
|
-
<Divider direction="horizontal" size={8} />
|
|
109
|
-
<ChevronRightIcon color="black" />
|
|
110
|
-
</>
|
|
111
|
-
),
|
|
112
|
-
onClick: () => navigate(navigationRoutes.bridges),
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const exchangeItem = {
|
|
116
|
-
id: 'exchange-item',
|
|
117
|
-
title: (
|
|
118
|
-
<Typography variant="title" size="xmedium">
|
|
119
|
-
{i18n.t('Enabled exchanges')}
|
|
120
|
-
</Typography>
|
|
121
|
-
),
|
|
122
|
-
end: (
|
|
123
|
-
<>
|
|
124
|
-
{handleEndItem(totalSelectedExchangeSources, totalExchangeSources)}
|
|
125
|
-
<Divider direction="horizontal" size={8} />
|
|
126
|
-
<ChevronRightIcon color="gray" />
|
|
127
|
-
</>
|
|
128
|
-
),
|
|
129
|
-
onClick: () => navigate(navigationRoutes.exchanges),
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
const languageItem = {
|
|
133
|
-
id: 'language-item',
|
|
134
|
-
title: (
|
|
135
|
-
<Typography variant="title" size="xmedium">
|
|
136
|
-
{i18n.t('Language')}
|
|
137
|
-
</Typography>
|
|
138
|
-
),
|
|
139
|
-
end: <ChevronRightIcon color="gray" />,
|
|
140
|
-
onClick: () => navigate(navigationRoutes.languages),
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const themeItem = {
|
|
144
|
-
id: 'theme-item',
|
|
145
|
-
title: (
|
|
146
|
-
<Typography variant="title" size="xmedium">
|
|
147
|
-
{i18n.t('Theme')}
|
|
148
|
-
</Typography>
|
|
149
|
-
),
|
|
150
|
-
end: <ChevronRightIcon color="gray" />,
|
|
151
|
-
onClick: () => navigate(navigationRoutes.themes),
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
const infiniteApprovalItem = {
|
|
155
|
-
id: 'infinite-approval-item',
|
|
156
|
-
title: (
|
|
157
|
-
<>
|
|
158
|
-
<Typography variant="title" size="xmedium">
|
|
159
|
-
{i18n.t('Infinite approval')}
|
|
160
|
-
</Typography>
|
|
161
|
-
<Divider direction="horizontal" size={4} />
|
|
162
|
-
<Tooltip
|
|
163
|
-
side="top"
|
|
164
|
-
sideOffset={4}
|
|
165
|
-
container={getContainer()}
|
|
166
|
-
content={
|
|
167
|
-
<TooltipContainer>
|
|
168
|
-
<Typography variant="label" size="medium" color="neutral700">
|
|
169
|
-
{i18n.t(
|
|
170
|
-
"Enabling the 'Infinite approval' mode grants unrestricted access to smart contracts of DEXes/Bridges, allowing them to utilize the approved token amount without limitations."
|
|
171
|
-
)}
|
|
172
|
-
</Typography>
|
|
173
|
-
</TooltipContainer>
|
|
174
|
-
}>
|
|
175
|
-
<InfoIcon color="gray" />
|
|
176
|
-
</Tooltip>
|
|
177
|
-
</>
|
|
178
|
-
),
|
|
179
|
-
end: <Switch checked={infiniteApprove} />,
|
|
180
|
-
onClick: toggleInfiniteApprove,
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
const settingItems = isLiquidityHidden ? [] : [bridgeItem, exchangeItem];
|
|
184
|
-
|
|
185
|
-
if (!isLanguageHidden) {
|
|
186
|
-
settingItems.push(languageItem);
|
|
187
|
-
}
|
|
188
|
-
if (!theme?.singleTheme && !isThemeHidden) {
|
|
189
|
-
settingItems.push(themeItem);
|
|
190
|
-
}
|
|
191
|
-
settingItems.push(infiniteApprovalItem);
|
|
192
19
|
|
|
193
20
|
const [, setSearchParams] = useSearchParams();
|
|
194
21
|
const isRouterInContext = useInRouterContext();
|
|
@@ -222,19 +49,14 @@ export function SettingsPage() {
|
|
|
222
49
|
action={
|
|
223
50
|
<ResetAction>
|
|
224
51
|
<Button type="secondary" size="small" onClick={onClick}>
|
|
225
|
-
Reset
|
|
52
|
+
{i18n.t('Reset')}
|
|
226
53
|
</Button>
|
|
227
54
|
</ResetAction>
|
|
228
55
|
}
|
|
229
56
|
/>
|
|
230
57
|
)}
|
|
231
58
|
<Slippage />
|
|
232
|
-
<
|
|
233
|
-
type={
|
|
234
|
-
<ListItemButton title="_" id="_" onClick={() => console.log()} />
|
|
235
|
-
}
|
|
236
|
-
items={settingItems}
|
|
237
|
-
/>
|
|
59
|
+
<SettingsLists />
|
|
238
60
|
</PageContainer>
|
|
239
61
|
</Layout>
|
|
240
62
|
);
|
package/src/types/config.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { ProviderInterface } from '@rango-dev/wallets-react';
|
|
|
3
3
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
4
4
|
import type { Asset } from 'rango-sdk';
|
|
5
5
|
|
|
6
|
+
export type WidgetVariant = 'default' | 'expandable';
|
|
7
|
+
|
|
6
8
|
/**
|
|
7
9
|
* The above type defines a set of optional color properties for a widget.
|
|
8
10
|
* @property {string} background
|
|
@@ -179,6 +181,9 @@ export type Features = Partial<
|
|
|
179
181
|
* - 'connectWalletButton': Visibility state for the wallet connect icon.
|
|
180
182
|
* - 'language': Visibility state for the language.
|
|
181
183
|
* - 'experimentalRoute': Enablement state for the experimental route.
|
|
184
|
+
* @property {WidgetVariant} variant
|
|
185
|
+
* If it is expandable, multiple routes will show up on the home page;
|
|
186
|
+
* if not, you will need to go to a different page to see the suggested routes.
|
|
182
187
|
*/
|
|
183
188
|
|
|
184
189
|
export type WidgetConfig = {
|
|
@@ -199,4 +204,5 @@ export type WidgetConfig = {
|
|
|
199
204
|
externalWallets?: boolean;
|
|
200
205
|
enableNewLiquiditySources?: boolean;
|
|
201
206
|
features?: Features;
|
|
207
|
+
variant?: WidgetVariant;
|
|
202
208
|
};
|
package/src/utils/common.ts
CHANGED
|
@@ -34,3 +34,6 @@ export function containsText(text: string, searchText: string): boolean {
|
|
|
34
34
|
|
|
35
35
|
export const getContainer = () =>
|
|
36
36
|
document.getElementById(WIDGET_UI_ID.SWAP_BOX_ID) as HTMLElement;
|
|
37
|
+
|
|
38
|
+
export const getExpanded = () =>
|
|
39
|
+
document.getElementById(WIDGET_UI_ID.EXPANDED_BOX_ID) as HTMLElement;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QuoteTrigger .d.ts","sourceRoot":"","sources":["../../../src/components/Quote/QuoteTrigger .tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAWhF,OAAO,KAA8B,MAAM,OAAO,CAAC;AAkCnD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA6KpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemePage.d.ts","sourceRoot":"","sources":["../../src/pages/ThemePage.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,wBAAgB,SAAS,sBAiExB"}
|
package/src/pages/ThemePage.tsx
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { i18n } from '@lingui/core';
|
|
2
|
-
import {
|
|
3
|
-
AutoThemeIcon,
|
|
4
|
-
DarkModeIcon,
|
|
5
|
-
LightModeIcon,
|
|
6
|
-
List,
|
|
7
|
-
ListItemButton,
|
|
8
|
-
Radio,
|
|
9
|
-
RadioRoot,
|
|
10
|
-
Typography,
|
|
11
|
-
} from '@rango-dev/ui';
|
|
12
|
-
import React from 'react';
|
|
13
|
-
|
|
14
|
-
import { Layout, PageContainer } from '../components/Layout';
|
|
15
|
-
import { useAppStore } from '../store/AppStore';
|
|
16
|
-
|
|
17
|
-
type Theme = 'dark' | 'light' | 'auto';
|
|
18
|
-
|
|
19
|
-
enum Mode {
|
|
20
|
-
DARK = 'dark',
|
|
21
|
-
LIGHT = 'light',
|
|
22
|
-
AUTO = 'auto',
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function ThemePage() {
|
|
26
|
-
const { setTheme, theme } = useAppStore();
|
|
27
|
-
|
|
28
|
-
const themesList = [
|
|
29
|
-
{
|
|
30
|
-
id: Mode.LIGHT,
|
|
31
|
-
value: Mode.LIGHT,
|
|
32
|
-
title: (
|
|
33
|
-
<Typography variant="title" size="xmedium">
|
|
34
|
-
{i18n.t('Light')}
|
|
35
|
-
</Typography>
|
|
36
|
-
),
|
|
37
|
-
onClick: () => setTheme(Mode.LIGHT as Theme),
|
|
38
|
-
start: <LightModeIcon color="gray" />,
|
|
39
|
-
end: <Radio value={Mode.LIGHT} />,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
id: Mode.DARK,
|
|
43
|
-
value: Mode.DARK,
|
|
44
|
-
title: (
|
|
45
|
-
<Typography variant="title" size="xmedium">
|
|
46
|
-
{i18n.t('Dark')}
|
|
47
|
-
</Typography>
|
|
48
|
-
),
|
|
49
|
-
onClick: () => setTheme(Mode.DARK as Theme),
|
|
50
|
-
start: <DarkModeIcon color="gray" />,
|
|
51
|
-
end: <Radio value={Mode.DARK} />,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: Mode.AUTO,
|
|
55
|
-
value: Mode.AUTO,
|
|
56
|
-
title: (
|
|
57
|
-
<Typography variant="title" size="xmedium">
|
|
58
|
-
{i18n.t('Auto')}
|
|
59
|
-
</Typography>
|
|
60
|
-
),
|
|
61
|
-
onClick: () => setTheme(Mode.AUTO as Theme),
|
|
62
|
-
start: <AutoThemeIcon color="gray" />,
|
|
63
|
-
end: <Radio value={Mode.AUTO} />,
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<Layout
|
|
69
|
-
header={{
|
|
70
|
-
title: i18n.t('Theme'),
|
|
71
|
-
}}>
|
|
72
|
-
<PageContainer>
|
|
73
|
-
<RadioRoot
|
|
74
|
-
onValueChange={(value) => setTheme(value as Theme)}
|
|
75
|
-
value={theme}>
|
|
76
|
-
<List
|
|
77
|
-
type={
|
|
78
|
-
<ListItemButton
|
|
79
|
-
title={i18n.t('Theme')}
|
|
80
|
-
id="_"
|
|
81
|
-
onClick={() => console.log()}
|
|
82
|
-
/>
|
|
83
|
-
}
|
|
84
|
-
items={themesList}
|
|
85
|
-
/>
|
|
86
|
-
</RadioRoot>
|
|
87
|
-
</PageContainer>
|
|
88
|
-
</Layout>
|
|
89
|
-
);
|
|
90
|
-
}
|