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: Adding berachain #1520

Open
wants to merge 45 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9f29a82
chore: wip berachain
dennyscode Nov 14, 2024
6895bf7
Merge branch 'develop' into LF-10392-jumper-implement-first-ui-for-be…
dennyscode Nov 14, 2024
1f1e4d1
chore: styling, pages, ...
dennyscode Nov 18, 2024
c300a76
chore: add berachain markets header
dennyscode Nov 18, 2024
ce0536d
chore: tooltip, pages, cleanup
dennyscode Nov 19, 2024
972aa70
fix: key errors
dennyscode Nov 19, 2024
b9a40c2
Merge branch 'develop' into LF-10392-jumper-implement-first-ui-for-be…
dennyscode Nov 19, 2024
ac6526a
fix: errors
dennyscode Nov 19, 2024
b65ef99
style: adjustments
dennyscode Nov 19, 2024
e609a87
chore: protocol explore page + styles
dennyscode Nov 19, 2024
12f9048
style: filter layout
dennyscode Nov 19, 2024
603843c
style: berachain animation hero
dennyscode Nov 21, 2024
85da1dc
chore: cleanup and styling
dennyscode Nov 21, 2024
3c6e0ac
chore: cleanup and use strapi
dennyscode Nov 26, 2024
a33cc46
style: animations
dennyscode Nov 26, 2024
2cfeb96
chore: adjustments
dennyscode Nov 27, 2024
eb7913b
fix: default loading state with 9 cards
dennyscode Nov 27, 2024
6a69a5a
style: animation delay reduced
dennyscode Nov 27, 2024
4df9c84
chore: more fixes, dynamic stars, texts, icon size,..
dennyscode Nov 27, 2024
de32f76
chore: text adjustments
dennyscode Nov 27, 2024
d8126ca
automatic push
tcheee Nov 27, 2024
5ebaab7
Merge branch 'develop' into LF-10392-jumper-implement-first-ui-for-be…
dennyscode Nov 28, 2024
b1b5cb6
automatic push
tcheee Nov 28, 2024
6466c0a
Merge branch 'LF-10392-jumper-implement-first-ui-for-berachain' of ht…
tcheee Nov 28, 2024
f4650ff
automatic push
tcheee Nov 28, 2024
0256167
automatic push
tcheee Nov 28, 2024
565c999
automatic push
tcheee Nov 28, 2024
0998f2d
automatic push
tcheee Nov 28, 2024
97919bd
automatic push
tcheee Nov 28, 2024
658e970
automatic push
tcheee Nov 28, 2024
384faca
automatic push
tcheee Nov 28, 2024
f9b4caf
automatic push
tcheee Nov 28, 2024
d381176
automatic push
tcheee Nov 28, 2024
dcb97a5
automatic push
tcheee Nov 28, 2024
98f7537
automatic push
tcheee Nov 28, 2024
c44daab
automatic push
tcheee Nov 28, 2024
3c84c93
automatic push
tcheee Nov 28, 2024
cfa98fb
automatic push
tcheee Nov 28, 2024
2f3cbd8
chore: wip zap page
dennyscode Dec 3, 2024
3b63532
style: adjust colors
dennyscode Dec 3, 2024
a0668e2
Merge branch 'LF-11136-jumper-create-react-components-to-use-the-zap-…
dennyscode Dec 4, 2024
bed1cc5
chore: revive custom widget
dennyscode Dec 5, 2024
200fde5
Merge branch 'develop' into LF-10392-jumper-implement-first-ui-for-be…
dennyscode Dec 5, 2024
9bf8126
Merge branch 'develop' into LF-10392-jumper-implement-first-ui-for-be…
dennyscode Dec 6, 2024
9339c79
Merge branch 'develop' into LF-10392-jumper-implement-first-ui-for-be…
dennyscode Dec 9, 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"fontaine": "^0.5.0",
"graphql": "^16.9.0",
"graphql-request": "^7.1.2",
"gsap": "^3.12.5",
"i18next": "^23.16.5",
"i18next-resources-for-ts": "^1.5.0",
"i18next-resources-to-backend": "^1.2.1",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions public/berachain/berachain-asteroid-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions public/berachain/berachain-asteroid-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-bear-chillin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-bear-loves-honey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-bear-typing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-bear-w-glow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-brand-logo-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-brand-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-brand-orange-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-default-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-icon-chain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
259 changes: 259 additions & 0 deletions public/berachain/berachain-lunar-crater-resize-raw.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/berachain/berachain-lunar-crater-resize.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/berachain/berachain-lunar-crater.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/berachain/berachain-moon-surface.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-navbar-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-orange-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-planet-ground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/berachain-stars-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/berachain/gift.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/berachain/sir-bridgealot-w-glow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/berachain/tvl.svg
65 changes: 65 additions & 0 deletions src/app/[lng]/berachain/explore/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { type Metadata } from 'next';
import { siteName } from 'src/app/lib/metadata';
import BerachainExplorePage from 'src/app/ui/berachain/BerachainExplorePage';
import { berachainMarkets } from 'src/components/Berachain/const/berachainExampleData';
import { getSiteUrl } from 'src/const/urls';
import { sliceStrToXChar } from 'src/utils/splitStringToXChar';

