diff --git a/src/components/JoinDiscordBanner/JoinDiscordBanner.tsx b/src/components/JoinDiscordBanner/JoinDiscordBanner.tsx index 0893f925e..c44b27b4d 100644 --- a/src/components/JoinDiscordBanner/JoinDiscordBanner.tsx +++ b/src/components/JoinDiscordBanner/JoinDiscordBanner.tsx @@ -7,6 +7,7 @@ import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; import { usePathname } from 'next/navigation'; import { useTranslation } from 'react-i18next'; import { DiscordBannerButton, DiscordBannerLabel, DiscordBannerLink } from '.'; +import { DISCORD_URL_INVITE } from 'src/const/urls'; export const JoinDiscordBanner = () => { const { t } = useTranslation(); @@ -27,7 +28,7 @@ export const JoinDiscordBanner = () => { return ( handleClick(e)} isArticlePage={isArticle} > diff --git a/src/components/Superfest/ActiveSuperfestMissionsCarousel/ActiveSuperfestMissionsCarousel.tsx b/src/components/Superfest/ActiveSuperfestMissionsCarousel/ActiveSuperfestMissionsCarousel.tsx index 49a9c61e4..686b2ce93 100644 --- a/src/components/Superfest/ActiveSuperfestMissionsCarousel/ActiveSuperfestMissionsCarousel.tsx +++ b/src/components/Superfest/ActiveSuperfestMissionsCarousel/ActiveSuperfestMissionsCarousel.tsx @@ -49,6 +49,8 @@ export const ActiveSuperfestMissionsCarousel = ({ quest.attributes?.CustomInformation?.['claimingIds']; const rewardsIds = quest.attributes?.CustomInformation?.['rewardsIds']; + const rewardType = + quest.attributes?.CustomInformation?.['rewardType']; let included = false; let completed = false; if (claimingIds && activeCampaigns) { @@ -80,6 +82,9 @@ export const ActiveSuperfestMissionsCarousel = ({ slug={quest?.attributes.Slug} chains={quest.attributes.CustomInformation?.['chains']} completed={completed} + variableWeeklyAPY={ + quest?.attributes.Points > 0 && rewardType === 'weekly' + } /> ); } diff --git a/src/components/Superfest/AvailableMissionsList/AvailableMissionsList.tsx b/src/components/Superfest/AvailableMissionsList/AvailableMissionsList.tsx index f255c9246..869692e47 100644 --- a/src/components/Superfest/AvailableMissionsList/AvailableMissionsList.tsx +++ b/src/components/Superfest/AvailableMissionsList/AvailableMissionsList.tsx @@ -105,6 +105,8 @@ export const AvailableMissionsList = ({ const baseURL = quest.attributes.Image?.data?.attributes?.url; const imgURL = new URL(baseURL, url.origin); const rewards = quest.attributes.CustomInformation?.['rewards']; + const rewardType = + quest.attributes?.CustomInformation?.['rewardType']; const chains = quest.attributes.CustomInformation?.['chains']; const claimingIds = quest.attributes?.CustomInformation?.['claimingIds']; @@ -161,6 +163,9 @@ export const AvailableMissionsList = ({ rewards={rewards} completed={completed} claimingIds={claimingIds} + variableWeeklyAPY={ + quest?.attributes.Points > 0 && rewardType === 'weekly' + } /> ); }) diff --git a/src/components/Superfest/QuestCard/QuestCard.tsx b/src/components/Superfest/QuestCard/QuestCard.tsx index 44c681450..50e70e08c 100644 --- a/src/components/Superfest/QuestCard/QuestCard.tsx +++ b/src/components/Superfest/QuestCard/QuestCard.tsx @@ -43,6 +43,7 @@ interface QuestCardProps { rewards?: RewardsInterface; completed?: boolean; claimingIds?: string[]; + variableWeeklyAPY?: boolean; } export const QuestCard = ({ @@ -58,6 +59,7 @@ export const QuestCard = ({ rewards, completed, claimingIds, + variableWeeklyAPY, }: QuestCardProps) => { const { t } = useTranslation(); const router = useRouter(); @@ -111,7 +113,7 @@ export const QuestCard = ({ {points ? ( - {apy > 0 && ( + {apy > 0 && !variableWeeklyAPY && ( )} + {variableWeeklyAPY && ( + + + {`VAR.%`} + + + + + + )} - - - - {rewardType === 'weekly' ? ( - - ) : ( - - )} - - - + {rewards && rewards.amount && ( + + + + {rewardType === 'weekly' ? ( + + ) : ( + + )} + + + + )} { +export const MissionCTA = ({ CTAs, variableWeeklyAPY }: MissionCtaProps) => { const { t } = useTranslation(); const { trackEvent } = useUserTracking(); const theme = useTheme(); @@ -103,7 +104,7 @@ export const MissionCTA = ({ CTAs }: MissionCtaProps) => { - {CTA.apy && ( + {CTA.apy && !variableWeeklyAPY && ( { )} + {variableWeeklyAPY && ( + + + {`VAR.%`} + + + + + + )} {!isMobile && ( { const attributes = quest?.attributes; const CTAs = quest?.attributes?.CustomInformation?.['CTA']; + const rewardType = attributes?.CustomInformation?.['rewardType']; + const points = quest?.attributes?.Points; const { account } = useAccounts(); const { pastCampaigns } = useMerklRewards({ @@ -49,6 +51,7 @@ export const SuperfestMissionPage = ({ url={attributes?.Link} key={generateKey('cta')} CTAs={CTAsWithAPYs} + variableWeeklyAPY={points > 0 && rewardType === 'weekly'} /> {/* Subtitle and description */}