|
1 |
| -import { StaticImageData } from "next/image"; |
2 |
| -import { Card, Cards } from "../../components"; |
| 1 | +import React, { useState, useMemo, useEffect } from 'react'; |
| 2 | +import { Card, Cards } from '../../components/Card'; |
| 3 | +import appData from '../../data/appData'; // Ensure this import is correct |
3 | 4 |
|
4 |
| -import camelLogo from "../../public/assets/ecosystem/camel.png"; |
5 |
| -import gamblinoLogo from "../../public/assets/ecosystem/gamblino.jpeg"; |
6 |
| -import dragonswapLogo from "../../public/assets/ecosystem/dragonswap.jpeg"; |
7 |
| -import fluidLogo from "../../public/assets/ecosystem/fluid.png"; |
8 |
| -import belugasLogo from "../../public/assets/ecosystem/belugas.png"; |
9 |
| -import squaredLabsLogo from "../../public/assets/ecosystem/squared-labs.jpeg"; |
10 |
| -import seijinLogo from "../../public/assets/ecosystem/seijin.png"; |
11 |
| -import predxLogo from "../../public/assets/ecosystem/predx.jpeg"; |
12 |
| -import yakaLogo from "../../public/assets/ecosystem/yaka.jpeg"; |
13 |
| -import webumpLogo from "../../public/assets/ecosystem/webump.jpeg"; |
14 |
| -import accumulatedLogo from "../../public/assets/ecosystem/accumulated.jpeg"; |
15 |
| -import mambaLogo from "../../public/assets/ecosystem/mamba.png"; |
16 |
| -import jellyverseLogo from "../../public/assets/ecosystem/jellyverse.png"; |
17 |
| -import seicasinoLogo from "../../public/assets/ecosystem/seicasino.png"; |
18 |
| -import hoyuLogo from "../../public/assets/ecosystem/hoyu.jpeg"; |
19 |
| -import superSeiyanBotLogo from "../../public/assets/ecosystem/superseiyanbot.jpeg"; |
20 |
| -import nfts2meLogo from "../../public/assets/ecosystem/nfts2me.png"; |
21 |
| -import stafiLogo from "../../public/assets/ecosystem/stafi.png"; |
22 |
| -import siloLogo from "../../public/assets/ecosystem/silo.jpeg"; |
23 |
| -import vermillionLogo from "../../public/assets/ecosystem/vermillion.jpeg"; |
24 |
| - |
25 |
| -interface App { |
26 |
| - title: string; |
27 |
| - description: string; |
28 |
| - href: string; |
29 |
| - image: StaticImageData; |
30 |
| -} |
| 5 | +const EcosystemApps = () => { |
| 6 | + const [searchTerm, setSearchTerm] = useState(''); |
| 7 | + const [allTags, setAllTags] = useState([]); |
31 | 8 |
|
32 |
| -const APPS: App[] = [ |
33 |
| - { |
34 |
| - title: "DragonSwap", |
35 |
| - description: "The native DEX on SEI", |
36 |
| - href: "https://test.dragonswap.app/", |
37 |
| - image: dragonswapLogo, |
38 |
| - }, |
39 |
| - { |
40 |
| - title: "SeiCasino", |
41 |
| - description: "Full-featured casino built natively on Sei", |
42 |
| - href: "https://seicasino.io", |
43 |
| - image: seicasinoLogo, |
44 |
| - }, |
45 |
| - { |
46 |
| - title: "WeBump", |
47 |
| - description: "Sei native NFT launchpad", |
48 |
| - href: "https://webump.xyz/", |
49 |
| - image: webumpLogo, |
50 |
| - }, |
51 |
| - { |
52 |
| - title: "Seijin", |
53 |
| - description: "Launchpad on Sei", |
54 |
| - href: "https://seijin.app/staking", |
55 |
| - image: seijinLogo, |
56 |
| - }, |
57 |
| - { |
58 |
| - title: "Squared Labs", |
59 |
| - description: "Quadratic price exposure on perpetual futures", |
60 |
| - href: "https://squaredlabs.io/app/btc", |
61 |
| - image: squaredLabsLogo, |
62 |
| - }, |
63 |
| - { |
64 |
| - title: "PredX", |
65 |
| - description: "Prediction market", |
66 |
| - href: "https://events.predx.ai/", |
67 |
| - image: predxLogo, |
68 |
| - }, |
69 |
| - { |
70 |
| - title: "Gamblino", |
71 |
| - description: |
72 |
| - "GambleFi protocol covering crypto, sportsbook and classic games of chance", |
73 |
| - href: "https://test.gamblino.app/", |
74 |
| - image: gamblinoLogo, |
75 |
| - }, |
76 |
| - { |
77 |
| - title: "Silo", |
78 |
| - description: "Liquid staking and MEV on Sei", |
79 |
| - href: "https://silo-evm.dc37hw5o72ljt.amplifyapp.com/", |
80 |
| - image: siloLogo, |
81 |
| - }, |
82 |
| - { |
83 |
| - title: "Camel", |
84 |
| - description: "Sei's liquidity oasis", |
85 |
| - href: "https://camel.money", |
86 |
| - image: camelLogo, |
87 |
| - }, |
88 |
| - { |
89 |
| - title: "Fluid", |
90 |
| - description: "Interest free loans, backed by Sei", |
91 |
| - href: "https://fluidex.metabest.tech/", |
92 |
| - image: fluidLogo, |
93 |
| - }, |
94 |
| - { |
95 |
| - title: "Belugas", |
96 |
| - description: "Decentralized marketplace for lenders and borrowers", |
97 |
| - href: "https://www.belugas.io/", |
98 |
| - image: belugasLogo, |
99 |
| - }, |
100 |
| - { |
101 |
| - title: "Yaka", |
102 |
| - description: "Algebra Integral fork on Sei", |
103 |
| - href: "https://test.yaka.finance/", |
104 |
| - image: yakaLogo, |
105 |
| - }, |
106 |
| - { |
107 |
| - title: "Accumulated", |
108 |
| - description: "Liquid staking protocol", |
109 |
| - href: "https://testnet.accumulated.finance/stake/sei", |
110 |
| - image: accumulatedLogo, |
111 |
| - }, |
112 |
| - { |
113 |
| - title: "Mamba Defi", |
114 |
| - description: "Defi and memecoin ecosystem", |
115 |
| - href: "https://www.mambaswap.io/", |
116 |
| - image: mambaLogo, |
117 |
| - }, |
118 |
| - { |
119 |
| - title: "JellyVerse", |
120 |
| - description: "Smart order router", |
121 |
| - href: "https://jelly-verse-sei.vercel.app/jellyswap", |
122 |
| - image: jellyverseLogo, |
123 |
| - }, |
124 |
| - { |
125 |
| - title: "Hoyu", |
126 |
| - description: |
127 |
| - "DeFi protocol uniting lending and trading markets to give every token new utility as safe collateral", |
128 |
| - href: "https://arctic.hoyu.io", |
129 |
| - image: hoyuLogo, |
130 |
| - }, |
131 |
| - { |
132 |
| - title: "Super Seiyan Bot", |
133 |
| - description: "Sei native telegram trading bot", |
134 |
| - href: "https://t.me/SSeiyanEvmBot", |
135 |
| - image: superSeiyanBotLogo, |
136 |
| - }, |
137 |
| - { |
138 |
| - title: "NFTs2ME", |
139 |
| - description: "No-code NFT creation tool", |
140 |
| - href: "https://nfts2me.com/app/sei-devnet/", |
141 |
| - image: nfts2meLogo, |
142 |
| - }, |
143 |
| - { |
144 |
| - title: "Stafi", |
145 |
| - description: "LST protocol", |
146 |
| - href: "https://test-app.stafi.io/gallery/evm/SEI/?net=SEI", |
147 |
| - image: stafiLogo, |
148 |
| - }, |
149 |
| - { |
150 |
| - title: "Vermillion", |
151 |
| - description: "Next-gen AMM and stablecoin", |
152 |
| - href: "https://app.vermillion.finance/swap", |
153 |
| - image: vermillionLogo, |
154 |
| - }, |
155 |
| -]; |
| 9 | + // Extract unique tags from appData |
| 10 | + useEffect(() => { |
| 11 | + const tags = new Set(); |
| 12 | + appData.forEach(app => app.tags.forEach(tag => tags.add(tag))); |
| 13 | + setAllTags(Array.from(tags)); |
| 14 | + }, []); |
| 15 | + // Filter by "title" and "tag" fields from appData.ts // Filter by "title" and "tag" fields from appData.ts |
| 16 | + const filteredApps = useMemo(() => ( |
| 17 | + appData.filter(app => |
| 18 | + app.title.toLowerCase().includes(searchTerm.toLowerCase()) || |
| 19 | + app.tags.some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase())) |
| 20 | + ) |
| 21 | + ), [searchTerm]); |
156 | 22 |
|
157 |
| -const EcosystemApps = () => { |
158 | 23 | return (
|
159 |
| - <Cards> |
160 |
| - {APPS.map((app) => ( |
161 |
| - <Card |
162 |
| - key={app.title} |
163 |
| - title={app.title} |
164 |
| - description={app.description} |
165 |
| - href={app.href} |
166 |
| - image={app.image} |
167 |
| - /> |
168 |
| - ))} |
169 |
| - </Cards> |
| 24 | + <div> |
| 25 | + <input |
| 26 | + type="text" |
| 27 | + placeholder="Search apps by name or tag..." |
| 28 | + value={searchTerm} |
| 29 | + onChange={(e) => setSearchTerm(e.target.value)} |
| 30 | + className="w-full p-2 text-sm border rounded shadow-sm placeholder-gray-400" |
| 31 | + /> |
| 32 | + <div className="mt-2 mb-4 text-sm text-gray-600"> |
| 33 | + <strong>Filter by Tags:</strong> {allTags.join(', ')} |
| 34 | + </div> |
| 35 | + <Cards> |
| 36 | + {filteredApps.length > 0 ? ( |
| 37 | + filteredApps.map((app) => ( |
| 38 | + <Card |
| 39 | + key={app.title} |
| 40 | + title={app.title} |
| 41 | + description={app.description} |
| 42 | + href={app.href} |
| 43 | + image={app.image} |
| 44 | + /> |
| 45 | + )) |
| 46 | + ) : ( |
| 47 | + <div className="text-center text-gray-500">No apps found.</div> |
| 48 | + )} |
| 49 | + </Cards> |
| 50 | + </div> |
170 | 51 | );
|
171 | 52 | };
|
172 | 53 |
|
|
0 commit comments