export async function generateMetadata({
params,
}: {
params: { slug: string };
}): Promise<Metadata> {
try {
const beraMarket = await berachainMarkets.filter(
(market) => market.protocol.slug === params.slug,
);

if (!beraMarket) {
throw new Error();
}

const openGraph: Metadata['openGraph'] = {
title: 'Jumper | Berachain',
description: 'Dive into the Berachain universe!',
siteName: siteName,
url: `${getSiteUrl()}/berachain/explore/${params.slug}`,
// images: [
// {
// url: `${article.url}${articleData.Image.data.attributes?.url}`,
// width: 900,
// height: 450,
// alt: 'banner image',
// },
// ],
// type: 'article',
};

return {
title: `Jumper Learn | ${sliceStrToXChar(beraMarket[0].protocol.name, 45)}`,
description: `Description of ${beraMarket[0].protocol.name}`,
alternates: {
canonical: `${getSiteUrl()}/berachain/explore/${params.slug}`,
},
twitter: openGraph,
openGraph,
};
} catch (err) {
return {
title: `Jumper Learn | ${sliceStrToXChar(params.slug.replaceAll('-', ' '), 45)}`,
description: `This is the description for the article "${params.slug.replaceAll('-', ' ')}".`,
};
}
}

export default async function Page({ params }: { params: { slug: string } }) {
const berachainProtocol = await berachainMarkets.filter(
(market) => market.protocol.slug === params.slug,
);

return (
<BerachainExplorePage
market={berachainProtocol.length > 0 ? berachainProtocol[0] : undefined}
/>
);
}
14 changes: 14 additions & 0 deletions src/app/[lng]/berachain/explore/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { type Metadata } from 'next';
import BerachainExploreMarketsPage from 'src/app/ui/berachain/BerachainExploreMarketPage';

export const metadata: Metadata = {
title: 'Jumper | Berachain',
description: 'Dive into the Berachain universe!',
alternates: {
canonical: `${process.env.NEXT_PUBLIC_SITE_URL}/berachain`,
},
};

export default async function Page() {
return <BerachainExploreMarketsPage />;
}
13 changes: 13 additions & 0 deletions src/app/[lng]/berachain/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Metadata } from 'next';
import type { PropsWithChildren } from 'react';
import { Layout } from 'src/Layout';

export const metadata: Metadata = {
other: {
'partner-theme': 'berachain',
},
};

export default async function BeraChainLayout({ children }: PropsWithChildren) {
return <Layout>{children}</Layout>;
}
14 changes: 14 additions & 0 deletions src/app/[lng]/berachain/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { type Metadata } from 'next';
import BerachainPage from 'src/app/ui/berachain/BerachainPage';

export const metadata: Metadata = {
title: 'Jumper | Berachain',
description: 'Dive into the Berachain universe!',
alternates: {
canonical: `${process.env.NEXT_PUBLIC_SITE_URL}/berachain`,
},
};

export default async function Page() {
return <BerachainPage />;
}
8 changes: 8 additions & 0 deletions src/app/ui/berachain/BerachainExploreMarketPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use client';
import { BerachainExplore } from 'src/components/Berachain/BerachainExplore';

const BerachainExploreMarketsPage = () => {
return <BerachainExplore />;
};

export default BerachainExploreMarketsPage;
13 changes: 13 additions & 0 deletions src/app/ui/berachain/BerachainExplorePage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use client';
import { BerachainExploreProtocol } from 'src/components/Berachain/BerachainExploreProtocol';
import type { BerachainMarketType } from 'src/components/Berachain/const/berachainExampleData';

interface BerachainExplorePageProps {
market?: BerachainMarketType;
}

const BerachainExplorePage = ({ market }: BerachainExplorePageProps) => {
return <BerachainExploreProtocol market={market} />;
};

export default BerachainExplorePage;
8 changes: 8 additions & 0 deletions src/app/ui/berachain/BerachainPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use client';
import { Berachain } from 'src/components/Berachain/Berachain';

const BerachainPage = () => {
return <Berachain />;
};

export default BerachainPage;
136 changes: 96 additions & 40 deletions src/components/AccordionFAQ/AccordionFAQ.style.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import type { AccordionProps as MuiAccordionProps } from '@mui/material';
import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
import type { BoxProps } from '@mui/material';
import {
Box,
Container,
Divider,
IconButton,
Accordion as MuiAccordion,
AccordionDetails as MuiAccordionDetails,
AccordionSummary as MuiAccordionSummary,
Typography,
type Breakpoint,
} from '@mui/material';

import { styled } from '@mui/material/styles';
import { alpha, keyframes, styled } from '@mui/material/styles';

