-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add the TokenIcon component (#2147)
- Loading branch information
1 parent
7c6cccd
commit a2d7308
Showing
6 changed files
with
49 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
webapp/src/components/Modals/BuyWithCryptoModal/TokenIcon/TokenIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Popup } from 'decentraland-ui/dist/components/Popup/Popup' | ||
import noTokenImage from '../../../../images/no-token.png' | ||
import { Props } from './TokenIcon.types' | ||
|
||
export const TokenIcon = (props: Props) => { | ||
const { src, name } = props | ||
|
||
return ( | ||
<Popup | ||
content={name} | ||
style={{ zIndex: 3001 }} | ||
on="hover" | ||
position="top center" | ||
trigger={ | ||
<img height={24} width={24} src={src ?? noTokenImage} alt={name} /> | ||
} | ||
/> | ||
) | ||
} |
4 changes: 4 additions & 0 deletions
4
webapp/src/components/Modals/BuyWithCryptoModal/TokenIcon/TokenIcon.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export type Props = { | ||
src?: string | ||
name: string | ||
} |
2 changes: 2 additions & 0 deletions
2
webapp/src/components/Modals/BuyWithCryptoModal/TokenIcon/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './TokenIcon' | ||
export * from './TokenIcon.types' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.