Skip to content

Commit

Permalink
Merge branch 'develop' into feat/add-tests-github-action
Browse files Browse the repository at this point in the history
  • Loading branch information
oktapodia authored May 21, 2024
2 parents b08f4da + 1ece110 commit b7cdd0c
Show file tree
Hide file tree
Showing 30 changed files with 122 additions and 228 deletions.
4 changes: 2 additions & 2 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const nextConfig = {
'.js': ['.ts', '.tsx', '.js', '.jsx'],
};
config.resolve.fallback = { fs: false, net: false, tls: false };
config.externals.push('pino-pretty', 'lokijs', 'encoding');
// config.externals.push('pino-pretty');
// Walletconnect configuration is blocking the build, pino-pretty needs to be added as an external
config.externals.push('pino-pretty');
return config;
},
images: {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"graphql": "^16.8.1",
"graphql-request": "^6.1.0",
"i18next": "^23.11.2",
"i18next-browser-languagedetector": "^7.2.1",
"i18next-resources-for-ts": "^1.5.0",
"i18next-resources-to-backend": "^1.2.1",
"next": "^14.2.3",
Expand Down
18 changes: 0 additions & 18 deletions src/app/[lng]/(exchange)/exchange/page.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions src/app/[lng]/(exchange)/swap/page.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions src/app/[lng]/(refuel)/gas/page.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions src/app/[lng]/(refuel)/refuel/page.tsx

This file was deleted.

13 changes: 1 addition & 12 deletions src/app/[lng]/buy/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
import { getCookies } from '@/app/lib/getCookies';
import App from '@/app/ui/app/App';

export const dynamic = 'force-dynamic';

const Page = async () => {
const { activeTheme, welcomeScreenClosed } = getCookies();

return (
<App
starterVariant="buy"
activeTheme={activeTheme}
welcomeScreenClosedCookie={welcomeScreenClosed === 'true' ? true : false}
/>
);
return <App starterVariant="buy" />;
};

export default Page;
7 changes: 7 additions & 0 deletions src/app/[lng]/exchange/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import App from '@/app/ui/app/App';

const Page = async () => {
return <App starterVariant="default" />;
};

export default Page;
12 changes: 1 addition & 11 deletions src/app/[lng]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { AppProvider } from '@/providers/AppProvider';
import i18nConfig from 'i18nconfig';
import React from 'react';
import { namespaces } from 'src/i18n';
import initTranslations from '../i18n';
import { getCookies } from '../lib/getCookies';

export default async function RootLayout({
children,
Expand All @@ -13,14 +10,7 @@ export default async function RootLayout({
params: { lng: string };
req: any;
}) {
const { resources } = await initTranslations(lng, namespaces);
const { activeTheme } = getCookies();

return (
<AppProvider i18nResources={resources} lang={lng} theme={activeTheme}>
{children}
</AppProvider>
);
return <AppProvider lang={lng}>{children}</AppProvider>;
}

export function generateStaticParams() {
Expand Down
12 changes: 1 addition & 11 deletions src/app/[lng]/memecoins/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { getCookies } from '@/app/lib/getCookies';
import App from '@/app/ui/app/App';

export const dynamic = 'force-dynamic';

const Page = () => {
const { activeTheme } = getCookies();

return (
<App
starterVariant="default"
activeTheme={activeTheme}
welcomeScreenClosedCookie={true}
/>
);
return <App starterVariant="default" />;
};

export default Page;
13 changes: 1 addition & 12 deletions src/app/[lng]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
import { getCookies } from '../lib/getCookies';
import App from '../ui/app/App';

export const dynamic = 'force-dynamic';

export default function Page() {
const { activeTheme, welcomeScreenClosed } = getCookies();

return (
<App
starterVariant="default"
activeTheme={activeTheme}
welcomeScreenClosedCookie={welcomeScreenClosed === 'true' ? true : false}
/>
);
return <App starterVariant="default" />;
}
7 changes: 7 additions & 0 deletions src/app/[lng]/refuel/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import App from '@/app/ui/app/App';

const Page = async () => {
return <App starterVariant="refuel" />;
};

export default Page;
3 changes: 0 additions & 3 deletions src/app/page.tsx

This file was deleted.

18 changes: 8 additions & 10 deletions src/app/ui/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,26 @@ import { Snackbar } from '@/components/Snackbar/Snackbar';
import { WelcomeScreen } from '@/components/WelcomeScreen/WelcomeScreen';
import { Widgets } from '@/components/Widgets/Widgets';
import type { StarterVariantType } from '@/types/internal';
import type { ThemeModesSupported } from '@/types/settings';
import { getCookies } from '@/app/lib/getCookies';
export interface AppProps {
starterVariant: StarterVariantType;
activeTheme: ThemeModesSupported | undefined;
welcomeScreenClosedCookie: boolean;
}

const App = ({
starterVariant,
activeTheme,
welcomeScreenClosedCookie,
}: AppProps) => {
const App = ({ starterVariant }: AppProps) => {
const { activeTheme, welcomeScreenClosed } = getCookies();
const isWelcomeScreenClosed = welcomeScreenClosed === 'true';

return (
<>
<WelcomeScreen closed={welcomeScreenClosedCookie} />
<WelcomeScreen closed={isWelcomeScreenClosed} />
<Widgets
widgetVariant={starterVariant}
activeTheme={activeTheme}
closedWelcomeScreen={welcomeScreenClosedCookie}
closedWelcomeScreen={isWelcomeScreenClosed}
/>
<FeatureCards />
<Snackbar />
<PixelBg />
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const parseTitle = (title: string, link: { label: string; url: string }) => {
cleanText += `<a href="${link.url}" target="${!link.url.includes('jumper.exchange') || link.url[0] === '/' ? '_self' : '_blank'}">${link.label}</a>`;
}
}
return null;
});
return cleanText;
};
Expand Down
5 changes: 1 addition & 4 deletions src/components/Menus/MainMenu/useMainMenuContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
EXPLORER_URL,
JUMPER_LEARN_PATH,
JUMPER_LOYALTY_PATH,
JUMPER_MEMECOIN_PATH,
X_URL,
} from '@/const/urls';
import { useUserTracking } from '@/hooks/userTracking/useUserTracking';
Expand All @@ -25,12 +24,11 @@ import AccountCircleIcon from '@mui/icons-material/AccountCircle';
import DeveloperModeIcon from '@mui/icons-material/DeveloperMode';
import LanguageIcon from '@mui/icons-material/Language';
import SchoolIcon from '@mui/icons-material/School';
import WhatshotIcon from '@mui/icons-material/Whatshot';
import SearchOutlinedIcon from '@mui/icons-material/SearchOutlined';
import XIcon from '@mui/icons-material/X';
import { Typography } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import { usePathname, useRouter } from 'next/navigation';
import { useRouter } from 'next/navigation';
import { useTranslation } from 'react-i18next';
import { useThemeSwitchTabs } from './useThemeSwitchTabs';

Expand All @@ -46,7 +44,6 @@ export const useMainMenuContent = () => {
utm_campaign: 'jumper_to_explorer',
utm_medium: 'menu',
});
const pathname = usePathname();

const themeSwitchTabs = useThemeSwitchTabs();

Expand Down
2 changes: 1 addition & 1 deletion src/components/ProfilePage/LevelBox/TierBox.style.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { alpha, type Breakpoint } from '@mui/material';
import { alpha } from '@mui/material';
import { Box, styled } from '@mui/system';

export const TierMainBox = styled(Box)(({ theme }) => ({
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProfilePage/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ProfilePage = () => {
const { account } = useAccounts();
const { isLoading, points, tier, pdas } = useLoyaltyPass();
const { imageLink } = useMercleNft({ userAddress: account?.address });
const { quests } = useOngoingQuests();
const { quests, isQuestLoading } = useOngoingQuests();

return (
<ProfilePageContainer className="profile-page">
Expand All @@ -38,7 +38,7 @@ export const ProfilePage = () => {
<TierBox points={points} tier={tier} loading={isLoading} />
</ProfilePageHeaderBox>
</Stack>
<QuestCarousel quests={quests} />
<QuestCarousel quests={quests} loading={isQuestLoading} />
<QuestCompletedList pdas={pdas} loading={isLoading} />
</Stack>
</ProfilePageContainer>
Expand Down
33 changes: 10 additions & 23 deletions src/components/ProfilePage/QuestCard/VoidQuestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,16 @@ export const VoidQuestCard = ({ connected }: VoidQuestCardProps) => {
: alpha(theme.palette.white.main, 0.08),
}}
>
{connected ? (
<EmojiEventsIcon
sx={{
height: '64px',
width: '64px',
color:
theme.palette.mode === 'light'
? theme.palette.grey[400]
: alpha(theme.palette.grey[400], 0.08),
}}
/>
) : (
<QuestionMarkIcon
sx={{
height: '96px',
width: '96px',
color:
theme.palette.mode === 'light'
? theme.palette.grey[400]
: alpha(theme.palette.grey[400], 0.08),
}}
/>
)}
<QuestionMarkIcon
sx={{
height: '96px',
width: '96px',
color:
theme.palette.mode === 'light'
? theme.palette.grey[400]
: alpha(theme.palette.grey[400], 0.08),
}}
/>
</Box>
);
};
Loading

0 comments on commit b7cdd0c

Please sign in to comment.