Skip to content

Commit 0b6528d

Browse files
committed
Accept a searchText route param to the tx list
1 parent 1ec73ed commit 0b6528d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/components/scenes/TransactionListScene.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ interface Props extends WalletsTabSceneProps<'transactionList'> {
4040

4141
function TransactionListComponent(props: Props) {
4242
const { navigation, route, wallet } = props
43+
const { searchText: initSearchText } = route.params
4344
const theme = useTheme()
4445
const styles = getStyles(theme)
4546
const dispatch = useDispatch()
@@ -49,8 +50,8 @@ function TransactionListComponent(props: Props) {
4950

5051
// State:
5152
const flashListRef = React.useRef<Animated.FlatList<ListItem> | null>(null)
52-
const [isSearching, setIsSearching] = React.useState(false)
53-
const [searchText, setSearchText] = React.useState('')
53+
const [isSearching, setIsSearching] = React.useState(initSearchText != null)
54+
const [searchText, setSearchText] = React.useState(initSearchText ?? '')
5455
const [footerHeight, setFooterHeight] = React.useState<number | undefined>()
5556

5657
// Watchers:

src/components/scenes/WalletDetailsScene.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ function WalletDetailsComponent(props: Props) {
178178
})
179179

180180
const handlePressSeeAll = useHandler(() => {
181-
navigation.navigate('transactionList', route.params)
181+
navigation.navigate('transactionList', {
182+
...route.params,
183+
searchText: isSearching ? searchText : undefined
184+
})
182185
})
183186

184187
//

0 commit comments

Comments
 (0)