@rango-dev/widget-embedded 0.1.10-next.106 → 0.1.10-next.114
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/App.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/HeaderButtons.d.ts +4 -1
- package/dist/components/HeaderButtons.d.ts.map +1 -1
- package/dist/components/Layout.d.ts.map +1 -1
- package/dist/components/SwapDetailsPlaceholder.d.ts +9 -0
- package/dist/components/SwapDetailsPlaceholder.d.ts.map +1 -0
- package/dist/components/TokenPreview.d.ts +1 -1
- package/dist/components/TokenPreview.d.ts.map +1 -1
- package/dist/globalStyles.d.ts.map +1 -1
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/HistoryPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcesPage.d.ts.map +1 -1
- package/dist/pages/SelectTokenPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts +1 -0
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/bestRoute.d.ts +1 -1
- package/dist/store/bestRoute.d.ts.map +1 -1
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +14 -0
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/utils/date.d.ts +3 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/routing.d.ts +1 -0
- package/dist/utils/routing.d.ts.map +1 -1
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +249 -115
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +249 -115
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +250 -116
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +4 -3
- package/readme.md +1 -2
- package/src/App.tsx +4 -1
- package/src/components/AppRoutes.tsx +15 -10
- package/src/components/HeaderButtons.tsx +9 -2
- package/src/components/Layout.tsx +25 -6
- package/src/components/SwapDetailsPlaceholder.tsx +32 -0
- package/src/components/TokenPreview.tsx +7 -4
- package/src/globalStyles.ts +2 -1
- package/src/pages/ConfirmSwapPage.tsx +9 -2
- package/src/pages/HistoryPage.tsx +4 -4
- package/src/pages/Home.tsx +18 -7
- package/src/pages/LiquiditySourcesPage.tsx +2 -0
- package/src/pages/SelectTokenPage.tsx +3 -0
- package/src/pages/SettingsPage.tsx +3 -0
- package/src/pages/SwapDetailsPage.tsx +63 -4
- package/src/pages/WalletsPage.tsx +27 -8
- package/src/store/bestRoute.ts +40 -13
- package/src/store/ui.ts +4 -0
- package/src/store/wallets.ts +4 -1
- package/src/utils/date.ts +62 -0
- package/src/utils/routing.ts +23 -13
- package/src/utils/swap.ts +3 -1
- package/dist/components/Header.d.ts +0 -10
- package/dist/components/Header.d.ts.map +0 -1
- package/src/components/Header.tsx +0 -37
|
@@ -15,6 +15,9 @@ import { useUiStore } from '../store/ui';
|
|
|
15
15
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
16
16
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
17
17
|
import { useTranslation } from 'react-i18next';
|
|
18
|
+
import { useMetaStore } from '../store/meta';
|
|
19
|
+
import { Spinner } from '@rango-dev/ui';
|
|
20
|
+
import { LoadingFailedAlert } from '@rango-dev/ui';
|
|
18
21
|
|
|
19
22
|
interface PropTypes {
|
|
20
23
|
supportedWallets: 'all' | WalletType[];
|
|
@@ -25,9 +28,17 @@ const ListContainer = styled('div', {
|
|
|
25
28
|
display: 'grid',
|
|
26
29
|
gap: '.5rem',
|
|
27
30
|
gridTemplateColumns: ' repeat(2, minmax(0, 1fr))',
|
|
28
|
-
height: '450px',
|
|
29
31
|
alignContent: 'baseline',
|
|
30
32
|
padding: '0.5rem',
|
|
33
|
+
overflowY: 'auto',
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const LoaderContainer = styled('div', {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
width: '100%',
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
top: '50%',
|
|
31
42
|
});
|
|
32
43
|
|
|
33
44
|
const AlertContainer = styled('div', {
|
|
@@ -50,6 +61,7 @@ export function WalletsPage({ supportedWallets, multiWallets }: PropTypes) {
|
|
|
50
61
|
const [walletErrorMessage, setWalletErrorMessage] = useState('');
|
|
51
62
|
const toggleConnectWalletsButton =
|
|
52
63
|
useUiStore.use.toggleConnectWalletsButton();
|
|
64
|
+
const loadingMetaStatus = useMetaStore.use.loadingStatus();
|
|
53
65
|
const { t } = useTranslation();
|
|
54
66
|
|
|
55
67
|
const onSelectWallet = async (type: WalletType) => {
|
|
@@ -104,14 +116,21 @@ export function WalletsPage({ supportedWallets, multiWallets }: PropTypes) {
|
|
|
104
116
|
<Alert type="error">{walletErrorMessage}</Alert>
|
|
105
117
|
</AlertContainer>
|
|
106
118
|
)}
|
|
119
|
+
{loadingMetaStatus === 'loading' && (
|
|
120
|
+
<LoaderContainer className="loader">
|
|
121
|
+
<Spinner size={24} />
|
|
122
|
+
</LoaderContainer>
|
|
123
|
+
)}
|
|
124
|
+
{loadingMetaStatus === 'failed' && <LoadingFailedAlert />}
|
|
107
125
|
<ListContainer>
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
126
|
+
{loadingMetaStatus === 'success' &&
|
|
127
|
+
sortedWallets.map((wallet, index) => (
|
|
128
|
+
<Wallet
|
|
129
|
+
{...wallet}
|
|
130
|
+
key={`${index}-${wallet.type}`}
|
|
131
|
+
onClick={onSelectWallet}
|
|
132
|
+
/>
|
|
133
|
+
))}
|
|
115
134
|
</ListContainer>
|
|
116
135
|
</>
|
|
117
136
|
</SecondaryPage>
|
package/src/store/bestRoute.ts
CHANGED
|
@@ -71,6 +71,7 @@ export const useBestRouteStore = createSelectors(
|
|
|
71
71
|
set((state) => {
|
|
72
72
|
let outputAmount: BigNumber | null = null;
|
|
73
73
|
let outputUsdValue: BigNumber = ZERO;
|
|
74
|
+
if (!state.inputAmount || state.inputAmount === '0') return {};
|
|
74
75
|
if (!!bestRoute) {
|
|
75
76
|
outputAmount = !!bestRoute.result?.outputAmount
|
|
76
77
|
? new BigNumber(bestRoute.result?.outputAmount)
|
|
@@ -145,6 +146,7 @@ export const useBestRouteStore = createSelectors(
|
|
|
145
146
|
toToken: token,
|
|
146
147
|
})),
|
|
147
148
|
setInputAmount: (amount) => {
|
|
149
|
+
console.log(amount, typeof amount);
|
|
148
150
|
set((state) => ({
|
|
149
151
|
inputAmount: amount,
|
|
150
152
|
...(!amount && {
|
|
@@ -211,7 +213,7 @@ export const useBestRouteStore = createSelectors(
|
|
|
211
213
|
fromToken,
|
|
212
214
|
inputAmount,
|
|
213
215
|
outputAmount: null,
|
|
214
|
-
inputUsdValue:
|
|
216
|
+
inputUsdValue: getUsdValue(fromToken || null, inputAmount),
|
|
215
217
|
outputUsdValue: new BigNumber(0),
|
|
216
218
|
toChain,
|
|
217
219
|
toToken,
|
|
@@ -231,11 +233,11 @@ const bestRoute = (
|
|
|
231
233
|
settingsStore: typeof useSettingsStore
|
|
232
234
|
) => {
|
|
233
235
|
let abortController: AbortController | null = null;
|
|
234
|
-
const fetchBestRoute =
|
|
236
|
+
const fetchBestRoute = () => {
|
|
235
237
|
const { fromToken, toToken, inputAmount } = bestRouteStore.getState();
|
|
236
238
|
const { slippage, customSlippage, disabledLiquiditySources } =
|
|
237
239
|
settingsStore.getState();
|
|
238
|
-
if (!fromToken || !toToken || !inputAmount) return;
|
|
240
|
+
if (!fromToken || !toToken || !inputAmount || inputAmount === '0') return;
|
|
239
241
|
abortController?.abort();
|
|
240
242
|
abortController = new AbortController();
|
|
241
243
|
const userSlippage = !!customSlippage ? customSlippage : slippage;
|
|
@@ -249,12 +251,13 @@ const bestRoute = (
|
|
|
249
251
|
userSlippage,
|
|
250
252
|
false
|
|
251
253
|
);
|
|
252
|
-
bestRouteStore.
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
254
|
+
if (!bestRouteStore.getState().loading)
|
|
255
|
+
bestRouteStore.setState({
|
|
256
|
+
loading: true,
|
|
257
|
+
bestRoute: null,
|
|
258
|
+
outputAmount: null,
|
|
259
|
+
outputUsdValue: new BigNumber(0),
|
|
260
|
+
});
|
|
258
261
|
httpService
|
|
259
262
|
.getBestRoute(requestBody, {
|
|
260
263
|
signal: abortController.signal,
|
|
@@ -272,7 +275,32 @@ const bestRoute = (
|
|
|
272
275
|
loading: false,
|
|
273
276
|
});
|
|
274
277
|
});
|
|
275
|
-
}
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
const debouncedFetchBestRoute = debounce(fetchBestRoute, 600);
|
|
281
|
+
|
|
282
|
+
const bestRouteParamsListener = () => {
|
|
283
|
+
const { fromToken, toToken, inputAmount, inputUsdValue } =
|
|
284
|
+
useBestRouteStore.getState();
|
|
285
|
+
if (!inputAmount || inputAmount === '0') return;
|
|
286
|
+
|
|
287
|
+
if (tokensAreEqual(fromToken, toToken))
|
|
288
|
+
return bestRouteStore.setState({
|
|
289
|
+
loading: false,
|
|
290
|
+
bestRoute: null,
|
|
291
|
+
outputAmount: new BigNumber(inputAmount),
|
|
292
|
+
outputUsdValue: inputUsdValue,
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
if (!bestRouteStore.getState().loading)
|
|
296
|
+
bestRouteStore.setState({
|
|
297
|
+
loading: true,
|
|
298
|
+
bestRoute: null,
|
|
299
|
+
outputAmount: null,
|
|
300
|
+
outputUsdValue: new BigNumber(0),
|
|
301
|
+
});
|
|
302
|
+
debouncedFetchBestRoute();
|
|
303
|
+
};
|
|
276
304
|
|
|
277
305
|
useBestRouteStore.subscribe(
|
|
278
306
|
(state) => ({
|
|
@@ -282,8 +310,7 @@ const bestRoute = (
|
|
|
282
310
|
toToken: state.toToken,
|
|
283
311
|
inputAmount: state.inputAmount,
|
|
284
312
|
}),
|
|
285
|
-
|
|
286
|
-
fetchBestRoute.bind(null),
|
|
313
|
+
bestRouteParamsListener,
|
|
287
314
|
{
|
|
288
315
|
equalityFn: (prevState, state) => {
|
|
289
316
|
if (isRouteParametersChanged(prevState, state)) return false;
|
|
@@ -298,7 +325,7 @@ const bestRoute = (
|
|
|
298
325
|
customSlippage: state.customSlippage,
|
|
299
326
|
disabledLiquiditySources: state.disabledLiquiditySources,
|
|
300
327
|
}),
|
|
301
|
-
|
|
328
|
+
bestRouteParamsListener,
|
|
302
329
|
{
|
|
303
330
|
equalityFn: (prevState, state) => {
|
|
304
331
|
if (isRouteParametersChanged(prevState, state)) return false;
|
package/src/store/ui.ts
CHANGED
|
@@ -4,18 +4,22 @@ import createSelectors from './selectors';
|
|
|
4
4
|
interface UiState {
|
|
5
5
|
connectWalletsButtonDisabled: boolean;
|
|
6
6
|
selectedSwapRequestId: string | null;
|
|
7
|
+
currentPage: string;
|
|
7
8
|
toggleConnectWalletsButton: () => void;
|
|
8
9
|
setSelectedSwap: (requestId: string | null) => void;
|
|
10
|
+
setCurrentPage: (path: string) => void;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export const useUiStore = createSelectors(
|
|
12
14
|
create<UiState>()((set) => ({
|
|
13
15
|
connectWalletsButtonDisabled: false,
|
|
14
16
|
selectedSwapRequestId: null,
|
|
17
|
+
currentPage: '',
|
|
15
18
|
toggleConnectWalletsButton: () =>
|
|
16
19
|
set((state) => ({
|
|
17
20
|
connectWalletsButtonDisabled: !state.connectWalletsButtonDisabled,
|
|
18
21
|
})),
|
|
19
22
|
setSelectedSwap: (requestId) => set({ selectedSwapRequestId: requestId }),
|
|
23
|
+
setCurrentPage: (path) => set({ currentPage: path }),
|
|
20
24
|
}))
|
|
21
25
|
);
|
package/src/store/wallets.ts
CHANGED
|
@@ -142,7 +142,7 @@ export const useWalletsStore = createSelectors(
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
return {
|
|
145
|
-
selectedWallets:
|
|
145
|
+
selectedWallets: selectedWallets,
|
|
146
146
|
};
|
|
147
147
|
}),
|
|
148
148
|
setSelectedWallet: (wallet) =>
|
|
@@ -188,3 +188,6 @@ useWalletsStore.subscribe(
|
|
|
188
188
|
equalityFn: shallow,
|
|
189
189
|
}
|
|
190
190
|
);
|
|
191
|
+
|
|
192
|
+
export const fetchingBalanceSelector = (state: WalletsStore) =>
|
|
193
|
+
!!state.balances.find((wallet) => wallet.loading);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import { GroupBy } from '@rango-dev/ui';
|
|
4
|
+
|
|
5
|
+
export const groupSwapsByDate: GroupBy = swaps => {
|
|
6
|
+
const output: Map<
|
|
7
|
+
string,
|
|
8
|
+
{
|
|
9
|
+
title: string;
|
|
10
|
+
swaps: PendingSwap[];
|
|
11
|
+
}
|
|
12
|
+
> = new Map([
|
|
13
|
+
[
|
|
14
|
+
'today',
|
|
15
|
+
{
|
|
16
|
+
title: 'Today',
|
|
17
|
+
swaps: [],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
'week',
|
|
22
|
+
{
|
|
23
|
+
title: 'This week',
|
|
24
|
+
swaps: [],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
'month',
|
|
29
|
+
{
|
|
30
|
+
title: 'This month',
|
|
31
|
+
swaps: [],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
'year',
|
|
36
|
+
{
|
|
37
|
+
title: 'This year',
|
|
38
|
+
swaps: [],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
'history',
|
|
43
|
+
{
|
|
44
|
+
title: 'History',
|
|
45
|
+
swaps: [],
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
const now = dayjs();
|
|
51
|
+
swaps.forEach(swap => {
|
|
52
|
+
const swapDate = dayjs(Number(swap.creationTime));
|
|
53
|
+
if (now.isSame(swapDate, 'day')) output.get('today')?.swaps.push(swap);
|
|
54
|
+
else if (now.isSame(swapDate, 'week')) output.get('week')?.swaps.push(swap);
|
|
55
|
+
else if (now.isSame(swapDate, 'month'))
|
|
56
|
+
output.get('month')?.swaps.push(swap);
|
|
57
|
+
else if (now.isSame(swapDate, 'year')) output.get('year')?.swaps.push(swap);
|
|
58
|
+
else output.get('history')?.swaps.push(swap);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return Array.from(output.values());
|
|
62
|
+
};
|
package/src/utils/routing.ts
CHANGED
|
@@ -117,19 +117,22 @@ export function isRouteParametersChanged(
|
|
|
117
117
|
currentParams: BestRouteParams
|
|
118
118
|
) {
|
|
119
119
|
return (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
prevParams.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
currentParams.
|
|
120
|
+
!!currentParams.fromToken &&
|
|
121
|
+
!!currentParams.toToken &&
|
|
122
|
+
(prevParams.fromChain?.name !== currentParams.fromChain?.name ||
|
|
123
|
+
prevParams.toChain?.name !== currentParams.toChain?.name ||
|
|
124
|
+
prevParams.fromToken?.symbol !== currentParams.fromToken?.symbol ||
|
|
125
|
+
prevParams.toToken?.symbol !== currentParams.toToken?.symbol ||
|
|
126
|
+
prevParams.fromToken?.blockchain !==
|
|
127
|
+
currentParams.fromToken?.blockchain ||
|
|
128
|
+
prevParams.toToken?.blockchain !== currentParams.toToken?.blockchain ||
|
|
129
|
+
prevParams.fromToken?.address !== currentParams.fromToken?.address ||
|
|
130
|
+
prevParams.toToken?.address !== currentParams.toToken?.address ||
|
|
131
|
+
prevParams.inputAmount !== currentParams.inputAmount ||
|
|
132
|
+
prevParams.slippage !== currentParams.slippage ||
|
|
133
|
+
prevParams.customSlippage !== currentParams.customSlippage ||
|
|
134
|
+
prevParams.disabledLiquiditySources?.length !==
|
|
135
|
+
currentParams.disabledLiquiditySources?.length)
|
|
133
136
|
);
|
|
134
137
|
}
|
|
135
138
|
|
|
@@ -148,3 +151,10 @@ export function getBestRouteWithCalculatedFees(
|
|
|
148
151
|
result: { ...bestRoute.result, swaps: swapsWithFee },
|
|
149
152
|
};
|
|
150
153
|
}
|
|
154
|
+
|
|
155
|
+
//todo: refactor bestRoute store and add loadingStatus
|
|
156
|
+
export const getBestRouteStatus = (loading: boolean, error: boolean) => {
|
|
157
|
+
if (loading) return 'loading';
|
|
158
|
+
if (error) return 'failed';
|
|
159
|
+
else return 'success';
|
|
160
|
+
};
|
package/src/utils/swap.ts
CHANGED
|
@@ -434,6 +434,8 @@ export function createBestRouteRequestBody(
|
|
|
434
434
|
});
|
|
435
435
|
});
|
|
436
436
|
|
|
437
|
+
const filteredBlockchains = selectedWallets.map((wallet) => wallet.chain);
|
|
438
|
+
|
|
437
439
|
const requestBody: BestRouteRequest = {
|
|
438
440
|
amount: inputAmount.toString(),
|
|
439
441
|
checkPrerequisites,
|
|
@@ -451,8 +453,8 @@ export function createBestRouteRequestBody(
|
|
|
451
453
|
selectedWallets: selectedWalletsMap,
|
|
452
454
|
swapperGroups: disabledLiquiditySources,
|
|
453
455
|
swappersGroupsExclude: true,
|
|
454
|
-
//@ts-ignore
|
|
455
456
|
slippage: slippage.toString(),
|
|
457
|
+
...(checkPrerequisites && { blockchains: filteredBlockchains }),
|
|
456
458
|
};
|
|
457
459
|
|
|
458
460
|
return requestBody;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const HeaderContainer: any;
|
|
3
|
-
export interface PropTypes {
|
|
4
|
-
onClickRefresh: () => void;
|
|
5
|
-
title?: string;
|
|
6
|
-
titleSize?: number;
|
|
7
|
-
titleWeight?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function Header(props: PropTypes): JSX.Element;
|
|
10
|
-
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../src/components/Header.tsx"],"names":[],"mappings":";AAKA,eAAO,MAAM,eAAe,KAM1B,CAAC;AAEH,MAAM,WAAW,SAAS;IACxB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,eAgBtC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { css, styled, Typography } from '@rango-dev/ui';
|
|
3
|
-
import { HeaderButtons } from './HeaderButtons';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
|
|
6
|
-
export const HeaderContainer = styled('div', {
|
|
7
|
-
display: 'flex',
|
|
8
|
-
justifyContent: 'space-between',
|
|
9
|
-
alignItems: 'center',
|
|
10
|
-
width: '100%',
|
|
11
|
-
padding: '$16 0',
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export interface PropTypes {
|
|
15
|
-
onClickRefresh: () => void;
|
|
16
|
-
title?: string;
|
|
17
|
-
titleSize?: number;
|
|
18
|
-
titleWeight?: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function Header(props: PropTypes) {
|
|
22
|
-
const { onClickRefresh, title, titleSize, titleWeight } = props;
|
|
23
|
-
const { t } = useTranslation();
|
|
24
|
-
const titleStyle = css({
|
|
25
|
-
fontSize: `${titleSize}px !important`,
|
|
26
|
-
fontWeight: `${titleWeight} !important`,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<HeaderContainer>
|
|
31
|
-
<Typography variant="h4" className={titleStyle()}>
|
|
32
|
-
{title ? t(title.toLocaleLowerCase()) : ''}
|
|
33
|
-
</Typography>
|
|
34
|
-
<HeaderButtons onClickRefresh={onClickRefresh} />
|
|
35
|
-
</HeaderContainer>
|
|
36
|
-
);
|
|
37
|
-
}
|