Skip to content

Commit 79b3d3a

Browse files
committed
fix: add Spending on ecosystem
1 parent 7f1c68f commit 79b3d3a

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

src/app/ecosystem/Protocols/Category.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { makeStyles } from "tss-react/mui"
33

44
import { MenuItem, MenuList, Typography } from "@mui/material"
55

6-
import { DIVERGENT_CATEGORY_MAP } from "@/constants"
7-
86
const useStyles = makeStyles<any>()((theme, { top }) => ({
97
menuListRoot: {
108
[theme.breakpoints.up("md")]: {
@@ -63,9 +61,9 @@ const useStyles = makeStyles<any>()((theme, { top }) => ({
6361
}))
6462

6563
const Category = props => {
66-
const { top, value, onChange } = props
64+
const { top, value, options, onChange } = props
6765
const { classes, cx } = useStyles({ top })
68-
const allCategories = useRef(["All categories", ...Object.keys(DIVERGENT_CATEGORY_MAP)])
66+
const allCategories = useRef(["All categories", ...Object.keys(options)])
6967

7068
return (
7169
<MenuList classes={{ root: cx(classes.menuListRoot, "ecosystem-protocols-category") }}>

src/app/ecosystem/Protocols/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ const Grid = withStyles(Box, theme => ({
3434
},
3535
}))
3636

37-
const Protocols = () => {
37+
const Protocols = props => {
38+
const { categories } = props
3839
const trigger = useScrollTrigger()
3940
const { isLandscape } = useCheckViewport()
4041
const [searchInput, setSearchInput] = useState("")
@@ -110,7 +111,7 @@ const Protocols = () => {
110111
</Typography>
111112
</Stack>
112113
<Grid id={`${ECOSYSTEM_PAGE_SYMBOL}-protocols`}>
113-
<Category top={stickyTop} value={searchParams.category} onChange={handleChangeCategory}></Category>
114+
<Category top={stickyTop} value={searchParams.category} options={categories} onChange={handleChangeCategory}></Category>
114115
<SearchInput top={stickyTop} sticky={isSticky} value={searchInput} onChange={handleChangeKeyword}></SearchInput>
115116
<NetworkSelect top={stickyTop} sticky={isSticky} value={searchParams.network} onChange={handleChangeNetwork}></NetworkSelect>
116117
<ProtocolList searchParams={searchParams} onAddPage={handleChangePage}></ProtocolList>

src/app/ecosystem/page.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ export const generateMetadata = genMeta(() => ({
1313
relativeURL: "/ecosystem",
1414
}))
1515

16-
const Ecosystem = () => {
16+
const Ecosystem = async () => {
1717
if (isSepolia) {
1818
notFound()
1919
}
20+
21+
const categoryToTags = await fetch("https://scroll-eco-list.netlify.app/docs/category-to-tags.json").then(res => res.json())
22+
2023
return (
2124
<>
2225
<Header></Header>
2326
<Highlights />
24-
<Protocols></Protocols>
27+
<Protocols categories={categoryToTags}></Protocols>
2528
<Contribute></Contribute>
2629
</>
2730
)

src/constants/ecosystem.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,6 @@ import { GET_IN_TOUCH_URL, LEARN_BUILD_URL, REQUEST_A_DAPP_URL } from "@/constan
55

66
export const ECOSYSTEM_PAGE_SYMBOL = "ecosystem"
77

8-
export const DIVERGENT_CATEGORY_MAP = {
9-
Community: ["Community", "DAO", "Governance"],
10-
DeFi: ["DEX", "DeFi", "Launchpad", "Lending", "Marketplace"],
11-
Gaming: ["Gaming"],
12-
Infra: ["Gateway", "Indexer", "Infrastructure", "Node Provider", "Oracle"],
13-
NFT: ["NFT"],
14-
Privacy: ["Privacy", "Identity"],
15-
Social: ["Social"],
16-
Tooling: ["Tooling"],
17-
Wallet: ["Wallet", "Hardware Wallet"],
18-
Bridge: ["Bridge"],
19-
Payment: ["Payment"],
20-
}
21-
228
export const ECOSYSTEM_EXPLORER_LIST = [
239
{
2410
icon: NoteIcon,

0 commit comments

Comments
 (0)