Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production Release #1271

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading