Skip to content

Commit 58b2730

Browse files
committed
ui: update types in the React components
1 parent 7780c94 commit 58b2730

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

app/src/components/pool/OrderFormSection.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import { observer } from 'mobx-react-lite';
33
import { LeaseDuration } from 'types/state';
44
import styled from '@emotion/styled';
5-
import Big from 'big.js';
65
import { usePrefixedTranslation } from 'hooks';
76
import { Unit, Units } from 'util/constants';
87
import { useStore } from 'store';
@@ -110,7 +109,7 @@ const OrderFormSection: React.FC = () => {
110109
label={l(`amountLabel${orderFormView.orderType}`)}
111110
placeholder={l('amountPlaceholder')}
112111
extra={Units[Unit.sats].suffix}
113-
value={orderFormView.amount}
112+
value={orderFormView.amount.toNumber()}
114113
onChange={orderFormView.setAmount}
115114
/>
116115
</FormField>
@@ -121,7 +120,7 @@ const OrderFormSection: React.FC = () => {
121120
<FormInputNumber
122121
label={l(`premiumLabel${orderFormView.orderType}`)}
123122
placeholder={l('premiumPlaceholder')}
124-
value={orderFormView.premium}
123+
value={orderFormView.premium.toNumber()}
125124
onChange={orderFormView.setPremium}
126125
extra={
127126
<>
@@ -194,7 +193,7 @@ const OrderFormSection: React.FC = () => {
194193
{orderFormView.quoteLoading ? (
195194
<LoaderLines />
196195
) : (
197-
<UnitCmp sats={Big(orderFormView.executionFee)} />
196+
<UnitCmp sats={orderFormView.executionFee} />
198197
)}
199198
</span>
200199
</SummaryItem>
@@ -207,7 +206,7 @@ const OrderFormSection: React.FC = () => {
207206
{orderFormView.quoteLoading ? (
208207
<LoaderLines />
209208
) : (
210-
<UnitCmp sats={Big(orderFormView.worstChainFee)} />
209+
<UnitCmp sats={orderFormView.worstChainFee} />
211210
)}
212211
</span>
213212
</SummaryItem>

app/src/components/pool/account/FundNewAccountForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const FundNewAccountForm: React.FC = () => {
3535
label={l(`amountLabel`)}
3636
placeholder={l('amountPlaceholder')}
3737
extra={Units[Unit.sats].suffix}
38-
value={fundNewAccountView.amount}
38+
value={fundNewAccountView.amount.toNumber()}
3939
onChange={fundNewAccountView.setAmount}
4040
/>
4141
</FormField>

app/src/components/pool/batches/BatchStats.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const BatchStats: React.FC = () => {
6161
<div>
6262
<BatchCountdown
6363
label={l('nextBatch')}
64-
timestamp={batchesView.nextBatchTimestamp}
64+
timestamp={batchesView.nextBatchTimestamp.toNumber()}
6565
tip={l('nextBatchTip')}
6666
/>
6767
<Stat

app/src/components/pool/orders/OrdersList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const OrderRow: React.FC<{
6868
<TableCell right>
6969
<Unit sats={order.amount} suffix={false} />
7070
</TableCell>
71-
<TableCell className="text-center">{order.duration}</TableCell>
71+
<TableCell className="text-center">{order.duration.toNumber()}</TableCell>
7272
<TableCell right>{order.basisPoints}</TableCell>
7373
<TableCell>
7474
<OrderStatus status={order.stateLabel}>{order.stateWithCount}</OrderStatus>

0 commit comments

Comments
 (0)