-
Notifications
You must be signed in to change notification settings - Fork 0
feat(frontend): pnk-token-page #29
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
STRAPI_TOKEN= | ||
STRAPI_URL= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ yarn-debug.log* | |
yarn-error.log* | ||
|
||
# local env files | ||
.env | ||
.env*.local | ||
|
||
# vercel | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import Image from "next/image"; | ||
|
||
import Divider from "./Divider"; | ||
import ExternalLink from "./ExternalLink"; | ||
|
||
export interface ICtaCard { | ||
icon: { | ||
url: string; | ||
}; | ||
title: string; | ||
description: string; | ||
arrowLink: { | ||
text: string; | ||
link: { | ||
url: string; | ||
}; | ||
}; | ||
} | ||
|
||
const CtaCard: React.FC<ICtaCard> = ({ | ||
icon, | ||
title, | ||
description, | ||
arrowLink, | ||
}) => { | ||
return ( | ||
<div className="flex flex-col items-start border border-stroke rounded-2xl p-6"> | ||
<Image | ||
width={90} | ||
height={90} | ||
src={icon.url} | ||
className="object-contain mb-4" | ||
alt="Icon" | ||
/> | ||
<h2 className="text-xl text-primary-text font-medium mb-6">{title}</h2> | ||
<p className="text-lg text-secondary-text mb-6">{description}</p> | ||
<Divider /> | ||
<ExternalLink | ||
text={arrowLink.text} | ||
url={arrowLink.link.url} | ||
className="mt-6 mb-4" | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CtaCard; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const Divider: React.FC = () => ( | ||
<div className="w-full border border-stroke"></div> | ||
); | ||
export default Divider; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React, { HTMLAttributes } from "react"; | ||
|
||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
|
||
import LinkArrow from "@/assets/svgs/icons/link-arrow.svg"; | ||
|
||
interface IExternalLink { | ||
text: string; | ||
url: string; | ||
className?: HTMLAttributes<HTMLDivElement>["className"] | ||
} | ||
const ExternalLink: React.FC<IExternalLink> = ({ text, url, className }) => { | ||
return ( | ||
<Link | ||
href={url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className={`flex gap-4 items-center hover:brightness-[1.2] ${className}`} | ||
> | ||
<span className="text-lg text-primary-blue text-center">{text}</span> | ||
<Image | ||
src={LinkArrow} | ||
width="24" | ||
height="24" | ||
alt="Arrow link image" | ||
className="inline" | ||
/> | ||
</Link> | ||
); | ||
}; | ||
export default ExternalLink; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Exchange } from "@/queries/pnk-token/token-buy"; | ||
import { hoverEffect } from "@/styles"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
|
||
interface IExchanges { | ||
exchanges: Exchange[]; | ||
} | ||
|
||
const Exchanges: React.FC<IExchanges> = ({ exchanges }) => { | ||
return ( | ||
<div className="w-full flex flex-wrap justify-center gap-6 md:gap-16 lg:gap-20 mb-8 md:mb-0"> | ||
{exchanges.map((exchange) => ( | ||
<Link | ||
href={exchange.url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
key={exchange.name} | ||
> | ||
<Image | ||
width={64} | ||
height={64} | ||
src={exchange.icon.url} | ||
alt={exchange.name} | ||
className={hoverEffect} | ||
/> | ||
</Link> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Exchanges; |
25 changes: 25 additions & 0 deletions
25
frontend/src/components/PNKToken/BuySection/FeaturedExchange.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
|
||
import { Exchange } from "@/queries/pnk-token/token-buy"; | ||
import clsx from "clsx"; | ||
import { hoverEffect } from "@/styles"; | ||
|
||
interface IFeaturedExchange { | ||
exchange: Exchange; | ||
} | ||
const FeaturedExchange: React.FC<IFeaturedExchange> = ({ exchange }) => { | ||
return ( | ||
<Link href={exchange.url} target="_blank" rel="noopener noreferrer"> | ||
<div className={clsx("h-40 flex flex-col gap-5 items-center justify-center border border-stroke rounded-2xl px-2 ", hoverEffect)}> | ||
<div className="relative h-16 w-60"> | ||
<Image src={exchange.icon.url} alt={exchange.name} fill /> | ||
</div> | ||
|
||
<p className="text-secondary-text">{exchange.name}</p> | ||
</div> | ||
</Link> | ||
); | ||
}; | ||
tractorss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
export default FeaturedExchange; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Exchanges from "./Exchanges"; | ||
import FeaturedExchange from "./FeaturedExchange"; | ||
|
||
import { BuySectionQueryType } from "@/queries/pnk-token/token-buy"; | ||
|
||
interface IBuySection { | ||
buyData: BuySectionQueryType["pnkTokenPageBuySection"]; | ||
} | ||
|
||
const BuySection: React.FC<IBuySection> = ({ buyData }) => { | ||
return ( | ||
<div className="bg-background-2 py-12 lg:py-24 px-6 lg:px-32"> | ||
<h1 className="text-2xl lg:text-3xl text-primary-text font-medium mb-16"> | ||
{buyData.header} | ||
</h1> | ||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-12"> | ||
{buyData.featuredExchanges.map((exchange) => ( | ||
<FeaturedExchange key={exchange.name} {...{ exchange }} /> | ||
))} | ||
</div> | ||
<Exchanges exchanges={buyData.exchanges}/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BuySection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { HeroQueryType } from "@/queries/pnk-token/hero"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
|
||
interface IExplorers { | ||
explorers: HeroQueryType["tokenExplorers"]; | ||
} | ||
|
||
const Explorers: React.FC<IExplorers> = ({ explorers }) => { | ||
return ( | ||
<div className="flex flex-wrap gap-6 lg:gap-12"> | ||
{explorers.map((explorer) => ( | ||
<Link | ||
key={explorer.name} | ||
href={explorer.url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="block relative h-6 min-w-32 items-start" | ||
> | ||
<Image | ||
src={explorer.icon.url} | ||
fill | ||
alt={explorer.name} | ||
className="!w-min" | ||
/> | ||
</Link> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Explorers; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from "react"; | ||
|
||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
|
||
import Button from "@/components/Button"; | ||
import { HeroQueryType } from "@/queries/pnk-token/hero"; | ||
import Explorers from "./Explorers"; | ||
|
||
interface IHero { | ||
heroData: HeroQueryType; | ||
} | ||
|
||
const Hero: React.FC<IHero> = ({ heroData }) => { | ||
const {header, subtitle, buyButton, background} = heroData.pnkTokenPageHero | ||
return ( | ||
<div className="relative pt-52 pb-52 lg:pb-56 px-6 lg:px-32"> | ||
<div className="space-y-8"> | ||
<h1 className="text-3xl lg:text-4xl font-medium">{header}</h1> | ||
<p className="text-lg">{subtitle}</p> | ||
<div> | ||
<Link | ||
href={buyButton.link.url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<Button variant="secondary"> | ||
<span>{buyButton.text}</span> | ||
</Button> | ||
</Link> | ||
</div> | ||
<Explorers explorers={heroData.tokenExplorers}/> | ||
</div> | ||
<Image | ||
src={background.url} | ||
alt="Hero Image Background" | ||
fill | ||
className="absolute top-0 left-0 h-full z-[-1] object-cover" | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Hero; |
35 changes: 35 additions & 0 deletions
35
frontend/src/components/PNKToken/TokenNeedSection/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import CtaCard from "@/components/CtaCard"; | ||
import ExternalLink from "@/components/ExternalLink"; | ||
import { TokenNeedSectionQueryType } from "@/queries/pnk-token/token-need"; | ||
|
||
interface ITokenNeedSection { | ||
tokenNeedData: TokenNeedSectionQueryType["pnkTokenPageNeedSection"]; | ||
} | ||
|
||
const TokenNeedSection: React.FC<ITokenNeedSection> = ({ tokenNeedData }) => { | ||
|
||
return ( | ||
<div className="bg-background-1 py-12 lg:py-24 px-6 lg:px-32"> | ||
<h1 className="text-2xl lg:text-3xl text-primary-text font-medium mb-8"> | ||
{tokenNeedData.header} | ||
</h1> | ||
<p className="text-lg text-secondary-text mb-16"> | ||
{tokenNeedData.subtitle} | ||
</p> | ||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6"> | ||
{tokenNeedData.card.map((card) => ( | ||
<CtaCard key={card.title} {...card} /> | ||
))} | ||
</div> | ||
<div className="w-full items-center"> | ||
<ExternalLink | ||
text={tokenNeedData.arrowLink.text} | ||
url={tokenNeedData.arrowLink.link.url} | ||
className="mt-12 flex-wrap justify-center md:justify-start" | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TokenNeedSection; |
23 changes: 23 additions & 0 deletions
23
frontend/src/components/PNKToken/TokenomicsSection/Stat.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { TokenStat } from "@/queries/pnk-token/tokenomics"; | ||
|
||
const Stat: React.FC<TokenStat & { label: string }> = ({ | ||
label, | ||
primaryValue, | ||
secondaryValue, | ||
}) => { | ||
return ( | ||
<div className="flex flex-col"> | ||
<label className="text-base text-primary-text">{label}</label> | ||
<div className="flex flex-row gap-4"> | ||
<h2 className="text-primary-text font-medium text-xl lg:text-2xl"> | ||
{primaryValue} | ||
</h2> | ||
<h2 className="text-primary-blue text-xl lg:text-2xl"> | ||
{secondaryValue} | ||
</h2> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Stat; |
28 changes: 28 additions & 0 deletions
28
frontend/src/components/PNKToken/TokenomicsSection/TokenStatDisplay.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { TokenStatDisplay as ITokenStatDisplay } from "@/queries/pnk-token/tokenomics"; | ||
|
||
import Image from "next/image"; | ||
|
||
import Stat from "./Stat"; | ||
|
||
const TokenStatDisplay: React.FC<ITokenStatDisplay> = ({ icon, stats }) => { | ||
return ( | ||
<div className="bg-background-1 md:w-fit flex flex-col gap-8 md:flex-row rounded-2xl md:rounded-full p-6 md:p-4 md:pr-8"> | ||
<Image | ||
src={icon.url} | ||
alt="icon" | ||
width={90} | ||
height={90} | ||
className="object-contain" | ||
/> | ||
{stats.map((stat) => ( | ||
<Stat | ||
label={stat.key} | ||
primaryValue={stat.primaryValue} | ||
secondaryValue={stat.secondaryValue} | ||
key={stat.key} | ||
/> | ||
))} | ||
</div> | ||
); | ||
}; | ||
export default TokenStatDisplay; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.