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

feat: jumper scan #1132

Merged
merged 38 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b9bb863
chore: add lifi explorer package
Addminus Jul 15, 2024
b0691d0
Merge branch 'develop' into LF-jumper-scan
dennyscode Jul 24, 2024
c9a723e
chore: integrate scan page
dennyscode Jul 24, 2024
63fd807
Merge branch 'develop' into LF-jumper-scan
dennyscode Jul 24, 2024
6606880
chore: hide themes in menu on scan pages
dennyscode Jul 24, 2024
1762d9b
Merge branch 'develop' into LF-jumper-scan
dennyscode Jul 29, 2024
e31ec44
fix: lang paths for scan
dennyscode Jul 30, 2024
0bd80e6
Merge branch 'develop' into LF-jumper-scan
dennyscode Jul 30, 2024
c3a356e
style: add scan button to wallet card
dennyscode Jul 30, 2024
489f3ad
refactor: remove wallet route from scan routes
dennyscode Jul 30, 2024
3eac7ad
fix: open wallets page of jumper scan
dennyscode Jul 30, 2024
56001cd
fix: open in a new tab
dennyscode Jul 30, 2024
41e3e5b
fix: use window to navigate
dennyscode Jul 30, 2024
e6bbe55
refactor: clean up
dennyscode Jul 31, 2024
6554d4f
chore: remove themes from menu on scan page
dennyscode Jul 31, 2024
d160f86
fix: set light mode on scan page
dennyscode Jul 31, 2024
e2e6760
fix: reload page on scan logo click
dennyscode Jul 31, 2024
75b72e0
chore: fix*debug scan
oktapodia Jul 31, 2024
5f18601
chore: adapt comments
tcheee Aug 1, 2024
187c666
chore: merge develop
tcheee Aug 1, 2024
88d5f19
feat: disable the light/dark mode on scan
tcheee Aug 1, 2024
1d9b040
feat: handle url change
tcheee Aug 1, 2024
721551b
fix: fix merge conflicts
tcheee Aug 1, 2024
df248e3
chore: put back window.open for testing
tcheee Aug 1, 2024
d95a2af
automatic push
tcheee Aug 1, 2024
b2b3322
fix: replace the title to Jumper scan and make CI green
bojank93 Aug 1, 2024
7e81b71
feat: make open app appear everywhere
tcheee Aug 1, 2024
2938df5
Merge branch 'LF-jumper-scan' of https://github.com/jumperexchange/ju…
tcheee Aug 1, 2024
bc52480
fix: fix JumperScan url
bojank93 Aug 1, 2024
2ba4f6a
feat: fix navigation
tcheee Aug 1, 2024
2f542db
Merge branch 'LF-jumper-scan' of https://github.com/jumperexchange/ju…
tcheee Aug 1, 2024
989005b
fix: disable popup event
bojank93 Aug 1, 2024
d321dd0
chore: get back to /scan everywhere
tcheee Aug 1, 2024
0653fff
automatic push
tcheee Aug 1, 2024
35c287f
chore: harmonize orga
tcheee Aug 1, 2024
ce765f4
chore: rebuild as before
tcheee Aug 1, 2024
8ab5faf
fix: Add back layout.tsx
oktapodia Aug 1, 2024
e8884f6
fix: force light theme
tcheee Aug 1, 2024
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
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ Thank you for your support!

provider for the theme context, it is used to provide the theme to the whole app, must be into the layout.tsx or page.tsx.


### ThemeProviderV2

