Skip to content

Commit 89e8021

Browse files
committed
Accept a searchText route param to the tx list
1 parent 525e104 commit 89e8021

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/components/scenes/TransactionListScene.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface TransactionListParams {
3030
walletName: string
3131
tokenId: EdgeTokenId
3232
countryCode?: string
33+
searchText?: string
3334
}
3435

3536
type ListItem = EdgeTransaction | string | null
@@ -39,6 +40,7 @@ interface Props extends WalletsTabSceneProps<'transactionList'> {
3940

4041
function TransactionListComponent(props: Props) {
4142
const { navigation, route, wallet } = props
43+
const { searchText: initSearchText } = route.params
4244
const theme = useTheme()
4345
const styles = getStyles(theme)
4446
const dispatch = useDispatch()
@@ -48,8 +50,8 @@ function TransactionListComponent(props: Props) {
4850

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

5557
// 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)