Skip to content

Commit

Permalink
Merge pull request #347 from zkLinkProtocol/feat/add-eco-dapps
Browse files Browse the repository at this point in the history
Feat/add eco dapps
  • Loading branch information
MickWang authored Jul 31, 2024
2 parents b811e1c + 3fa05a2 commit 3898b55
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 26 deletions.
Binary file added public/img/icon-skyrangers.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/img/icon-steer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 110 additions & 14 deletions src/components/DashboardS2/Tabs/EcoDApps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import useNovaPoints from "@/hooks/useNovaPoints";
import { formatNumberWithUnit } from "@/utils";
import {
Button,
Dropdown,
DropdownItem,
DropdownMenu,
DropdownTrigger,
Modal,
ModalBody,
ModalContent,
Expand Down Expand Up @@ -247,6 +251,7 @@ interface EcoDAppItem {
description: string;
action: string;
actionLink?: string;
actionLinks?: string[];
descriptionTooltip?: string;
}[];
idFeatured?: boolean;
Expand Down Expand Up @@ -304,7 +309,7 @@ const EcoDApp = (props: {
handleLink(data.link);
}}
>
<span>{data.name}</span>
<span className="whitespace-nowrap">{data.name}</span>
<img src="/img/icon-ecolink.svg" alt="" width={16} height={16} />
</div>
<div className="name mt-[5px]">{data.handler}</div>
Expand Down Expand Up @@ -440,20 +445,54 @@ const EcoDApp = (props: {
</div>
<div className="detail-item text-right w-full">
<div className="detail-label">Action</div>
<div className="detail-value flex justify-end items-center gap-[4px]">
<div
className="text-right whitespace-nowrap text-[#0BC48F] cursor-pointer"
onClick={(e) => handleLink(detail.actionLink || data.link)}
>
<GradientText>{detail.action}</GradientText>
{detail.actionLinks ? (
<Dropdown>
<DropdownTrigger>
<div className="detail-value flex justify-end items-center gap-[4px]">
<div className="text-right whitespace-nowrap text-[#0BC48F] cursor-pointer">
<GradientText>{detail.action}</GradientText>
</div>
<img
src="/img/open-in-new-s2.svg"
alt=""
width={20}
height={20}
/>
</div>
</DropdownTrigger>
<DropdownMenu
aria-label="action"
itemClasses={{
base: "gap-4",
}}
>
{detail.actionLinks.map((link, index) => (
<DropdownItem
className="whitespace-nowrap"
key={index}
onClick={() => handleLink(link)}
>
{link}
</DropdownItem>
))}
</DropdownMenu>
</Dropdown>
) : (
<div className="detail-value flex justify-end items-center gap-[4px]">
<div
className="text-right whitespace-nowrap text-[#0BC48F] cursor-pointer"
onClick={() => handleLink(detail.actionLink || data.link)}
>
<GradientText>{detail.action}</GradientText>
</div>
<img
src="/img/open-in-new-s2.svg"
alt=""
width={20}
height={20}
/>
</div>
<img
src="/img/open-in-new-s2.svg"
alt=""
width={20}
height={20}
/>
</div>
)}
</div>
</div>
))}
Expand Down Expand Up @@ -1009,6 +1048,63 @@ export default function EcoDApps({
},
],
},
{
category: "spotdex",
iconURL: "/img/icon-steer.png",
name: "Steer",
link: "https://app.steer.finance/novaswap",
handler: "@steerprotocol",
type: "DEX",
rewardsIcon: [
{ name: "Nova Points", iconURL: "/img/icon-rewards-nova.svg" },
],
rewards: "20x Boost",
holdingPoints: getHoldingPointsByProject("steer"),
totalPoints: getTotalPointsByProject("steer"),
details: [
{
booster: (
<div>
<p>20x for ETH, WETH, Merged WBTC, USDT, USDC</p>
<p>
10x for canonically bridged tokens eligible to earn points
</p>
</div>
),
description: `You earn points based on the liquidity you've supplied to the pool over a specific period, with the points multiplied accordingly.`,
action: "Provide Liquidity",
},
],
},
{
category: "gamefi",
iconURL: "/img/icon-skyrangers.png",
name: "Sky Rangers",
link: "https://statics.skyrangers.io/",
handler: "@OfficialSkyRang",
type: "DEX",
rewardsIcon: [
{ name: "Nova Points", iconURL: "/img/icon-rewards-nova.svg" },
],
rewards: "Interaction",
holdingPoints: getHoldingPointsByProject("skyrangers"),
totalPoints: getTotalPointsByProject("skyrangers"),
details: [
{
booster: (
<div>
<p>Open Blindbox, NFT Level Up, ZKL Deposit, ZKL Withdraw</p>
</div>
),
description: `With a total 5x of any supported actions, you can receive 1 Nova Points.`,
action: "Play now",
actionLinks: [
"https://statics.skyrangers.io/",
"https://t.me/SkyRangers_bot",
],
},
],
},
];

return tabActive
Expand Down
18 changes: 9 additions & 9 deletions src/pages/DashboardS2/index2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ export default function Dashboard() {
name: "Lending",
category: "lending",
},
// {
// iconURL: "/img/icon-sector-6.svg",
// name: "GameFi",
// category: "gamefi",
// },
{
iconURL: "/img/icon-sector-6.svg",
name: "GameFi",
category: "gamefi",
},
{
iconURL: "/img/icon-sector-7.svg",
name: "Others",
Expand Down Expand Up @@ -511,10 +511,10 @@ export default function Dashboard() {
name: "Lending Points",
category: "lending",
},
// {
// name: "GameFi Points",
// category: "gamefi",
// },
{
name: "GameFi Points",
category: "gamefi",
},
{
name: "Others Points",
category: "other",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Leaderboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ export default function Leaderboard() {
iconURL: "/img/icon-sector-4.svg",
},
{ name: "Lending", category: "lending", iconURL: "/img/icon-sector-5.svg" },
// { name: "GameFi", category: "gamefi" },
{ name: "GameFi", category: "gamefi" },
{ name: "Other", category: "other", iconURL: "/img/icon-sector-7.svg" },
];

Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export default defineConfig({
port: 3001,
proxy: {
"/app-api": {
target: "https://goerli.app.zklink.io",
// target: "https://app-api.zklink.io",
// target: "https://goerli.app.zklink.io",
target: "https://app-api.zklink.io",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/app-api/, ""),
},
Expand Down

0 comments on commit 3898b55

Please sign in to comment.