Skip to content

Commit

Permalink
Staging Release
Browse files Browse the repository at this point in the history
Staging Release
  • Loading branch information
tcheee authored Aug 28, 2024
2 parents 9cb8b6a + c683c3b commit 0c6e439
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
4 changes: 3 additions & 1 deletion src/components/Superfest/SuperfestPage/CTA/MissionCTA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ interface MissionCtaProps {
variableWeeklyAPY?: boolean;
signature?: boolean;
rewardRange?: string;
isTurtleMember?: boolean;
}

export const MissionCTA = ({
Expand All @@ -47,6 +48,7 @@ export const MissionCTA = ({
variableWeeklyAPY,
signature,
rewardRange,
isTurtleMember,
}: MissionCtaProps) => {
const { t } = useTranslation();
const { trackEvent } = useUserTracking();
Expand Down Expand Up @@ -86,7 +88,7 @@ export const MissionCTA = ({
) : undefined}
</StartedTitleBox>
<SeveralCTABox>
{signature && <SignatureCTA />}
{signature && <SignatureCTA isTurtleMember={isTurtleMember} />}
{CTAs.map((CTA: CTALinkInt, i: number) => {
return (
<Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
CTAExplanationBox,
SeveralMissionCtaContainer,
} from '../CTA/MissionCTA.style';
import { useTurtleMember } from 'src/hooks/useTurtleMember';
import { SiweMessage, generateNonce } from 'siwe';

interface SignatureInt {
Expand All @@ -23,9 +22,13 @@ interface SignatureInt {

interface SignatureCtaProps {
signature?: SignatureInt;
isTurtleMember?: boolean;
}

export const SignatureCTA = ({ signature }: SignatureCtaProps) => {
export const SignatureCTA = ({
signature,
isTurtleMember,
}: SignatureCtaProps) => {
const { t } = useTranslation();
const { trackEvent } = useUserTracking();
const { account } = useAccounts();
Expand All @@ -35,13 +38,6 @@ export const SignatureCTA = ({ signature }: SignatureCtaProps) => {
const [messagedHasBeenSigned, setMessagedHasBeenSigned] =
useState<boolean>(false);
const { signMessageAsync } = useSignMessage();
const {
isMember,
isLoading: isMemberCheckLoading,
isSuccess: isMemberCheckSuccess,
} = useTurtleMember({
userAddress: account?.address,
});

const handleSignatureClick = async () => {
try {
Expand Down Expand Up @@ -107,7 +103,7 @@ export const SignatureCTA = ({ signature }: SignatureCtaProps) => {

return (
<>
{(messagedHasBeenSigned || isMember) && (
{(messagedHasBeenSigned || isTurtleMember) && (
<Box sx={{ width: '100%', marginBottom: '16px' }}>
<SeveralMissionCtaContainer
sx={{ cursor: 'not-allowed', '&:hover': { cursor: 'not-allowed' } }}
Expand All @@ -134,7 +130,7 @@ export const SignatureCTA = ({ signature }: SignatureCtaProps) => {
</SeveralMissionCtaContainer>
</Box>
)}
{!messagedHasBeenSigned && !isMember && (
{!messagedHasBeenSigned && !isTurtleMember && (
<Box sx={{ width: '100%', marginBottom: '16px' }}>
<SeveralMissionCtaContainer onClick={handleSignatureClick}>
<CTAExplanationBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const SuperfestMissionPage = ({
CTAs={CTAsWithAPYs}
variableWeeklyAPY={points > 0 && rewardType === 'weekly'}
signature={missionType === 'turtle_signature'}
isTurtleMember={isMember}
rewardRange={rewardRange}
/>
{/* Subtitle and description */}
Expand Down
14 changes: 7 additions & 7 deletions src/components/Widgets/WidgetEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ export function WidgetEvents() {
if (update.process && update.route) {
if (update.process.txHash !== lastTxHashRef.current) {
lastTxHashRef.current = update.process.txHash;
trackTransaction({
category: TrackingCategory.WidgetEvent,
action: TrackingAction.OnRouteExecutionUpdated,
label: 'execution_update',
data,
enableAddressable: true,
});
// trackTransaction({
// category: TrackingCategory.WidgetEvent,
// action: TrackingAction.OnRouteExecutionUpdated,
// label: 'execution_update',
// data,
// enableAddressable: true,
// });
}
}
};
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useTurtleMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const useTurtleMember = ({
return false;
} catch (err) {
console.log(err);
return false;
}
},
enabled: !!userAddress,
Expand All @@ -53,10 +54,11 @@ export const useTurtleMember = ({
return false;
} catch (err) {
console.log(err);
return false;
}
},
enabled: !!userAddress,
refetchInterval: 1000 * 60 * 60,
refetchInterval: 1000 * 60 * 60 * 2,
});

return {
Expand Down

0 comments on commit 0c6e439

Please sign in to comment.