Skip to content

Commit

Permalink
add Filter by Hash functionality to Tx History view
Browse files Browse the repository at this point in the history
  • Loading branch information
bgptr committed Dec 13, 2021
1 parent 2de5534 commit 362aae9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
import styles from "./HistoryPage.module.css";

const messages = defineMessages({
filterByAddrPlaceholder: {
id: "txhistory.filterByAddrPlaceholder",
defaultMessage: "Filter by Address"
filterByAddrOrHashPlaceholder: {
id: "txhistory.filterByAddrOrHashPlaceholder",
defaultMessage: "Filter by Address or Hash"
}
});

Expand All @@ -36,9 +36,9 @@ const subtitleMenu = ({
<div className={styles.historyContainer}>
<div className={styles.historySearchTx}>
<TextInput
id="filterByAddrInput"
id="filterByAddrOrHashInput"
type="text"
placeholder={intl.formatMessage(messages.filterByAddrPlaceholder)}
placeholder={intl.formatMessage(messages.filterByAddrOrHashPlaceholder)}
value={searchText}
onChange={(e) => onChangeSearchText(e.target.value)}
/>
Expand Down
3 changes: 2 additions & 1 deletion app/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,8 @@ export const filteredRegularTxs = createSelector(
address.length > 1 &&
address.toLowerCase().indexOf(filter.search.toLowerCase()) !==
-1
) != undefined
) != undefined ||
v.txHash.toLowerCase().includes(filter.search.toLowerCase())
: true
)
.filter((v) =>
Expand Down

0 comments on commit 362aae9

Please sign in to comment.