-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7246b5d
commit 1d64c5a
Showing
5 changed files
with
171 additions
and
74 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
79 changes: 79 additions & 0 deletions
79
packages/extension/src/components/organisms/NFTDetails/NFTDetails.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,79 @@ | ||
import React, { FC } from 'react'; | ||
|
||
import CloseIcon from '@mui/icons-material/Close'; | ||
import { | ||
AppBar, | ||
CircularProgress, | ||
IconButton, | ||
List, | ||
ListItem, | ||
ListItemText, | ||
Toolbar, | ||
Typography | ||
} from '@mui/material'; | ||
import { LazyLoadImage } from 'react-lazy-load-image-component'; | ||
|
||
import { NFTData } from '@gemwallet/constants'; | ||
|
||
import { GemWallet } from '../../atoms'; | ||
|
||
interface NFTDetailsProps { | ||
NFTData: NFTData; | ||
handleClose: () => void; | ||
} | ||
|
||
export const NFTDetails: FC<NFTDetailsProps> = ({ NFTData, handleClose }) => { | ||
return ( | ||
<> | ||
<AppBar sx={{ position: 'relative' }}> | ||
<Toolbar> | ||
<IconButton | ||
edge="start" | ||
color="inherit" | ||
aria-label="close" | ||
onClick={handleClose} | ||
style={{ cursor: 'pointer' }} | ||
data-testid="close-button" | ||
> | ||
<CloseIcon /> | ||
</IconButton> | ||
<Typography sx={{ ml: 2, flex: 1 }} variant="h6" component="div"> | ||
NFT Details | ||
</Typography> | ||
</Toolbar> | ||
</AppBar> | ||
<List sx={{ width: '100%', wordBreak: 'break-word' }}> | ||
{NFTData.image ? ( | ||
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}> | ||
<LazyLoadImage | ||
alt="nft" | ||
height={250} | ||
style={{ borderRadius: '4px', boxShadow: '4px 4px 0px black' }} | ||
beforeLoad={() => <CircularProgress />} | ||
effect="blur" | ||
src={NFTData?.image} | ||
width={250} | ||
/> | ||
</div> | ||
) : ( | ||
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}> | ||
<GemWallet /> | ||
</div> | ||
)} | ||
<ListItem style={{ padding: '8px 24px' }}> | ||
<ListItemText primary="Token ID" secondary={NFTData.NFTokenID} /> | ||
</ListItem> | ||
{NFTData.name ? ( | ||
<ListItem style={{ padding: '8px 24px' }}> | ||
<ListItemText primary="Name" secondary={NFTData.name} /> | ||
</ListItem> | ||
) : null} | ||
{NFTData.description ? ( | ||
<ListItem style={{ padding: '8px 24px' }}> | ||
<ListItemText primary="Description" secondary={NFTData.description} /> | ||
</ListItem> | ||
) : null} | ||
</List> | ||
</> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/extension/src/components/organisms/NFTDetails/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 @@ | ||
export * from './NFTDetails'; |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export * from './BaseTransaction'; | ||
export * from './Header'; | ||
export * from './NavMenu'; | ||
export * from './NFTDetails'; | ||
export * from './NFTListing'; | ||
export * from './TokenListing'; | ||
export * from './TransactionListing'; |