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 Jul 29, 2024
2 parents 03f5576 + 815e17a commit 42460e9
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/components/JoinDiscordBanner/JoinDiscordBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -27,7 +28,7 @@ export const JoinDiscordBanner = () => {

return (
<DiscordBannerLink
href={'https://discord.com/invite/jumperexchange'}
href={DISCORD_URL_INVITE}
onClick={(e) => handleClick(e)}
isArticlePage={isArticle}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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'
}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -161,6 +163,9 @@ export const AvailableMissionsList = ({
rewards={rewards}
completed={completed}
claimingIds={claimingIds}
variableWeeklyAPY={
quest?.attributes.Points > 0 && rewardType === 'weekly'
}
/>
);
})
Expand Down
19 changes: 18 additions & 1 deletion src/components/Superfest/QuestCard/QuestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface QuestCardProps {
rewards?: RewardsInterface;
completed?: boolean;
claimingIds?: string[];
variableWeeklyAPY?: boolean;
}

export const QuestCard = ({
Expand All @@ -58,6 +59,7 @@ export const QuestCard = ({
rewards,
completed,
claimingIds,
variableWeeklyAPY,
}: QuestCardProps) => {
const { t } = useTranslation();
const router = useRouter();
Expand Down Expand Up @@ -111,7 +113,7 @@ export const QuestCard = ({
</FlexCenterRowBox>
{points ? (
<FlexCenterRowBox>
{apy > 0 && (
{apy > 0 && !variableWeeklyAPY && (
<XPDisplayBox active={active} bgcolor={'#ff0420'}>
<SoraTypography
fontSize="14px"
Expand All @@ -126,6 +128,21 @@ export const QuestCard = ({
</XPIconBox>
</XPDisplayBox>
)}
{variableWeeklyAPY && (
<XPDisplayBox active={active} bgcolor={'#ff0420'}>
<SoraTypography
fontSize="14px"
fontWeight={700}
lineHeight="18px"
color={'#ffffff'}
>
{`VAR.%`}
</SoraTypography>
<XPIconBox marginLeft="4px">
<APYIcon size={20} />
</XPIconBox>
</XPDisplayBox>
)}
<XPDisplayBox
active={active}
bgcolor={!completed ? '#31007A' : '#42B852'}
Expand Down
24 changes: 13 additions & 11 deletions src/components/Superfest/SuperfestPage/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,19 @@ export const BannerBox = ({

return (
<>
<BadgeMainBox>
<BadgeRelativeBox>
<RotatingBox>
{rewardType === 'weekly' ? (
<SuperfestWeeklyRewards />
) : (
<SuperfestDailyRewards />
)}
</RotatingBox>
</BadgeRelativeBox>
</BadgeMainBox>
{rewards && rewards.amount && (
<BadgeMainBox>
<BadgeRelativeBox>
<RotatingBox>
{rewardType === 'weekly' ? (
<SuperfestWeeklyRewards />
) : (
<SuperfestDailyRewards />
)}
</RotatingBox>
</BadgeRelativeBox>
</BadgeMainBox>
)}
<BannerMainBox>
<BannerImageBox>
<Image
Expand Down
25 changes: 23 additions & 2 deletions src/components/Superfest/SuperfestPage/CTA/MissionCTA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ interface MissionCtaProps {
url?: string;
id?: number;
CTAs: CTALinkInt[];
variableWeeklyAPY?: boolean;
}

export const MissionCTA = ({ CTAs }: MissionCtaProps) => {
export const MissionCTA = ({ CTAs, variableWeeklyAPY }: MissionCtaProps) => {
const { t } = useTranslation();
const { trackEvent } = useUserTracking();
const theme = useTheme();
Expand Down Expand Up @@ -103,7 +104,7 @@ export const MissionCTA = ({ CTAs }: MissionCtaProps) => {
</SoraTypography>
</CTAExplanationBox>
<FlexCenterRowBox>
{CTA.apy && (
{CTA.apy && !variableWeeklyAPY && (
<XPDisplayBox
bgcolor={'#ff0420'}
marginRight={'16px'}
Expand All @@ -123,6 +124,26 @@ export const MissionCTA = ({ CTAs }: MissionCtaProps) => {
</XPIconBox>
</XPDisplayBox>
)}
{variableWeeklyAPY && (
<XPDisplayBox
bgcolor={'#ff0420'}
marginRight={'16px'}
height={'32px'}
minWidth={'88px'}
>
<SoraTypography
fontSize="16px"
fontWeight={700}
lineHeight="20px"
color={'#ffffff'}
>
{`VAR.%`}
</SoraTypography>
<XPIconBox marginLeft="4px">
<APYIcon size={24} />
</XPIconBox>
</XPDisplayBox>
)}
{!isMobile && (
<MissionCtaButton onClick={handleClick}>
<ArrowForwardIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const SuperfestMissionPage = ({
}: SuperfestMissionPageVar) => {
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({
Expand All @@ -49,6 +51,7 @@ export const SuperfestMissionPage = ({
url={attributes?.Link}
key={generateKey('cta')}
CTAs={CTAsWithAPYs}
variableWeeklyAPY={points > 0 && rewardType === 'weekly'}
/>
{/* Subtitle and description */}
<DescriptionBox
Expand Down
1 change: 1 addition & 0 deletions src/const/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const JUMPER_URL = 'https://jumper.exchange';
export const LIFI_URL = 'https://li.fi';
export const EXPLORER_URL = 'https://explorer.li.fi';
export const DISCORD_URL = 'https://discord.gg/jumperexchange';
export const DISCORD_URL_INVITE = 'https://discord.com/invite/jumperexchange';
export const X_URL = 'https://x.com/JumperExchange';
export const GITHUB_URL = 'https://github.com/jumperexchange';
export const DOCS_URL = 'https://docs.li.fi/';
Expand Down

1 comment on commit 42460e9

@vercel
Copy link

@vercel vercel bot commented on 42460e9 Jul 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.