export const AccordionContainer = styled(Container)(({ theme }) => ({
export const AccordionBox = styled(Box)(({ theme }) => ({
margin: 'auto',
marginTop: theme.spacing(4),
padding: theme.spacing(1, 2),
// marginTop: theme.spacing(4),
// padding: theme.spacing(1, 2),
borderRadius: '8px',
background: theme.palette.surface1.main,
position: 'relative',
maxWidth: theme.breakpoints.values.md,
width: '100% !important',
Expand All @@ -25,51 +26,89 @@ export const AccordionContainer = styled(Container)(({ theme }) => ({
? '0px 2px 4px rgba(0, 0, 0, 0.04), 0px 8px 16px rgba(0, 0, 0, 0.08)'
: '0px 2px 4px rgba(0, 0, 0, 0.04), 0px 8px 16px rgba(0, 0, 0, 0.04)',

'&:before': {
content: '" "',
zIndex: '-1',
position: 'absolute',
top: 0,
right: 0,
bottom: 0,
left: 0,
background: 'linear-gradient(to top left, #fff 0%, #fff 100% )',
filter: 'blur(20px)',
opacity: 'var(0.7)',
transition: 'opacity 0.3s',
},
[theme.breakpoints.up('sm' as Breakpoint)]: {
width: theme.breakpoints.values.md,
maxWidth: theme.breakpoints.values.md,
},
}));

export interface AccordionProps extends Omit<MuiAccordionProps, 'component'> {
interface FaqShowMoreArrowProps {
arrowSize?: number;
}

export const rotateAnimation = keyframes`
from {
transform: rotate(0deg);
}
to {
transform: rotate(180deg);
}
`;

export const FaqShowMoreArrow = styled(ArrowForwardIosIcon, {
shouldForwardProp: (prop) => prop !== 'arrowSize',
})<FaqShowMoreArrowProps>(({ arrowSize }) => ({
width: arrowSize || 24,
height: arrowSize || 24,
transition: 'transform 0.3s ease',
transform: 'rotate(90deg)',
}));

export interface AccordionItemWrapperProps extends BoxProps {
show?: boolean;
}

export const Accordion = styled(MuiAccordion, {
shouldForwardProp: (prop) => prop !== 'backgroundImageUrl',
})<AccordionProps>(({ theme, show }) => ({
background: 'transparent',
visibility: show ? 'visible' : 'hidden',
height: show ? 'auto' : 0,
export const AccordionItemWrapper = styled(Box)<AccordionItemWrapperProps>(
({ theme }) => ({
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
gap: theme.spacing(2),
}),
);

export const Accordion = styled(MuiAccordion)(({ theme, sx }) => ({
fontFamily: 'inherit',
borderRadius: '16px',
padding: theme.spacing(2, 3),
width: '100%',
background: alpha(theme.palette.text.primary, 0.08),
minHeight: 64,
transition: 'background-color 300ms ease-in-out',
// visibility: show ? 'visible' : 'hidden',
// height: show ? 'auto' : 0,
'&:last-of-type': {
marginBottom: show ? theme.spacing(2) : 0,
borderRadius: '16px',
},

'&:hover': {
background: alpha(theme.palette.text.primary, 0.16),
},
}));

export const AccordionDetails = styled(MuiAccordionDetails)<AccordionProps>(
() => ({
'& > img': { width: '100%' },
}),
);
export const AccordionDetails = styled(MuiAccordionDetails)(() => ({
'& > img': { width: '100%' },
}));

export const AccordionTitle = styled(Typography)(({ theme }) => ({
color: theme.palette.text.primary,
margin: theme.spacing(2, 'auto'),
marginBottom: theme.spacing(4),
textAlign: 'center',
}));

export const AccordionToggleButton = styled(IconButton)(({ theme }) => ({
width: 42,
height: 42,
color:
theme.palette.mode === 'dark' ? theme.palette.white.main : 'currentColor',
background: alpha(theme.palette.text.primary, 0.08),
color: theme.palette.text.primary,
transition: 'background-color 300ms ease-in-out',
width: 32,
height: 32,
backgroundColor: alpha(theme.palette.text.primary, 0.08),

'&:hover': {
color: theme.palette.text.primary,
background: alpha(theme.palette.text.primary, 0.16),
},
}));

export const AccordionHeader = styled(Box)(() => ({
Expand All @@ -79,7 +118,24 @@ export const AccordionHeader = styled(Box)(() => ({
}));

export const AccordionDivider = styled(Divider)(({ theme }) => ({
...(theme.palette.mode === 'dark' && {
borderColor: theme.palette.grey[200],
}),
borderColor: alpha(theme.palette.text.primary, 0.08),
}));

export const AccordionSummary = styled(MuiAccordionSummary)(({ theme }) => ({
minHeight: 'inherit',
'& .MuiAccordionSummary-content': {
alignItems: 'center',
gap: theme.spacing(1.5),
},
}));

export const AccordionIndex = styled(Box)(({ theme }) => ({
borderRadius: '16px',
height: 32,
width: 32,
flexShrink: 0,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
background: alpha(theme.palette.text.primary, 0.08),
}));
Loading