Skip to content

Commit

Permalink
Search: open dapp info for external dapps fix (#2567)
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev authored Feb 10, 2025
1 parent 4839af8 commit 6de407d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 58 deletions.
41 changes: 12 additions & 29 deletions ui/searchResults/SearchResultListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import * as UserOpEntity from 'ui/shared/entities/userOp/UserOpEntity';
import { ADDRESS_REGEXP } from 'ui/shared/forms/validators/address';
import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic';
import IconSvg from 'ui/shared/IconSvg';
import LinkExternal from 'ui/shared/links/LinkExternal';
import LinkInternal from 'ui/shared/links/LinkInternal';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import type { SearchResultAppItem } from 'ui/shared/search/utils';
Expand Down Expand Up @@ -145,34 +144,18 @@ const SearchResultListItem = ({ data, searchTerm, isLoading, addressFormat }: Pr
src={ colorMode === 'dark' && data.app.logoDarkMode ? data.app.logoDarkMode : data.app.logo }
alt={ `${ data.app.title } app icon` }
/>
{ data.app.external ? (
<LinkExternal
href={
route({
pathname: '/apps',
query: {
selectedAppId: data.app.id,
},
})
}
fontWeight={ 700 }
wordBreak="break-all"
isLoading={ isLoading }
onClick={ handleLinkClick }
>
{ title }
</LinkExternal>
) : (
<LinkInternal
href={ route({ pathname: '/apps/[id]', query: { id: data.app.id } }) }
fontWeight={ 700 }
wordBreak="break-all"
isLoading={ isLoading }
onClick={ handleLinkClick }
>
{ title }
</LinkInternal>
) }
<LinkInternal
href={ data.app.external ?
route({ pathname: '/apps', query: { selectedAppId: data.app.id } }) :
route({ pathname: '/apps/[id]', query: { id: data.app.id } })
}
fontWeight={ 700 }
wordBreak="break-all"
isLoading={ isLoading }
onClick={ handleLinkClick }
>
{ title }
</LinkInternal>
</Flex>
);
}
Expand Down
41 changes: 12 additions & 29 deletions ui/searchResults/SearchResultTableItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import * as UserOpEntity from 'ui/shared/entities/userOp/UserOpEntity';
import { ADDRESS_REGEXP } from 'ui/shared/forms/validators/address';
import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic';
import IconSvg from 'ui/shared/IconSvg';
import LinkExternal from 'ui/shared/links/LinkExternal';
import LinkInternal from 'ui/shared/links/LinkInternal';
import type { SearchResultAppItem } from 'ui/shared/search/utils';
import { getItemCategory, searchItemTitles } from 'ui/shared/search/utils';
Expand Down Expand Up @@ -209,34 +208,18 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading, addressFormat }: P
src={ colorMode === 'dark' && data.app.logoDarkMode ? data.app.logoDarkMode : data.app.logo }
alt={ `${ data.app.title } app icon` }
/>
{ data.app.external ? (
<LinkExternal
href={
route({
pathname: '/apps',
query: {
selectedAppId: data.app.id,
},
})
}
fontWeight={ 700 }
wordBreak="break-all"
isLoading={ isLoading }
onClick={ handleLinkClick }
>
{ title }
</LinkExternal>
) : (
<LinkInternal
href={ route({ pathname: '/apps/[id]', query: { id: data.app.id } }) }
fontWeight={ 700 }
wordBreak="break-all"
isLoading={ isLoading }
onClick={ handleLinkClick }
>
{ title }
</LinkInternal>
) }
<LinkInternal
href={ data.app.external ?
route({ pathname: '/apps', query: { selectedAppId: data.app.id } }) :
route({ pathname: '/apps/[id]', query: { id: data.app.id } })
}
fontWeight={ 700 }
wordBreak="break-all"
isLoading={ isLoading }
onClick={ handleLinkClick }
>
{ title }
</LinkInternal>
</Flex>
</Td>
<Td fontSize="sm" verticalAlign="middle" colSpan={ 2 }>
Expand Down

0 comments on commit 6de407d

Please sign in to comment.