Skip to content

Commit

Permalink
Refactor google icon
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript committed Apr 25, 2024
1 parent 48605e0 commit 5b80ac6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
25 changes: 25 additions & 0 deletions apps/wallet-mobile/src/components/Icon/Google.tsx

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions apps/wallet-mobile/src/components/Icon/Icon.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ storiesOf('Icon', module).add('Gallery', () => {
<Item icon={<Icon.Reload />} title="Reload" />

<Item icon={<Icon.Square />} title="Square" />

<Item icon={<Icon.Google />} title="Google" />
</ScrollView>
</FilterProvider>
)
Expand Down
2 changes: 2 additions & 0 deletions apps/wallet-mobile/src/components/Icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {Forward} from './Forward'
import {Gear} from './Gear'
import {Github} from './Github'
import {Globe} from './Globe'
import {Google} from './Google'
import {Governance} from './Governance'
import {HardwareWallet} from './HardwareWallet'
import {Image} from './Image'
Expand Down Expand Up @@ -242,4 +243,5 @@ export const Icon = {
Share2,
Reload,
Square,
Google,
}
3 changes: 1 addition & 2 deletions apps/wallet-mobile/src/features/Discover/common/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {dappConnectorApiMaker} from '@yoroi/dapp-connector'
import {App} from '@yoroi/types'
import {Alert, Image} from 'react-native'

Check failure on line 4 in apps/wallet-mobile/src/features/Discover/common/helpers.ts

View workflow job for this annotation

GitHub Actions / check

'Image' is defined but never used. Allowed unused vars must match /^_/u

import Google from '../../../assets/img/dApp/google.png'
import {YoroiWallet} from '../../../yoroi-wallets/cardano/types'

export const validUrl = (url: string) => {
Expand Down Expand Up @@ -51,7 +50,7 @@ export const getGoogleSearchItem = (searchQuery: string): DAppItem => ({
name: searchQuery,
description: 'Google',
category: 'search',
logo: Image.resolveAssetSource(Google).uri,
logo: '',
uri: `https://www.google.com/search?q=${encodeURIComponent(searchQuery)}`,
origins: ['https://www.google.com'],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ export const DAppListItem = ({dApp, connected, onPress}: Props) => {
onPress={handlePress}
>
<View style={styles.dAppItemContainer}>
{showIconPlaceholder ? (
{isGoogleSearchItem(dApp) ? (
<Icon.Google />
) : showIconPlaceholder ? (
<EmptyIcon />
) : (
<View>
Expand Down

0 comments on commit 5b80ac6

Please sign in to comment.