Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

fix(other): fix currency formatting throughout app (#228) #229

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/components/ScriptExplorer/OutputEntry.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ class OutputEntry extends React.Component {
InputProps={{
startAdornment: (
<InputAdornment position="start">
<FormHelperText>BTC</FormHelperText>
</InputAdornment>
),
endAdornment: (
<InputAdornment position="end">
{isWallet &&
autoSpend &&
number === outputs.length &&
Expand All @@ -262,11 +267,6 @@ class OutputEntry extends React.Component {
)}
</InputAdornment>
),
endAdornment: (
<InputAdornment position="end">
<FormHelperText>BTC</FormHelperText>
</InputAdornment>
),
}}
/>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ScriptExplorer/OutputsForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OutputsForm extends React.Component {
static unitLabel(label, options) {
let inputProps = {
endAdornment: (
<InputAdornment position="end">
<InputAdornment position="start">
<FormHelperText>{label}</FormHelperText>
</InputAdornment>
),
Expand Down
6 changes: 3 additions & 3 deletions src/components/Wallet/TransactionPreview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class TransactionPreview extends React.Component {
<Grid container>
<Grid item xs={4}>
<h3>Fee</h3>
<div>{BigNumber(fee).toFixed(8)} BTC </div>
<div>BTC {BigNumber(fee).toFixed(8)}</div>
</Grid>
<Grid item xs={4}>
<h3>Fee Rate</h3>
Expand All @@ -181,8 +181,8 @@ class TransactionPreview extends React.Component {
<Grid item xs={4}>
<h3>Total</h3>
<div>
{satoshisToBitcoins(BigNumber(inputsTotalSats || 0)).toFixed(8)}{" "}
BTC
BTC{" "}
{satoshisToBitcoins(BigNumber(inputsTotalSats || 0)).toFixed(8)}
</div>
</Grid>
</Grid>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Wallet/WalletInfoCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const WalletInfoCard = ({
variant="subtitle1"
className={classes.balance}
>
{balance} BTC
BTC {balance}
</Typography>
</Grid>
<Grid item>
Expand All @@ -82,8 +82,8 @@ const WalletInfoCard = ({
fontWeight: "bold",
}}
>
{pendingBalance > 0 ? "+" : ""}
{pendingBalance} BTC
BTC{" "}{pendingBalance > 0 ? "+" : ""}
{pendingBalance}
</span>{" "}
(unconfirmed)
</>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Wallet/__tests__/WalletInfoCard.text.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("WalletInfoCard", () => {

expect(walletInfoCard).toBeVisible();
expect(balance).toBeVisible();
expect(balance).toHaveTextContent("0 BTC");
expect(balance).toHaveTextContent("BTC 0");
expect(bitcoinIcon).toHaveAttribute("color", "grey");
expect(getByText(walletName)).toBeVisible();
expect(pendingBalance).toBeEmpty();
Expand All @@ -53,7 +53,7 @@ describe("WalletInfoCard", () => {
const { getByDataCy } = renderWalletInfoCard(props);

const balance = getByDataCy("balance");
expect(balance).toHaveTextContent("10 BTC");
expect(balance).toHaveTextContent("BTC 10");
});

test("shows a pending balance", () => {
Expand All @@ -62,7 +62,7 @@ describe("WalletInfoCard", () => {

const pendingBalance = getByDataCy("pending-balance");
expect(pendingBalance).toHaveTextContent(
`+${props.pendingBalance} BTC (unconfirmed)`
`BTC +${props.pendingBalance} (unconfirmed)`
);
});
});
Expand Down
8 changes: 4 additions & 4 deletions src/tests/signing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SignMultisigTransactionTest extends Test {
<TableRow>
<TableCell>Output Amount:</TableCell>
<TableCell>
{satoshisToBitcoins(this.outputAmountSats()).toString()} BTC
BTC {satoshisToBitcoins(this.outputAmountSats()).toString()}
</TableCell>
</TableRow>

Expand All @@ -65,15 +65,15 @@ class SignMultisigTransactionTest extends Test {
<TableRow>
<TableCell>Change Output Amount:</TableCell>
<TableCell>
{satoshisToBitcoins(this.changeOutputAmountSats()).toString()}{" "}
BTC
BTC{" "}
{satoshisToBitcoins(this.changeOutputAmountSats()).toString()}
</TableCell>
</TableRow>

<TableRow>
<TableCell>Fees:</TableCell>
<TableCell>
{satoshisToBitcoins(this.feeSats()).toString()} BTC
BTC {satoshisToBitcoins(this.feeSats()).toString()}
</TableCell>
</TableRow>
</TableBody>
Expand Down