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

Staging Release #1650

Merged
merged 7 commits into from
Jan 22, 2025
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
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NEXT_PUBLIC_ENVIRONMENT=development
NEXT_PUBLIC_SITE_URL=https://develop.jumper.exchange
NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID=G-T6ZDXLLXB5
NEXT_PUBLIC_LIFI_API_URL=https://api-develop.jumper.exchange/p/lifi
NEXT_PUBLIC_ZAP_API_URL=https://api-develop.jumper.exchange/zaps
NEXT_PUBLIC_WIDGET_INTEGRATOR=dev.jumper.exchange
NEXT_PUBLIC_WIDGET_INTEGRATOR_REFUEL=dev.jumper.exchange.gas
NEXT_PUBLIC_WIDGET_INTEGRATOR_BLOG=dev.jumper.exchange.blog
Expand Down
1 change: 1 addition & 0 deletions .env.localhost
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NEXT_PUBLIC_ENVIRONMENT=localhost
NEXT_PUBLIC_SITE_URL=http://localhost:3000
NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID=G-T6ZDXLLXB5
NEXT_PUBLIC_LIFI_API_URL=http://localhost:8000/v1
NEXT_PUBLIC_ZAP_API_URL=http://localhost:8000/zaps
NEXT_PUBLIC_WIDGET_INTEGRATOR=loc.jumper.exchange
NEXT_PUBLIC_WIDGET_INTEGRATOR_REFUEL=loc.jumper.exchange.gas
NEXT_PUBLIC_WIDGET_INTEGRATOR_BLOG=loc.jumper.exchange.blog
Expand Down
3 changes: 2 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
NEXT_PUBLIC_ENVIRONMENT=production
NEXT_PUBLIC_SITE_URL=https://jumper.exchange
NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID=G-7YZS76QSV1
NEXT_PUBLIC_LIFI_API_URL=https://api.jumper.exchange/p/lifi
NEXT_PUBLIC_LIFI_API_URL=https://api-develop.jumper.exchange/p/lifi
NEXT_PUBLIC_ZAP_API_URL=https://api-develop.jumper.exchange/zaps
NEXT_PUBLIC_WIDGET_INTEGRATOR=jumper.exchange
NEXT_PUBLIC_WIDGET_INTEGRATOR_REFUEL=jumper.exchange.gas
NEXT_PUBLIC_WIDGET_INTEGRATOR_BLOG=jumper.exchange.blog
Expand Down
1 change: 1 addition & 0 deletions .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NEXT_PUBLIC_ENVIRONMENT=staging
NEXT_PUBLIC_SITE_URL=https://staging.jumper.exchange
NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID=G-T6ZDXLLXB5
NEXT_PUBLIC_LIFI_API_URL=https://api-staging.jumper.exchange/p/lifi
NEXT_PUBLIC_ZAP_API_URL=https://api-staging.jumper.exchange/zaps
NEXT_PUBLIC_WIDGET_INTEGRATOR=stg.jumper.exchange
NEXT_PUBLIC_WIDGET_INTEGRATOR_REFUEL=stg.jumper.exchange.gas
NEXT_PUBLIC_WIDGET_INTEGRATOR_BLOG=stg.jumper.exchange.blog
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,3 @@ Register on Crowdin and you can start translating the project into your preferre
Your contributions will help make our project accessible to a wider audience around the world.

Thank you for your support!


