Skip to content

Commit

Permalink
style: linted
Browse files Browse the repository at this point in the history
  • Loading branch information
dafuga committed Sep 5, 2023
1 parent ff12fdb commit 79d5ff5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
10 changes: 6 additions & 4 deletions src/components/evm-tx-follower/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import Button from '~/components/elements/button.svelte'
import Card from '~/components/elements/card.svelte'
import type { ethers } from 'ethers'
import type {ethers} from 'ethers'
/** Title, e.g. Tokens sent */
export let title = 'Transaction sent'
/** The EVM transaction result */
export let evmTransactResult: ethers.providers.TransactionResponse | undefined
/** The text of the primary button at the bottom of the page */
export let primaryButtonText = 'Done'
/** The text of the primary button at the bottom of the page */
export let primaryButtonText = 'Done'
/** The function to call when the primary button is clicked */
export let handlePrimaryButtonClick: () => void = () => {
router.goto('/')
Expand All @@ -23,7 +23,9 @@
if (evmTransactResult?.hash) {
txId = evmTransactResult?.hash
} else {
console.warn('Invalid EVM Transact Result data passed to EvmTxFollower. Missing transaction hash.')
console.warn(
'Invalid EVM Transact Result data passed to EvmTxFollower. Missing transaction hash.'
)
txId = '0000000000000000000000000000000000000000000000000000000000000000'
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fiat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export function fiatFormat(value: number) {

export function valueInFiat(value: number, price: number) {
return fiatFormat(value * price)
}
}
4 changes: 2 additions & 2 deletions src/pages/transfer/confirm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import TokenImage from '~/components/elements/image/token.svelte'
import {systemTokenKey} from '~/stores/tokens'
import { valueInFiat } from '~/lib/fiat'
import {valueInFiat} from '~/lib/fiat'
import {evmAccount, activeSession, activePriceTicker} from '~/store'
import type {Token} from '~/stores/tokens'
Expand Down Expand Up @@ -65,7 +65,7 @@
display: flex;
align-items: center;
flex-direction: column;
align-self: center;
align-self: center;
&:first-of-type {
font-weight: bold;
Expand Down
10 changes: 5 additions & 5 deletions src/pages/transfer/form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
}
.label-container {
padding: 3px 8px;
padding: 3px 8px;
}
}
Expand Down Expand Up @@ -190,13 +190,13 @@
</div>
{#if receivedAmount && receivedAmount.value > 0 && feeAmount && feeAmount.value > 0}
<div class="label-container">
<Label align="left" >Amount Received: {String(receivedAmount)}</Label>
</div>
<Label align="left">Amount Received: {String(receivedAmount)}</Label>
</div>
<div class="label-container">
<Label align="left" >Transfer Fee: {String(feeAmount) }</Label>
<Label align="left">Transfer Fee: {String(feeAmount)}</Label>
</div>
<div class="label-container">
<Label align="left" >Total transferred: {String(depositAmount) }</Label>
<Label align="left">Total transferred: {String(depositAmount)}</Label>
</div>
{/if}
</div>
Expand Down
10 changes: 6 additions & 4 deletions src/pages/transfer/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
await estimateTransferFee()
deposit = (parseFloat(received) + parseFloat(transferFee?.value.toFixed(4) || '')).toFixed(4)
deposit = (parseFloat(received) + parseFloat(transferFee?.value.toFixed(4) || '')).toFixed(
4
)
}
async function estimateTransferFee(transferAmount?: string): Promise<Asset | undefined> {
Expand All @@ -112,7 +114,7 @@
})
}
} catch (error) {
errorMessage = `Could not estimate transfer fee. Error: ${
errorMessage = `Could not estimate transfer fee. Error: ${
JSON.stringify(error) === '{}' ? error.message : JSON.stringify(error)
}`
return
Expand Down Expand Up @@ -186,7 +188,7 @@
}
}
$: receivedAmount = isNaN(Number(received)) ? undefined : Asset.from(Number(received), '4,EOS')
$: receivedAmount = isNaN(Number(received)) ? undefined : Asset.from(Number(received), '4,EOS')
$: depositAmount = Asset.from(Number(deposit), '4,EOS')
</script>

Expand Down Expand Up @@ -224,7 +226,7 @@
{handleBack}
/>
{:else if (step === 'success' && nativeTransactResult) || evmTransactResult}
<Success {from} {to} {nativeTransactResult} {evmTransactResult} {handleBack} />
<Success {nativeTransactResult} {evmTransactResult} {handleBack} />
{/if}
</div>
</Page>
5 changes: 1 addition & 4 deletions src/pages/transfer/success.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import type {ethers} from 'ethers'
import {activeBlockchain} from '~/store'
import type {Token} from '~/stores/tokens'
export let from: Token
export let to: Token
export let nativeTransactResult: TransactResult | undefined
export let evmTransactResult: ethers.providers.TransactionResponse | undefined
export let handleBack: () => void
Expand All @@ -25,7 +22,7 @@
{:else}
<EvmTxFollower
title="Transfer Sent"
evmTransactResult={evmTransactResult}
{evmTransactResult}
primaryButtonText="New Transfer"
handlePrimaryButtonClick={handleBack}
/>
Expand Down

0 comments on commit 79d5ff5

Please sign in to comment.