Skip to content

Commit be489dc

Browse files
committed
Fix options for check modules
1 parent 54a6ba6 commit be489dc

File tree

4 files changed

+30
-22
lines changed

4 files changed

+30
-22
lines changed

src/modules/check/accounts.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ const msgStyles = `
1515
margin-top: 0.5rem;
1616
`
1717

18-
function accountSelect(options: {
19-
heading: string
20-
description: string
21-
icon: string
22-
}): WalletCheckModule {
18+
function accountSelect(
19+
options: {
20+
heading?: string
21+
description?: string
22+
icon?: string
23+
} = {}
24+
): WalletCheckModule {
2325
const { heading, description, icon } = options
2426
let completed: boolean = false
2527
let loadingAccounts: boolean = false

src/modules/check/balance.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { WalletCheckModal, StateAndHelpers } from '../../interfaces'
22
import { validateType } from '../../validation'
33
import { balanceIcon } from './icons'
44

5-
function balance(options: {
6-
minimumBalance: string
7-
heading: string
8-
description: string
9-
icon: string
10-
}): (currentState: StateAndHelpers) => WalletCheckModal | undefined {
5+
function balance(
6+
options: {
7+
minimumBalance: string
8+
heading?: string
9+
description?: string
10+
icon?: string
11+
} = { minimumBalance: '0' }
12+
): (currentState: StateAndHelpers) => WalletCheckModal | undefined {
1113
validateType({ name: 'balance options', value: options, type: 'object' })
1214

1315
const { minimumBalance, heading, description, icon } = options
@@ -21,7 +23,7 @@ function balance(options: {
2123
return (StateAndHelpers: StateAndHelpers) => {
2224
const { balance, BigNumber } = StateAndHelpers
2325
// if balance is less than minimum
24-
if (BigNumber(balance).lt(BigNumber(minimumBalance || 0))) {
26+
if (BigNumber(balance).lt(BigNumber(minimumBalance))) {
2527
return {
2628
heading: heading || 'Get Some ETH',
2729
description:

src/modules/check/connect.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import {
55
} from '../../interfaces'
66
import { connectIcon } from './icons'
77

8-
function connect(options: {
9-
heading: string
10-
description: string
11-
icon: string
12-
}): WalletCheckModule {
8+
function connect(
9+
options: {
10+
heading?: string
11+
description?: string
12+
icon?: string
13+
} = {}
14+
): WalletCheckModule {
1315
const { heading, description, icon } = options
1416

1517
return (stateAndHelpers: StateAndHelpers): WalletCheckModal | undefined => {

src/modules/check/network.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import { networkName } from '../../utilities'
22
import { WalletCheckModule, StateAndHelpers } from '../../interfaces'
33
import { networkIcon } from './icons'
44

5-
function network(options: {
6-
heading: string
7-
description: string
8-
icon: string
9-
}): WalletCheckModule | never {
5+
function network(
6+
options: {
7+
heading?: string
8+
description?: string
9+
icon?: string
10+
} = {}
11+
): WalletCheckModule | never {
1012
const { heading, description, icon } = options
1113

1214
return (stateAndHelpers: StateAndHelpers) => {

0 commit comments

Comments
 (0)