Skip to content

Commit

Permalink
chore: merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tche authored and tche committed Dec 26, 2024
2 parents e16840a + 177b574 commit 5c84941
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 8 deletions.
Binary file removed bun.lockb
Binary file not shown.
8 changes: 5 additions & 3 deletions src/app/[lng]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type { ActiveThemeResult } from '../lib/getActiveTheme';
import { getActiveTheme } from '../lib/getActiveTheme';
import { description, siteName, title } from '../lib/metadata';
import { getSiteUrl } from '@/const/urls';
import ForceReloadOnUpdate from '@/components/ForceReloadOnUpdate';
import { Banner } from 'src/components/Banner/Banner';

export const metadata: Metadata = {
title,
Expand Down Expand Up @@ -181,8 +181,10 @@ export default async function RootLayout({
<SettingsStoreProvider
welcomeScreenClosed={welcomeScreenClosed}
>
<ForceReloadOnUpdate />
<WalletProvider>{children}</WalletProvider>
<WalletProvider>
<Banner />
{children}
</WalletProvider>
</SettingsStoreProvider>
</ThemeProvider>
</NextThemeProvider>
Expand Down
20 changes: 20 additions & 0 deletions src/components/Banner/Banner.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Box, darken, lighten, styled } from '@mui/material';

export const BannerContainer = styled(Box)(({ theme }) => ({
flex: 1,
display: 'flex',
justifyContent: 'center',
textAlign: 'center',
alignItems: 'center',
width: '100%',
padding: '10px',
background: theme.palette.mode === 'dark' ? '#30007A' : '#CEADFF',
fontWeight: 700,
cursor: 'pointer',
':hover': {
backgroundColor:
theme.palette.mode === 'dark'
? lighten('#30007A', 0.04)
: darken('#CEADFF', 0.04),
},
}));
80 changes: 80 additions & 0 deletions src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
'use client';
import { Theme, Typography, useMediaQuery, useTheme } from '@mui/material';
import Image from 'next/image';
import { BannerContainer } from './Banner.style';
import { useUserTracking } from 'src/hooks/userTracking';
import {
TrackingAction,
TrackingCategory,
TrackingEventParameter,
} from '@/const/trackingKeys';

export const Banner = () => {
const theme = useTheme();
const { trackEvent } = useUserTracking();

const handleClick = () => {
trackEvent({
category: TrackingCategory.Banner,
action: TrackingAction.ClickBanner,
label: 'click-banner-cta',
data: {
[TrackingEventParameter.ActiveCampaign]: 'wrapped-2024',
},
});
};

const isSmallScreen = useMediaQuery((theme: Theme) =>
theme.breakpoints.down('md'),
);

return (
<a
href="https://wrapped.jumper.exchange"
target="_blank"
style={{ textDecoration: 'none', color: 'inherit' }}
>
<BannerContainer onClick={handleClick}>
<Image
alt="jumper-logo"
width={24}
height={24}
style={{ marginRight: 8 }}
src={
theme.palette.mode === 'dark'
? 'https://strapi.jumper.exchange/uploads/jumper_04f15d06be.svg'
: 'https://strapi.jumper.exchange/uploads/jumper_57348536c0.svg'
}
/>
<Typography
color={
theme.palette.mode === 'dark'
? '#FFFFFFD6'
: theme.palette.accent1.main
}
sx={{
fontSize: '16px',
fontWeight: 700,
lineHeight: '20px',
}}
>
{' '}
{isSmallScreen
? 'Your 2024 Jumper Wrapped is here'
: 'Your 2024 Jumper Wrapped is here. Wrap your year'}{' '}
</Typography>
<Image
alt="arrow-icon"
width={24}
height={24}
style={{ marginLeft: 8 }}
src={
theme.palette.mode === 'dark'
? 'https://strapi.jumper.exchange/uploads/button_darkl_70bedec2df.svg'
: 'https://strapi.jumper.exchange/uploads/theme_c92ac9f474.svg'
}
/>
</BannerContainer>
</a>
);
};
2 changes: 1 addition & 1 deletion src/components/Menus/MainMenu/useMainMenuContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
JUMPER_LEARN_PATH,
JUMPER_LOYALTY_PATH,
JUMPER_SCAN_PATH,
JUMPER_WASH_PATH,
X_URL,
} from '@/const/urls';
import { useUserTracking } from '@/hooks/userTracking/useUserTracking';
Expand All @@ -24,6 +23,7 @@ import DeveloperModeIcon from '@mui/icons-material/DeveloperMode';
import LanguageIcon from '@mui/icons-material/Language';
import PetsIcon from '@mui/icons-material/Pets';
import SchoolIcon from '@mui/icons-material/School';
import ViewCarouselIcon from '@mui/icons-material/ViewCarousel';
import SearchOutlinedIcon from '@mui/icons-material/SearchOutlined';
import XIcon from '@mui/icons-material/X';
import { Typography } from '@mui/material';
Expand Down
2 changes: 0 additions & 2 deletions src/components/Widgets/Widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,9 @@ export function Widget({
},
bridges: {
allow: configTheme?.allowedBridges,
deny: ['allbridge', 'celerim', 'squid'],
},
exchanges: {
allow: configTheme?.allowedExchanges,
deny: ['bebop', 'paraswap', '0x'],
},
languages: {
default: i18n.language as LanguageKey,
Expand Down
7 changes: 7 additions & 0 deletions src/const/trackingKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export enum TrackingAction {
JoinDiscordCommunity = 'action_join_discord_community',
OpenDiscordSupport = 'action_open_discord_support',
PoweredBy = 'action_click_powered_by',

//Banner
ClickBanner = 'action_click_banner',
}

export enum TrackingCategory {
Expand Down Expand Up @@ -108,6 +111,7 @@ export enum TrackingCategory {
BlogArticle = 'cat_blog_article',
Missions = 'cat_missions',
Quests = 'cat_quests',
Banner = 'cat_banner',
}

// can be used as custom dimensions / metrics
Expand Down Expand Up @@ -223,4 +227,7 @@ export enum TrackingEventParameter {
SearchFirstResultName = 'param_search_first_result_name',
SearchFirstResultSymbol = 'param_search_first_result_symbol',
SearchFirstResultChainId = 'param_search_first_result_chain_id',

//Banner
ActiveCampaign = 'param_banner_campaign',
}
2 changes: 2 additions & 0 deletions src/hooks/useStrapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ export const useStrapi = <T>({
// show drafts ONLY on development env
process.env.NEXT_PUBLIC_ENVIRONMENT === 'development' &&
apiUrl.searchParams.set('publicationState', 'preview');
process.env.NEXT_PUBLIC_ENVIRONMENT === 'development' &&
apiUrl.searchParams.set('pagination[pageSize]', '50');

// use local strapi on develop || prod strapi
const apiAccesToken =
Expand Down
2 changes: 1 addition & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ export function middleware(request: NextRequest) {
// Applies this middleware only to specific paths
export const config = {
matcher:
'/((?!api|static|_next|favicon\\.ico|.*\\.(?:png|jp?eg|gif|webp|svg|ico|riv)).*)',
'/((?!api|static|_next|favicon\\.ico|.*\\.(?:png|jp?eg|gif|webp|svg|ico|xml|txt|riv)).*)',
};
2 changes: 1 addition & 1 deletion tests/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test.describe('Jumper full e2e flow', () => {
page,
}) => {
await openOrCloseMainMenu(page);
await checkTheNumberOfMenuItems(page, 9);
await checkTheNumberOfMenuItems(page, 10);
await page.locator('body').click();
await expect(page.getByRole('menu')).not.toBeVisible();
});
Expand Down

0 comments on commit 5c84941

Please sign in to comment.