11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"@fingerprintjs/fingerprintjs": "^3.4.2",
"@headlessui/react": "^2.2.0",
"@lifi/explorer": "^0.0.4",
"@lifi/sdk": "3.4.3",
"@lifi/wallet-management": "^3.4.7",
"@lifi/widget": "3.12.5",
"@lifi/sdk": "3.5.2",
"@lifi/wallet-management": "^3.4.8-beta.0",
"@lifi/widget": "^3.12.6-beta.0",
"@metaplex-foundation/mpl-core": "^1.1.1",
"@metaplex-foundation/umi": "^0.9.2",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
Expand Down Expand Up @@ -61,7 +61,7 @@
"react-dom": "^18.3.1",
"react-error-boundary": "^4.1.2",
"react-i18next": "^15.1.4",
"royco": "0.9.179",
"royco": "0.9.238",
"shallow-equal": "^3.1.0",
"sharp": "^0.33.5",
"siwe": "^2.3.2",
Expand Down Expand Up @@ -128,6 +128,9 @@
"build:cache": "synpress --headless",
"build:cache:ci": "xvfb-run synpress --force tests/wallet-setup/"
},
"resolutions": {
"@metamask/sdk": "0.30.0"
},
"lint-staged": {
"**/*.(ts|tsx|js)": [
"bash -c tsc --noEmit",
Expand Down
11,936 changes: 8,821 additions & 3,115 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions src/app/[lng]/(infos)/campaign/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import type { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { siteName } from 'src/app/lib/metadata';
import { CampaignPage } from 'src/components/Campaign/CampaignPage';
import { getSiteUrl, JUMPER_LOYALTY_PATH } from 'src/const/urls';
import type { Quest, QuestAttributes } from 'src/types/loyaltyPass';
import { sliceStrToXChar } from 'src/utils/splitStringToXChar';

//Todo: put right metadata
// export async function generateMetadata({
// params,
// }: {
// params: { slug: string };
// }): Promise<Metadata> {
// try {
// // const quest = await getQuestBySlug(params.slug);

// if (!quest || !quest.data) {
// throw new Error();
// }

// const questData = (quest.data as any as Quest)
// .attributes as QuestAttributes;

// const openGraph: Metadata['openGraph'] = {
// title: `Jumper Quest | ${sliceStrToXChar(questData.Title, 45)}`,
// description: `${sliceStrToXChar(questData.Information || 'Quest description', 60)}`,
// siteName: siteName,
// url: `${getSiteUrl()}/quests/${params.slug}`,
// images: [
// {
// url: `${quest.url}${questData.Image.data.attributes?.url}`,
// width: 900,
// height: 450,
// alt: 'banner image',
// },
// ],
// type: 'article',
// };

// return {
// title: `Jumper Campaign | ${sliceStrToXChar(questData.Title, 45)}`,
// description: questData.Subtitle,
// alternates: {
// canonical: `${getSiteUrl()}/quests/${params.slug}`,
// },
// twitter: openGraph,
// openGraph,
// };
// } catch (err) {
// return {
// title: `Jumper Campaign | ${sliceStrToXChar(params.slug.replaceAll('-', ' '), 45)}`,
// description: `This is the description for the quest "${params.slug.replaceAll('-', ' ')}".`,
// };
// }
// }

export default async function Page({ params }: { params: { slug: string } }) {
return <CampaignPage label={params.slug} path={JUMPER_LOYALTY_PATH} />;
}
11 changes: 5 additions & 6 deletions src/app/[lng]/(infos)/learn/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { getArticles } from '@/app/lib/getArticles';
import { siteName } from '@/app/lib/metadata';
import LearnArticlePage from '@/app/ui/learn/LearnArticlePage';
import { getSiteUrl } from '@/const/urls';
import type { BlogArticleAttributes, BlogArticleData } from '@/types/strapi';
import { sliceStrToXChar } from '@/utils/splitStringToXChar';
import type { Metadata } from 'next';
import { notFound, permanentRedirect } from 'next/navigation';
import { getArticleBySlug } from '../../../../lib/getArticleBySlug';
import { getArticlesByTag } from '../../../../lib/getArticlesByTag';
import { getCookies } from '../../../../lib/getCookies';
import { getSiteUrl } from '@/const/urls';
import { notFound, permanentRedirect } from 'next/navigation';

export async function generateMetadata({
params,
Expand Down Expand Up @@ -68,13 +68,12 @@ export default async function Page({ params }: { params: { slug: string } }) {
return notFound();
}

if (articleData.attributes.RedirectURL) {
return permanentRedirect(articleData.attributes.RedirectURL);
if (articleData.attributes?.RedirectURL) {
return permanentRedirect(articleData.attributes?.RedirectURL);
}

const currentTags = articleData?.attributes?.tags.data.map((el) => el?.id);
const relatedArticles = await getArticlesByTag(articleData.id, currentTags);

return (
<LearnArticlePage
article={articleData}
Expand All @@ -89,7 +88,7 @@ export async function generateStaticParams() {
const articles = await getArticles();

const data = articles.data.map((article) => ({
slug: article.attributes.Slug,
slug: article.attributes?.Slug,
}));

return data;
Expand Down
3 changes: 1 addition & 2 deletions src/app/[lng]/(infos)/learn/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { getArticles } from '@/app/lib/getArticles';
import { getFeaturedArticle } from '@/app/lib/getFeaturedArticle';
import LearnPage from '@/app/ui/learn/LearnPage';
import { getSiteUrl } from '@/const/urls';
import type { Metadata } from 'next';
import { getTags } from 'src/app/lib/getTags';
import { getSiteUrl } from '@/const/urls';

export const metadata: Metadata = {
title: 'Jumper Learn',
Expand All @@ -19,7 +19,6 @@ export default async function Page() {
const featuredArticle = await getFeaturedArticle();
const carouselArticles = await getArticles(featuredArticle.data.id, 5);
const tags = await getTags();

return (
<LearnPage
tags={tags}
Expand Down
5 changes: 3 additions & 2 deletions src/app/[lng]/(infos)/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import ProfilePage from '@/app/ui/profile/ProfilePage';
import { getSiteUrl } from '@/const/urls';

export const metadata: Metadata = {
title: 'Jumper Profile',
description: 'Jumper Profile is the profile page of Jumper Exchange.',
title: 'Jumper Loyalty Pass',
description:
'Jumper Loyalty Pass is the page explaining the Loyalty Pass sytem.',
alternates: {
canonical: `${getSiteUrl()}/profile`,
},
Expand Down
6 changes: 3 additions & 3 deletions src/app/[lng]/[partnerTheme]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export async function generateMetadata({
}): Promise<Metadata> {
const partnerThemes = await getPartnerThemes();
const partnerThemesData = partnerThemes.data?.find(
(d) => d.attributes.uid === partnerTheme,
(d) => d.attributes?.uid === partnerTheme,
);
const theme = partnerThemesData
? partnerThemesData.attributes.uid
? partnerThemesData.attributes?.uid
: 'default';
return {
other: {
Expand All @@ -34,7 +34,7 @@ export default async function PartnerThemeLayout({
const partnerThemes = await getPartnerThemes();

const partnerThemesData = partnerThemes.data?.find(
(d) => d.attributes.uid === partnerTheme,
(d) => d.attributes?.uid === partnerTheme,
);

if (!partnerThemesData) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/[lng]/[partnerTheme]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function generateStaticParams() {

let customPath = [
{ partnerTheme: 'memecoins' },
...partnerThemes.data.map((d) => ({ partnerTheme: d.attributes.uid })),
...partnerThemes.data.map((d) => ({ partnerTheme: d.attributes?.uid })),
];

return customPath;
Expand Down
6 changes: 3 additions & 3 deletions src/app/[lng]/berachain/explore/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function generateMetadata({
}): Promise<Metadata> {
try {
const { data } = await getQuestBySlug(params.slug);
const questData = data.data[0] || undefined;
const questData = data;
if (!questData) {
throw new Error();
}
Expand All @@ -34,8 +34,8 @@ export async function generateMetadata({
};

return {
title: `Jumper Berachain | ${sliceStrToXChar(questData.attributes.Title, 45)}`,
description: `Description of ${questData.attributes.Title}`,
title: `Jumper Berachain | ${sliceStrToXChar(questData.attributes?.Title, 45)}`,
description: `Description of ${questData.attributes?.Title}`,
alternates: {
canonical: `${getSiteUrl()}/berachain/explore/${params.slug}`,
},
Expand Down
69 changes: 55 additions & 14 deletions src/app/[lng]/quests/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,63 @@
// todo: adjust metadata for quests-page
// export const metadata: Metadata = {
// title: 'Jumper | Quests',
// description: 'Dive into the Quests',
// alternates: {
// canonical: `${process.env.NEXT_PUBLIC_SITE_URL}/quests/`,
// },
// };

import type { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { siteName } from 'src/app/lib/metadata';
import { getSiteUrl } from 'src/const/urls';
import type { Quest, QuestAttributes } from 'src/types/loyaltyPass';
import { sliceStrToXChar } from 'src/utils/splitStringToXChar';
import { getQuestBySlug } from '../../../lib/getQuestBySlug';
import QuestPage from '../../../ui/quests/QuestMissionPage';
import { notFound } from 'next/navigation';

export async function generateMetadata({
params,
}: {
params: { slug: string };
}): Promise<Metadata> {
try {
const quest = await getQuestBySlug(params.slug);

if (!quest || !quest.data) {
throw new Error();
}

const questData = quest.data.attributes;

const openGraph: Metadata['openGraph'] = {
title: `Jumper Quest | ${sliceStrToXChar(questData.Title, 45)}`,
description: `${sliceStrToXChar(questData.Information || 'Quest description', 60)}`,
siteName: siteName,
url: `${getSiteUrl()}/quests/${params.slug}`,
images: [
{
url: `${quest.url}${questData.Image.data.attributes?.url}`,
width: 900,
height: 450,
alt: 'banner image',
},
],
type: 'article',
};

return {
title: `Jumper Quest | ${sliceStrToXChar(questData.Title, 45)}`,
description: questData.Subtitle,
alternates: {
canonical: `${getSiteUrl()}/quests/${params.slug}`,
},
twitter: openGraph,
openGraph,
};
} catch (err) {
return {
title: `Jumper Quest | ${sliceStrToXChar(params.slug.replaceAll('-', ' '), 45)}`,
description: `This is the description for the quest "${params.slug.replaceAll('-', ' ')}".`,
};
}
}

export default async function Page({ params }: { params: { slug: string } }) {
const { data, url } = await getQuestBySlug(params.slug);

if (!data?.data?.[0]) {
if (!data) {
return notFound();
}

return <QuestPage quest={data?.data?.[0]} url={url} />;
return <QuestPage quest={data} url={url} />;
}
8 changes: 3 additions & 5 deletions src/app/[lng]/superfest/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { notFound } from 'next/navigation';
import { getQuestBySlug } from 'src/app/lib/getQuestBySlug';
import SuperfestPage from 'src/app/ui/superfest/SuperfestMissionPage';
import { notFound } from 'next/navigation';

// export async function generateMetadata({
// params,
Expand Down Expand Up @@ -44,10 +44,8 @@ import { notFound } from 'next/navigation';

export default async function Page({ params }: { params: { slug: string } }) {
const { data, url } = await getQuestBySlug(params.slug);

if (!data?.data?.[0]) {
if (!data) {
return notFound();
}

return <SuperfestPage quest={data?.data?.[0]} url={url} />;
return <SuperfestPage quest={data} url={url} />;
}
Loading
Loading