provider for the MUI theme context, mainly setting up the MUI provider, very linked to the next-theme provider

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@emotion/cache": "^11.13.1",
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@lifi/explorer": "^0.0.1-alpha.12",
"@lifi/sdk": "^3.1.3",
"@lifi/wallet-management": "^3.0.6",
"@lifi/widget": "^3.3.0",
Expand Down Expand Up @@ -62,7 +63,7 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/uuid": "^10.0.0",
"eslint": "^9.8.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
"eslint-import-resolver-typescript": "^3.6.1",
Expand Down
23 changes: 19 additions & 4 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"short_name": "Jumper Exchange",
"name": "Jumper Exchange",
"description": "Multi-Chain Bridging & Swapping (powered by LI.FI)",
"description": "Multi-Chain Bridging & Swapping",
"icons": [
{
"src": "logo-16x16.svg",
Expand Down Expand Up @@ -36,21 +36,36 @@
"short_name": "swap/bridge",
"description": "Swap/bridge via Jumper",
"url": "/?source=pwa",
"icons": [{ "src": "/shortcut-icon.png", "sizes": "97x96" }]
"icons": [
{
"src": "/shortcut-icon.png",
"sizes": "97x96"
}
]
},
{
"name": "Gas",
"short_name": "Gas",
"description": "Gas via Jumper",
"url": "/gas?source=pwa",
"icons": [{ "src": "/shortcut-icon.png", "sizes": "97x96" }]
"icons": [
{
"src": "/shortcut-icon.png",
"sizes": "97x96"
}
]
},
{
"name": "Buy",
"short_name": "Buy",
"description": "Buy on Jumper",
"url": "/buy?source=pwa",
"icons": [{ "src": "/shortcut-icon.png", "sizes": "97x96" }]
"icons": [
{
"src": "/shortcut-icon.png",
"sizes": "97x96"
}
]
}
],
"start_url": ".",
Expand Down
48 changes: 48 additions & 0 deletions src/app/[lng]/scan/[[...segments]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use client';
import { LiFiExplorer } from '@lifi/explorer';
import type { PaletteMode } from '@mui/material';
import { alpha, Box, useTheme } from '@mui/material';
import { useMemo } from 'react';
import { ClientOnly } from 'src/components/ClientOnly';
import { fallbackLng } from 'src/i18n';

export default function Page({
params: { lng },
}: {
children: React.ReactNode;
params: { lng: string };
}) {
const theme = useTheme();

const explorerConfig = useMemo(
() => ({
appearance: 'light' as PaletteMode, //theme.palette.mode, // This controls light and dark mode
integrator: process.env.NEXT_PUBLIC_WIDGET_INTEGRATOR, // TODO: change as needed
base: lng !== fallbackLng ? `${lng}/scan/` : '/scan/', // Important for the routing and having everything served under /scan. Do not remove!
theme: {
// These colors and values correspond to the figma design
shape: { borderRadiusSecondary: 900, borderRadius: 12 },
palette: {
background: {
default: alpha(theme.palette.white.main, 0.8),
paper: alpha(theme.palette.white.main, 0.8),
},
},
},
}),
[lng, theme.palette.mode, theme.palette.white.main],
);

return (
<ClientOnly>
<Box
sx={{
p: 4,
paddingBottom: 8,
}}
>
<LiFiExplorer config={explorerConfig} />
</Box>
</ClientOnly>
);
}
28 changes: 28 additions & 0 deletions src/app/[lng]/scan/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { ThemeProviderV2 } from '@/providers/ThemeProviderV2';
import { ThemeProvider as NextThemeProvider } from 'next-themes';
import { cookies } from 'next/headers';
import React from 'react';
import { Layout } from 'src/Layout';

export default async function PartnerThemeLayout({
children,
params: { partnerTheme },
}: {
children: React.ReactNode;
params: { partnerTheme: string };
}) {
const cookiesHandler = cookies();

return (
<NextThemeProvider
themes={['light']}
forcedTheme={'light'}
enableSystem
enableColorScheme
>
<ThemeProviderV2>
<Layout>{children}</Layout>
</ThemeProviderV2>
</NextThemeProvider>
);
}
2 changes: 1 addition & 1 deletion src/app/lib/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from 'next';

const siteName = 'Jumper.Exchange';
const title = 'Jumper | Multi-Chain Bridging & Swapping (powered by LI.FI)';
const title = 'Jumper | Multi-Chain Bridging & Swapping';
const description =
'Jumper is Crypto’s Everything Exchange, enabling seamless swap and bridge transactions across 25 blockchains. By aggregating all of DeFi liquidity, Jumper ensures the best routes for any token transaction.';

Expand Down
10 changes: 4 additions & 6 deletions src/app/ui/error/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,23 @@ const ErrorPage = ({ reset }: FallbackErrorProps) => {
const { t } = useTranslation();
return (
<CenteredContainer>
<ErrorMessage variant={'lifiBodyLarge'}>
{t('error.message')}
</ErrorMessage>
<ErrorMessage variant={'bodyLarge'}>{t('error.message')}</ErrorMessage>
<Button
variant="primary"
onClick={() => {
trackEvent({
category: TrackingCategory.Menu,
label: 'click-discord-link',
action: TrackingAction.OpenMenu,
data: { [TrackingEventParameter.Menu]: 'lifi_discord' },
data: { [TrackingEventParameter.Menu]: 'jumper_discord' },
disableTrackingTool: [
EventTrackingTool.ARCx,
EventTrackingTool.Cookie3,
],
});
trackPageload({
source: TrackingCategory.Menu,
destination: 'discord-lifi',
destination: 'discord-jumper',
url: DISCORD_URL,
pageload: true,
disableTrackingTool: [EventTrackingTool.Cookie3],
Expand Down Expand Up @@ -80,7 +78,7 @@ const ErrorPage = ({ reset }: FallbackErrorProps) => {
: theme.palette.black.main
}
/>
<SupportMessage variant="lifiBodyMediumStrong" component="span">
<SupportMessage variant="bodyMediumStrong" component="span">
{t('navbar.navbarMenu.support')}
</SupportMessage>
</Button>
Expand Down
4 changes: 2 additions & 2 deletions src/components/AccordionFAQ/AccordionFAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const AccordionFAQ = ({ content }: AccordionFAQProps) => {
return !!content?.length ? (
<Container>
<AccordionHeader onClick={() => setShow(!show)}>
<Typography variant="lifiHeaderMedium" m={theme.spacing(2, 0)}>
<Typography variant="headerMedium" m={theme.spacing(2, 0)}>
{t('blog.faq')}
</Typography>
<AccordionToggleButton onClick={handleShowMore}>
Expand All @@ -45,7 +45,7 @@ export const AccordionFAQ = ({ content }: AccordionFAQProps) => {
aria-controls={`panel${index}a-content`}
id={`panel${index}a-header`}
>
<Typography variant="lifiBodyMediumStrong">
<Typography variant="bodyMediumStrong">
{el.attributes.Question}
</Typography>
</AccordionSummary>
Expand Down
7 changes: 3 additions & 4 deletions src/components/Alerts/InfoAlert/InfoAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import {
InfoMessageCard,
InfoMessageCardTitle,
} from '@/components/MessageCard';
import CloseIcon from '@mui/icons-material/Close';
import InfoIcon from '@mui/icons-material/Info';
import { Slide, Typography, useTheme } from '@mui/material';
import { useEffect, useState } from 'react';
import { InfoAlertButton, InfoAlertContainer } from '.';
import { InfoAlertContainer } from '.';

export interface InfoAlertProps {
title: string;
Expand Down Expand Up @@ -50,9 +49,9 @@ export const InfoAlert = ({ title, subtitle, active }: InfoAlertProps) => {
marginRight: 1,
}}
/>
<Typography variant={'lifiHeaderXSmall'}>{title}</Typography>
<Typography variant={'headerXSmall'}>{title}</Typography>
</InfoMessageCardTitle>
<Typography variant={'lifiBodySmall'} pt={theme.spacing(1.5)}>
<Typography variant={'bodySmall'} pt={theme.spacing(1.5)}>
{subtitle}
</Typography>
</InfoMessageCard>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Alerts/InfoAlert/InfoAlertClickable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import InfoIcon from '@mui/icons-material/Info';
import { Slide, Typography, useTheme } from '@mui/material';
import { useEffect, useState } from 'react';
import {
InfoAlertButton,
ButtonInfoAlertClickable,
InfoAlertButton,
InfoAlertContainer,
} from '.';

Expand Down Expand Up @@ -74,17 +74,17 @@ export const InfoAlertClickable = ({
marginRight: 1,
}}
/>
<Typography variant={'lifiHeaderXSmall'}>{title}</Typography>
<Typography variant={'headerXSmall'}>{title}</Typography>
</InfoMessageCardTitle>
<Typography
variant={'lifiBodySmall'}
variant={'bodySmall'}
pt={theme.spacing(1.5)}
color={theme.palette.mode === 'light' ? '#000000' : '#ffffff'}
>
{subtitle}
</Typography>
<ButtonInfoAlertClickable size="small">
<Typography variant={'lifiBodySmall'}>{buttonText}</Typography>
<Typography variant={'bodySmall'}>{buttonText}</Typography>
</ButtonInfoAlertClickable>
</InfoMessageCardClickable>
</a>
Expand Down
13 changes: 5 additions & 8 deletions src/components/Blog/BlogArticle/BlogArticle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const BlogArticle = ({
color={tags.data[0]?.attributes.TextColor}
backgroundColor={tags.data[0]?.attributes.BackgroundColor}
component="span"
variant="lifiBodyMediumStrong"
variant="bodyMediumStrong"
key={`blog-article-tag-${tags.data[0]?.id}`}
>
{tags.data[0].attributes?.Title}
Expand All @@ -91,7 +91,7 @@ export const BlogArticle = ({
)}
{!!createdAt ? (
<BlogArticleHeaderMeta>
<BlogArticleHeaderMetaDate variant="lifiBodyXSmall" as="span">
<BlogArticleHeaderMetaDate variant="bodyXSmall" as="span">
{formatDate(publishedAt || createdAt)}
</BlogArticleHeaderMetaDate>
<span>{t('blog.minRead', { minRead: minRead })}</span>
Expand All @@ -116,10 +116,7 @@ export const BlogArticle = ({
<BlogAuthorAvatarSkeleton variant="rounded" />
)}
{author?.data ? (
<BlogArticlAuthorName
variant="lifiBodyXSmallStrong"
component="span"
>
<BlogArticlAuthorName variant="bodyXSmallStrong" component="span">
{author.data?.attributes.Name}
</BlogArticlAuthorName>
) : (
Expand All @@ -141,7 +138,7 @@ export const BlogArticle = ({
<BlogArticleContainer>
<BlogArticleContentContainer>
{subtitle ? (
<BlogArticleSubtitle variant="lifiHeaderMedium" as="h4">
<BlogArticleSubtitle variant="headerMedium" as="h4">
{subtitle}
</BlogArticleSubtitle>
) : (
Expand Down Expand Up @@ -181,7 +178,7 @@ export const BlogArticle = ({
<BlogArticlAuthorNameSkeleton variant="text" />
)}
{author?.data ? (
<BlogArticlAuthorRole variant="lifiBodyXSmall" component="span">
<BlogArticlAuthorRole variant="bodyXSmall" component="span">
{author.data.attributes?.Role}
</BlogArticlAuthorRole>
) : (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Blog/BlogArticle/ShareArticleIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const ShareArticleIcon = ({
<ShareButton onClick={handleShare} expanded={showMsgActive}>
{icon}
{showMsgActive && (
<Typography variant="lifiBodySmall" marginLeft={1} marginRight={1}>
<Typography variant="bodySmall" marginLeft={1} marginRight={1}>
{showMsg}
</Typography>
)}
Expand Down
8 changes: 4 additions & 4 deletions src/components/Blog/BlogArticleCard/BlogArticleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,20 @@ export const BlogArticleCard = ({
)}

<BlogArticleCardContent>
<BlogArticleCardTitle variant="lifiBodyLarge">
<BlogArticleCardTitle variant="bodyLarge">
{title}
</BlogArticleCardTitle>
<BlogArticleCardDetails>
{tags?.data.slice(0, 1).map((tag, index) => (
<BlogArticleCardTag key={index} variant="lifiBodyXSmall" as="h3">
<BlogArticleCardTag key={index} variant="bodyXSmall" as="h3">
{tag.attributes.Title}
</BlogArticleCardTag>
))}
<BlogArticleCardMetaContainer>
<BlogArticleMetaDate variant="lifiBodyXSmall" as="span">
<BlogArticleMetaDate variant="bodyXSmall" as="span">
{formatDate(publishedAt || createdAt)}
</BlogArticleMetaDate>
<BlogArticleMetaReadingTime variant="lifiBodyXSmall" as="span">
<BlogArticleMetaReadingTime variant="bodyXSmall" as="span">
{t('blog.minRead', { minRead: minRead })}
</BlogArticleMetaReadingTime>
</BlogArticleCardMetaContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const BlogArticlesBoard = ({

return (
<BlogArticlesBoardContainer id="see-all">
<BlogArticlesBoardTitle variant="lifiHeaderMedium">
<BlogArticlesBoardTitle variant="headerMedium">
{t('blog.categories')}
</BlogArticlesBoardTitle>
{filteredTags ? (
Expand Down
5 changes: 1 addition & 4 deletions src/components/Blog/BlogArticlesBoard/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ export const BlogArticlesBoardPagination = ({
onClick={() => handlePage(actualPage)}
active={actualPage === page}
>
<Typography
variant="lifiBodySmallStrong"
sx={{ lineHeight: '18px' }}
>
<Typography variant="bodySmallStrong" sx={{ lineHeight: '18px' }}>
{actualPage}
</Typography>
</PaginationIndexButton>
Expand Down
4 changes: 1 addition & 3 deletions src/components/Blog/BlogCarousel/CarouselContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ export const CarouselContainer = ({
return (
<Box>
<CarouselHeader>
{title && (
<CarouselTitle variant="lifiHeaderMedium">{title}</CarouselTitle>
)}
{title && <CarouselTitle variant="headerMedium">{title}</CarouselTitle>}
{Array.isArray(children) && children?.length > 1 && (
<CarouselNavigationContainer hide={children?.length < 4}>
<CarouselNavigationButton onClick={() => handleChange('prev')}>
Expand Down
Loading