Skip to content

Commit

Permalink
Production Release
Browse files Browse the repository at this point in the history
Production Release
  • Loading branch information
tcheee authored Aug 29, 2024
2 parents 1174875 + 77af057 commit 679a162
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 121 deletions.
174 changes: 62 additions & 112 deletions src/components/Superfest/NFTClaimingBox/NFTCard/NFTCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ export const NFTCard = ({ image, chain, bgColor, typoColor }: NFTCardProps) => {
});

const NFTimage =
chain === 'box' && claimInfo.isClaimed ? LAST_NFT_IMAGE : image;

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

async function handleClick() {
try {
Expand Down Expand Up @@ -174,91 +172,50 @@ 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>
// );
// }
// 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
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',
// }}
sx={{
cursor: 'not-allowed',
}}
>
<Image
style={{
Expand All @@ -272,31 +229,24 @@ export const NFTCard = ({ image, chain, bgColor, typoColor }: NFTCardProps) => {
height="288"
/>
<NFTCardBotomBox>
<Link
href={`https://app.galxe.com/quest/JumperExchange/${claimInfo.cid}`}
target={'_blank'}
style={{ textDecoration: 'inherit' }}
<Button
size="medium"
disabled={true}
styles={{
backgroundColor: 'transparent',
border: '2px dotted',
borderColor: '#C5B99C',
width: '75%',
'&:hover': {
backgroundColor: bgColor,
color: typoColor,
},
}}
>
<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>
<SoraTypography fontSize="16px" lineHeight="18px" fontWeight={600}>
{chain === 'box' ? 'LOCKED' : 'UNAVAILABLE'}
</SoraTypography>
</Button>
</NFTCardBotomBox>
</NFTCardMainBox>
);
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/useJumperTracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export interface JumperDataTrackTransactionProps {
errorCode?: string | number;
errorMessage?: string;
pathname?: string;
url: string;
browserFingerprint: string;
}

export const useJumperTracking = () => {
Expand Down Expand Up @@ -113,6 +115,8 @@ export const useJumperTracking = () => {
errorMessage: data.errorMessage,
errorCode: data.errorCode,
pathname: data.pathname,
url: data.url,
browserFingerprint: data.browserFingerprint,
};
await track(transactionData, JUMPER_ANALYTICS_TRANSACTION);
};
Expand Down
18 changes: 10 additions & 8 deletions src/hooks/useSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
import { useEffect, useState } from 'react';
import { v7 as uuidv7 } from 'uuid';

export const useSession = (): string | undefined => {
const [session, setSession] = useState<string | undefined>(() => {
export const useSession = (): string => {
const [session, setSession] = useState<string>(() => {
if (
typeof window !== 'undefined' &&
typeof sessionStorage !== 'undefined'
) {
return sessionStorage.getItem('session_id') || undefined;
return sessionStorage.getItem('session_id') || uuidv7();
}
return undefined;
return uuidv7();
});

useEffect(() => {
if (!session) {
const newSessionId = uuidv7();
setSession(newSessionId);
sessionStorage.setItem('session_id', newSessionId);
if (
typeof window !== 'undefined' &&
typeof sessionStorage !== 'undefined'
) {
sessionStorage.setItem('session_id', session);
setSession(session);
}
}, [session]);

Expand Down
4 changes: 3 additions & 1 deletion src/hooks/userTracking/useUserTracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function useUserTracking() {
browserFingerprint: fp,
isMobile: !isDesktop,
sessionId: sessionId || 'unknown',
url: process.env.NEXT_PUBLIC_SITE_URL,
url: window?.location?.href,
};
await jumperTrackEvent(eventData);
} catch (error) {
Expand Down Expand Up @@ -199,6 +199,8 @@ export function useUserTracking() {
errorCode: data[TrackingEventParameter.ErrorCode],
errorMessage: data[TrackingEventParameter.ErrorMessage],
action: data[TrackingEventParameter.Action] || '',
url: window?.location?.href,
browserFingerprint: fp,
};
await jumperTrackTransaction(transactionData);
}
Expand Down

1 comment on commit 679a162

@vercel
Copy link

@vercel vercel bot commented on 679a162 Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.