Skip to content

Commit

Permalink
refactor(send): remove unnecessary type UtxoList
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Jul 22, 2024
1 parent d06ac8f commit 6358015
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
11 changes: 5 additions & 6 deletions src/components/Send/ShowUtxos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import classNames from 'classnames'
import { Table, Body, Row, Cell } from '@table-library/react-table-library/table'
import { useTheme } from '@table-library/react-table-library/theme'
import * as TableTypes from '@table-library/react-table-library/types/table'
import { WalletInfo, Utxo, useCurrentWalletInfo } from '../../context/WalletContext'
import { WalletInfo, Utxo, useCurrentWalletInfo, Utxos } from '../../context/WalletContext'
import { useSettings, Settings } from '../../context/SettingsContext'
import Alert from '../Alert'
import Balance from '../Balance'
import { ConfirmModal } from '../Modal'
import Sprite from '../Sprite'
import { utxoTags } from '../jar_details/UtxoList'
import { UtxoList } from './SourceJarSelector'
import { shortenStringMiddle } from '../../utils'
import mainStyles from '../MainWalletView.module.css'
import styles from './ShowUtxos.module.css'
Expand All @@ -24,10 +23,10 @@ interface ShowUtxosProps {
onConfirm: () => void
alert: SimpleAlert | undefined
isLoading: boolean
frozenUtxos: UtxoList
unFrozenUtxos: UtxoList
setFrozenUtxos: (arg: UtxoList) => void
setUnFrozenUtxos: (arg: UtxoList) => void
frozenUtxos: Utxos
unFrozenUtxos: Utxos
setFrozenUtxos: (arg: Utxos) => void
setUnFrozenUtxos: (arg: Utxos) => void
}

interface UtxoRowProps {
Expand Down
8 changes: 3 additions & 5 deletions src/components/Send/SourceJarSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useField, useFormikContext } from 'formik'
import * as rb from 'react-bootstrap'
import { jarFillLevel, SelectableJar } from '../jars/Jar'
import { noop } from '../../utils'
import { WalletInfo, CurrentWallet, useReloadCurrentWalletInfo, Utxo } from '../../context/WalletContext'
import { WalletInfo, CurrentWallet, useReloadCurrentWalletInfo, Utxo, Utxos } from '../../context/WalletContext'
import styles from './SourceJarSelector.module.css'
import { ShowUtxos } from './ShowUtxos'
import { useTranslation } from 'react-i18next'
Expand All @@ -25,8 +25,6 @@ interface ShowUtxosProps {
isOpen: boolean
}

export type UtxoList = Utxo[]

export const SourceJarSelector = ({
name,
label,
Expand All @@ -44,8 +42,8 @@ export const SourceJarSelector = ({
const [showUtxos, setShowUtxos] = useState<ShowUtxosProps>()
const [alert, setAlert] = useState<SimpleAlert>()
const [isUtxosLoading, setIsUtxosLoading] = useState<boolean>(false)
const [unFrozenUtxos, setUnFrozenUtxos] = useState<UtxoList>([])
const [frozenUtxos, setFrozenUtxos] = useState<UtxoList>([])
const [unFrozenUtxos, setUnFrozenUtxos] = useState<Utxos>([])
const [frozenUtxos, setFrozenUtxos] = useState<Utxos>([])

const jarBalances = useMemo(() => {
if (!walletInfo) return []
Expand Down

0 comments on commit 6358015

Please sign in to comment.