Skip to content

Commit

Permalink
Merge pull request #566 from onflow/555-bug-issue-movingsending-certa…
Browse files Browse the repository at this point in the history
…in-nfts-between-evmcadence

fixed: replace the empty key value with the correct name
  • Loading branch information
zzggo authored Feb 21, 2025
2 parents 9b9afdf + 78358af commit c76e66b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 1,094 deletions.
38 changes: 6 additions & 32 deletions src/ui/views/NftEvm/Detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Typography, Container, Box, IconButton, Button, CardMedia } from '@mui/
import { StyledEngineProvider } from '@mui/material/styles';
import { makeStyles } from '@mui/styles';
import { saveAs } from 'file-saver';
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useCallback } from 'react';
import { useHistory, useLocation } from 'react-router-dom';

import nft from '@/background/service/nft';
Expand Down Expand Up @@ -128,7 +128,7 @@ const Detail = () => {
}
}, []);

const fetchNft = async () => {
const fetchNft = useCallback(async () => {
const userInfo = await usewallet.getUserInfo(false);
const currentAddress = await usewallet.getCurrentAddress();
const evmAddress = await usewallet.getEvmAddress();
Expand Down Expand Up @@ -169,12 +169,11 @@ const Detail = () => {
setContactOne(userOne);
setContactTwo(userTwo);

console.log('userInfo ', userInfo);
const evmEnabled = await usewallet.getEvmEnabled();
setEvmEnabled(evmEnabled);

await usewallet.setDashIndex(1);
};
}, [usewallet]);

const replaceIPFS = (url: string | null): string => {
if (!url) {
Expand All @@ -194,7 +193,7 @@ const Detail = () => {

useEffect(() => {
fetchNft();
}, []);
}, [fetchNft]);

const downloadImage = (image_url, title) => {
saveAs(image_url, title); // Put your image url here.
Expand Down Expand Up @@ -327,29 +326,6 @@ const Detail = () => {
>
<ArrowBackIcon sx={{ color: 'icon.navi' }} />
</IconButton>
{/* {
nftDetail &&
<>
<IconButton onClick={handleClick} className={classes.extendMore}>
<MoreHorizIcon sx={{ color: 'icon.navi'}} />
</IconButton>
<Menu
id="basic-menu"
anchorEl={anchorEl}
open={open}
onClose={handleClose}
MenuListProps={{
'aria-labelledby': 'basic-button',
}}
>
<MenuItem onClick={handleClose}>
<a href={'https://lilico.app/nft/' + ownerAddress +'/'+ nftDetail.contract.address +'/'+ nftDetail.contract.name + '?tokenId=' + nftDetail.id.tokenId} target="_blank">
Share
</a>
</MenuItem>
</Menu>
</>
} */}
</Box>

{nftDetail && (
Expand Down Expand Up @@ -400,7 +376,7 @@ const Detail = () => {
width="20px"
style={{ marginRight: '6px', borderRadius: '50%' }}
/>
{nftDetail.collectionContractName}
{nftDetail.contractName}
<ArrowForwardOutlinedIcon
sx={{
color: 'icon.navi',
Expand Down Expand Up @@ -462,9 +438,7 @@ const Detail = () => {
)}
{isAccessibleNft && (
<Box sx={{ height: '42px', position: 'fixed', bottom: '32px', right: '18px' }}>
{!(
nftDetail?.collectionContractName === 'Domains' && media?.title?.includes('.meow')
) && (
{!(nftDetail?.contractName === 'Domains' && media?.title?.includes('.meow')) && (
<Button
sx={{
backgroundColor: '#FFFFFF33',
Expand Down
Loading

0 comments on commit c76e66b

Please sign in to comment.