Skip to content

Commit

Permalink
refactor(wallet-mobile): CR updates + scrollable in input needs checking
Browse files Browse the repository at this point in the history
  • Loading branch information
stackchain committed Sep 17, 2024
1 parent 27f5f77 commit 3e92069
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import * as React from 'react'
import {ScrollView} from 'react-native'
import {ScrollView, ScrollViewProps} from 'react-native'

const ScrollViewContext = React.createContext<{current: ScrollView | null}>({current: null})

export const useScrollView = () => React.useContext(ScrollViewContext).current

export const ScrollableView = (props: ScrollViewProps) => {
const scrollViewRef = React.useRef<ScrollView | null>(null)

return (
<ScrollViewContext.Provider value={scrollViewRef}>
<ScrollView {...props} ref={scrollViewRef} />
</ScrollViewContext.Provider>
)
}
1 change: 1 addition & 0 deletions apps/wallet-mobile/src/components/ScrollableView/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './ScrollableView'
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ const MnemonicWordsInput = ({
if (rowHeightRef.current == null) return
const columnNumber = index % 3
const rowNumber = (index - columnNumber) / 3
// TODO: revist @banklesss for this to work it needs to be in a ScrollableView
scrollView?.scrollTo({y: rowNumber * rowHeightRef.current})

onFocus(index)
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/yoroi-wallets/mocks/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BigNumber from 'bignumber.js'

import {Transaction, TransactionInfo} from '../types/other'
import {TransactionInfo} from '../types/other'

export const mockTransactionInfos: Record<string, TransactionInfo> = {
ef147cbd5ccb0b0907a2969a697aeb06117ac83f284ddfae53a4198b03719b52: {
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/yoroi-wallets/types/yoroi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Datum} from '@emurgo/yoroi-lib'
import {Balance, Resolver} from '@yoroi/types'
import {Balance} from '@yoroi/types'

import {CardanoTypes} from '../cardano/types'

Expand Down

0 comments on commit 3e92069

Please sign in to comment.