11import React , { useCallback , useMemo } from 'react'
22import { NavLink , RouteComponentProps } from 'react-router-dom'
33import { useTranslation } from 'react-i18next'
4- import { Stack , SearchBox , DefaultButton } from 'office-ui-fabric-react'
4+ import { Stack , SearchBox , getTheme } from 'office-ui-fabric-react'
55import { Search as SearchIcon } from 'grommet-icons'
66
77import TransactionList from 'components/TransactionList'
88import { StateWithDispatch } from 'states/stateProvider/reducer'
99
1010import { Routes } from 'utils/const'
11+ import { registerIcons } from 'utils/icons'
1112
1213import { useSearch } from './hooks'
1314
15+ const theme = getTheme ( )
16+ const { semanticColors } = theme
17+ registerIcons ( {
18+ icons : {
19+ Search : < SearchIcon size = "16px" color = { semanticColors . menuIcon } /> ,
20+ } ,
21+ } )
22+
1423const History = ( {
15- wallet : { id, addresses = [ ] } ,
24+ wallet : { id } ,
1625 chain : {
1726 transactions : { pageNo = 1 , pageSize = 15 , totalCount = 0 , items = [ ] , keywords : incomingKeywords = '' } ,
1827 } ,
@@ -22,23 +31,21 @@ const History = ({
2231} : React . PropsWithoutRef < StateWithDispatch & RouteComponentProps > ) => {
2332 const [ t ] = useTranslation ( )
2433
25- const { keywords, onKeywordsChange } = useSearch ( search , incomingKeywords , addresses , dispatch )
34+ const { keywords, onKeywordsChange } = useSearch ( search , incomingKeywords , id , dispatch )
2635 const onSearch = useCallback ( ( ) => history . push ( `${ Routes . History } ?keywords=${ keywords } ` ) , [ history , keywords ] )
2736 const totalPages = useMemo ( ( ) => Math . ceil ( totalCount / pageSize ) || 1 , [ totalCount , pageSize ] )
2837
2938 return (
3039 < Stack >
31- < Stack horizontal horizontalAlign = "start " tokens = { { childrenGap : 15 } } >
40+ < Stack horizontal horizontalAlign = "end " tokens = { { childrenGap : 15 } } >
3241 < SearchBox
3342 value = { keywords }
3443 styles = { { root : { width : 200 } } }
3544 placeholder = "Search"
3645 onChange = { onKeywordsChange }
3746 onSearch = { onSearch }
47+ iconProps = { { iconName : 'Search' , styles : { root : { height : '18px' } } } }
3848 />
39- < DefaultButton onClick = { onSearch } >
40- < SearchIcon />
41- </ DefaultButton >
4249 </ Stack >
4350 < TransactionList walletID = { id } items = { items } dispatch = { dispatch } />
4451 < div style = { { display : 'flex' , justifyContent : 'center' } } >
0 commit comments