Skip to content

Commit

Permalink
fix: temporary redirection link while API graphql endpoint is fixed (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tcheee authored Aug 27, 2024
1 parent 4f55e8e commit 4722a0a
Showing 1 changed file with 113 additions and 62 deletions.
175 changes: 113 additions & 62 deletions src/components/Superfest/NFTClaimingBox/NFTCard/NFTCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ChainId } from '@lifi/sdk';
import { GalxeNFTABI } from 'src/const/abi/galxeNftABI';
import { SoraTypography } from '../../Superfest.style';
import { useCheckNFTAvailability } from 'src/hooks/useCheckNFTAvailability';
import Link from 'next/link';

interface NFTCardProps {
image: string;
Expand All @@ -37,9 +38,11 @@ export const NFTCard = ({ image, chain, bgColor, typoColor }: NFTCardProps) => {
});

const NFTimage =
chain === 'box' && (claimInfo.isClaimable || claimInfo.isClaimed)
? LAST_NFT_IMAGE
: image;
chain === 'box' && claimInfo.isClaimed ? LAST_NFT_IMAGE : image;

// chain === 'box' && (claimInfo.isClaimable || claimInfo.isClaimed)
// ? LAST_NFT_IMAGE
// : image;

async function handleClick() {
try {
Expand Down Expand Up @@ -171,50 +174,91 @@ export const NFTCard = ({ image, chain, bgColor, typoColor }: NFTCardProps) => {
);
}

if (claimInfo?.isClaimable) {
return (
<NFTCardMainBox>
<Image
style={{
borderTopRightRadius: '8px',
borderTopLeftRadius: '8px',
marginBottom: '0px',
}}
src={NFTimage}
alt={chain}
width="288"
height="288"
/>
<NFTCardBotomBox>
<Button
disabled={isConfirming}
size="medium"
styles={{
backgroundColor: 'transparent',
border: '2px dotted',
borderColor: '#000000',
color: '#000000',
width: '75%',
'&:hover': {
backgroundColor: bgColor,
color: typoColor,
},
}}
onClick={() => handleClick()}
>
<SoraTypography fontSize="16px" lineHeight="18px" fontWeight={600}>
{isConfirming ? 'MINTING...' : 'MINT'}
</SoraTypography>
</Button>
</NFTCardBotomBox>
</NFTCardMainBox>
);
}
// if (claimInfo?.isClaimable) {
// return (
// <NFTCardMainBox>
// <Image
// style={{
// borderTopRightRadius: '8px',
// borderTopLeftRadius: '8px',
// marginBottom: '0px',
// }}
// src={NFTimage}
// alt={chain}
// width="288"
// height="288"
// />
// <NFTCardBotomBox>
// <Button
// disabled={isConfirming}
// size="medium"
// styles={{
// backgroundColor: 'transparent',
// border: '2px dotted',
// borderColor: '#000000',
// color: '#000000',
// width: '75%',
// '&:hover': {
// backgroundColor: bgColor,
// color: typoColor,
// },
// }}
// onClick={() => handleClick()}
// >
// <SoraTypography fontSize="16px" lineHeight="18px" fontWeight={600}>
// {isConfirming ? 'MINTING...' : 'MINT'}
// </SoraTypography>
// </Button>
// </NFTCardBotomBox>
// </NFTCardMainBox>
// );
// }
// return (
// <NFTCardMainBox
// sx={{
// cursor: 'not-allowed',
// }}
// >
// <Image
// style={{
// borderTopRightRadius: '8px',
// borderTopLeftRadius: '8px',
// marginBottom: '0px',
// }}
// src={NFTimage}
// alt={chain}
// width="288"
// height="288"
// />
// <NFTCardBotomBox>
// <Button
// size="medium"
// disabled={true}
// styles={{
// backgroundColor: 'transparent',
// border: '2px dotted',
// borderColor: '#C5B99C',
// width: '75%',
// '&:hover': {
// backgroundColor: bgColor,
// color: typoColor,
// },
// }}
// >
// <SoraTypography fontSize="16px" lineHeight="18px" fontWeight={600}>
// {chain === 'box' ? 'LOCKED' : 'UNAVAILABLE'}
// </SoraTypography>
// </Button>
// </NFTCardBotomBox>
// </NFTCardMainBox>
// );

// temporary fix
return (
<NFTCardMainBox
sx={{
cursor: 'not-allowed',
}}
// sx={{
// cursor: 'not-allowed',
// }}
>
<Image
style={{
Expand All @@ -228,24 +272,31 @@ export const NFTCard = ({ image, chain, bgColor, typoColor }: NFTCardProps) => {
height="288"
/>
<NFTCardBotomBox>
<Button
size="medium"
disabled={true}
styles={{
backgroundColor: 'transparent',
border: '2px dotted',
borderColor: '#C5B99C',
width: '75%',
'&:hover': {
backgroundColor: bgColor,
color: typoColor,
},
}}
<Link
href={`https://app.galxe.com/quest/JumperExchange/${claimInfo.cid}`}
target={'_blank'}
style={{ textDecoration: 'inherit' }}
>
<SoraTypography fontSize="16px" lineHeight="18px" fontWeight={600}>
{chain === 'box' ? 'LOCKED' : 'UNAVAILABLE'}
</SoraTypography>
</Button>
<Button
size="medium"
// disabled={false}
styles={{
backgroundColor: 'transparent',
border: '2px dotted',
color: '#000000',
borderColor: '#C5B99C',
width: '75%',
'&:hover': {
backgroundColor: bgColor,
color: typoColor,
},
}}
>
<SoraTypography fontSize="14px" lineHeight="18px" fontWeight={600}>
{'CHECK AVAILABILITY'}
</SoraTypography>
</Button>
</Link>
</NFTCardBotomBox>
</NFTCardMainBox>
);
Expand Down

0 comments on commit 4722a0a

Please sign in to comment.