File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed
components/multichain/asset-picker-amount/asset-picker-modal Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export const DefaultStory = () => {
2929 < AssetPickerModal
3030 header = { t ( 'sendSelectSendAsset' ) }
3131 onAssetChange = { ( ) => ( { } ) }
32+ autoFocus = { false }
3233 { ...props }
3334 />
3435 ) ;
@@ -42,6 +43,7 @@ export const TokenStory = () => {
4243 < AssetPickerModal
4344 header = { t ( 'sendSelectSendAsset' ) }
4445 onAssetChange = { ( ) => ( { } ) }
46+ autoFocus = { false }
4547 { ...props }
4648 />
4749 ) ;
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ type AssetPickerModalProps = {
120120 isTokenListLoading ?: boolean ;
121121 autoFocus : boolean ;
122122 isDestinationToken ?: boolean ;
123+ hideSearch ?: boolean ;
123124} & Pick <
124125 React . ComponentProps < typeof AssetPickerModalTabs > ,
125126 'visibleTabs' | 'defaultActiveTabKey'
@@ -151,6 +152,7 @@ export function AssetPickerModal({
151152 selectedChainIds,
152153 autoFocus,
153154 isDestinationToken = false ,
155+ hideSearch = false ,
154156 ...tabProps
155157} : AssetPickerModalProps ) {
156158 const t = useI18nContext ( ) ;
@@ -682,15 +684,17 @@ export function AssetPickerModal({
682684 ) : (
683685 < AssetPickerModalTabs { ...tabProps } >
684686 < React . Fragment key = { TabName . TOKENS } >
685- < Search
686- searchQuery = { searchQuery }
687- onChange = { ( value ) => {
688- // Cancel previous asset metadata fetch
689- abortControllerRef . current ?. abort ( ) ;
690- setSearchQuery ( ( ) => value ) ;
691- } }
692- autoFocus = { autoFocus }
693- />
687+ { ! hideSearch && (
688+ < Search
689+ searchQuery = { searchQuery }
690+ onChange = { ( value ) => {
691+ // Cancel previous asset metadata fetch
692+ abortControllerRef . current ?. abort ( ) ;
693+ setSearchQuery ( ( ) => value ) ;
694+ } }
695+ autoFocus = { autoFocus }
696+ />
697+ ) }
694698 < AssetList
695699 network = { network }
696700 handleAssetChange = { handleAssetChange }
Original file line number Diff line number Diff line change @@ -308,6 +308,7 @@ export const ShieldPaymentModal = ({
308308 autoFocus = { false }
309309 visibleTabs = { [ TabName . TOKENS ] }
310310 customTokenListGenerator = { customTokenListGenerator }
311+ hideSearch
311312 />
312313 </ ModalContent >
313314 </ Modal >
You can’t perform that action at this time.
0 commit comments