From 265ab95f7e537620386c2137136c6d6bffad4d80 Mon Sep 17 00:00:00 2001 From: holybasil Date: Sat, 9 Nov 2024 14:46:34 +0700 Subject: [PATCH 1/3] fix: ecosystem get in touch --- src/pages/ecosystem/Header/Statistic.tsx | 5 ++-- src/pages/ecosystem/Header/index.tsx | 34 +++++++++++++++++------- src/pages/ecosystem/Protocols/index.tsx | 11 ++------ 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/pages/ecosystem/Header/Statistic.tsx b/src/pages/ecosystem/Header/Statistic.tsx index e53ebc047..e3aeec7f5 100644 --- a/src/pages/ecosystem/Header/Statistic.tsx +++ b/src/pages/ecosystem/Header/Statistic.tsx @@ -20,7 +20,8 @@ const Statistic = props => { sx={{ flex: 1, borderRadius: ["0.8rem", "1.6rem"], - p: ["0.8rem 1.2rem", "1.6rem 2.4rem"], + p: ["0.8rem 1.2rem", "1.6rem 1.6rem"], + minWidth: ["auto", "20rem"], backgroundColor: theme => theme.palette.themeBackground.normal, }} > @@ -41,7 +42,7 @@ const Statistic = props => { {label} {loading ? : <>{children}} diff --git a/src/pages/ecosystem/Header/index.tsx b/src/pages/ecosystem/Header/index.tsx index b5cbe39ac..15cd124f4 100644 --- a/src/pages/ecosystem/Header/index.tsx +++ b/src/pages/ecosystem/Header/index.tsx @@ -4,13 +4,15 @@ import { Box, Container, Stack, Typography } from "@mui/material" import { fetchEcosystemMetricsData } from "@/apis/ecosystem" import { fetchLastBatchIndexesUrl } from "@/apis/rollupscan" -// import useCheckViewport from "@/hooks/useCheckViewport" +import Button from "@/components/Button" +import { GET_IN_TOUCH_LINK } from "@/constants" +import useCheckViewport from "@/hooks/useCheckViewport" import { formatLargeNumber } from "@/utils" import Statistic from "./Statistic" const Header = () => { - // const { isLandscape } = useCheckViewport() + const { isPortrait } = useCheckViewport() const { data, isLoading } = useSWR(fetchEcosystemMetricsData, () => scrollRequest(fetchEcosystemMetricsData), { refreshInterval: 18e4 }) const { data: totalBatches, isLoading: isBatchesLoading } = useSWR( @@ -54,15 +56,18 @@ const Header = () => { - - - An Ecosystem
- Forever in Motion + + + Ecosystem projects - - + + {data?.tvl} @@ -72,6 +77,15 @@ const Header = () => { {totalBatches} +
diff --git a/src/pages/ecosystem/Protocols/index.tsx b/src/pages/ecosystem/Protocols/index.tsx index 7381e7129..bb63cefa6 100644 --- a/src/pages/ecosystem/Protocols/index.tsx +++ b/src/pages/ecosystem/Protocols/index.tsx @@ -5,9 +5,8 @@ import { withStyles } from "tss-react/mui" import { Box, Stack, Typography } from "@mui/material" import useScrollTrigger from "@mui/material/useScrollTrigger" -import Button from "@/components/Button" import SectionWrapper from "@/components/SectionWrapper" -import { ECOSYSTEM_NETWORK_LIST, ECOSYSTEM_PAGE_SYMBOL, GET_IN_TOUCH_LINK, NORMAL_HEADER_HEIGHT } from "@/constants" +import { ECOSYSTEM_NETWORK_LIST, ECOSYSTEM_PAGE_SYMBOL, NORMAL_HEADER_HEIGHT } from "@/constants" import useCheckViewport from "@/hooks/useCheckViewport" import Category from "./Category" @@ -35,7 +34,7 @@ const Grid = withStyles(Box, theme => ({ const Protocols = () => { const trigger = useScrollTrigger() - const { isMobile, isTablet, isLandscape } = useCheckViewport() + const { isLandscape } = useCheckViewport() const [searchInput, setSearchInput] = useState("") const [searchParams, setSearchParams] = useState({ category: "All categories", @@ -107,12 +106,6 @@ const Protocols = () => { > Browse all protocols - - {isMobile ? null : ( - - )} From 0aa3a380147593fb556296e02e0287b020657361 Mon Sep 17 00:00:00 2001 From: holybasil Date: Sun, 10 Nov 2024 20:19:19 +0700 Subject: [PATCH 2/3] fix: style --- src/pages/ecosystem/Header/Statistic.tsx | 1 + src/pages/ecosystem/Header/index.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/ecosystem/Header/Statistic.tsx b/src/pages/ecosystem/Header/Statistic.tsx index e3aeec7f5..99dc7fbe9 100644 --- a/src/pages/ecosystem/Header/Statistic.tsx +++ b/src/pages/ecosystem/Header/Statistic.tsx @@ -31,6 +31,7 @@ const Statistic = props => { lineHeight: ["2rem", "2.8rem"], fontWeight: 600, textAlign: "center", + whiteSpace: ["pre-wrap", "pre-wrap", "nowrap"], [theme.breakpoints.down("md")]: { flex: 1, display: "inline-flex", diff --git a/src/pages/ecosystem/Header/index.tsx b/src/pages/ecosystem/Header/index.tsx index 15cd124f4..8b723e074 100644 --- a/src/pages/ecosystem/Header/index.tsx +++ b/src/pages/ecosystem/Header/index.tsx @@ -56,7 +56,7 @@ const Header = () => { - + Ecosystem projects @@ -68,13 +68,13 @@ const Header = () => { }} > - {data?.tvl} + {data?.tvl ?? "--"} - {data?.txAll} + {data?.txAll ?? "--"} - {totalBatches} + {totalBatches ?? "--"}