-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest-tier.tsx
More file actions
72 lines (65 loc) · 1.7 KB
/
request-tier.tsx
File metadata and controls
72 lines (65 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { useMemo } from 'react';
import { Text } from '@lidofinance/lido-ui';
import { FormatToken } from 'shared/formatters';
import { useTierRequest } from 'features/overview/hooks';
import {
DescriptionWrapper,
OptionDivider,
OptionWrapper,
RequestContainer,
} from './styles';
import { OptionRow } from './option-row';
export const RequestTier = () => {
const { metrics, proposedTier, proposedVaultLimitStETH } = useTierRequest();
const metricRows = useMemo(() => {
if (!metrics) {
return [];
}
return [
{
label: 'Reserve ratio',
value: metrics.reserveRatioBP.newValue,
},
{
label: 'Forced rebalance threshold',
value: metrics.forcedRebalanceThresholdBP.newValue,
},
{
label: 'Lido infrastructure fee',
value: metrics.infraFeeBP.newValue,
},
{
label: 'Lido liquidity fee',
value: metrics.liquidityFeeBP.newValue,
},
];
}, [metrics]);
if (!metrics || !proposedTier || !proposedVaultLimitStETH) {
return null;
}
return (
<RequestContainer>
<DescriptionWrapper>
<Text size="xs" strong>
{proposedTier.tierName} terms
</Text>
{metricRows.map(({ label, value }) => (
<OptionRow key={label} label={label}>
{value}
</OptionRow>
))}
</DescriptionWrapper>
<OptionDivider />
<OptionWrapper>
<OptionRow label="stVault minting limit">
<FormatToken
amount={proposedVaultLimitStETH}
maxDecimalDigits={4}
showAmountTip
symbol="stETH"
/>
</OptionRow>
</OptionWrapper>
</RequestContainer>
);
};