Skip to content

Commit dfb0c32

Browse files
authored
Merge pull request #1456 from scroll-tech/new-navbar
New navbar
2 parents b09595f + 5113476 commit dfb0c32

File tree

84 files changed

+1376
-1365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1376
-1365
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030
"@next/third-parties": "^15.1.5",
3131
"@rainbow-me/rainbowkit": "^2.1.2",
3232
"@sentry/nextjs": "^7.95.0",
33+
"@tailwindcss/postcss": "^4.0.6",
3334
"@tanstack/react-query": "^5.55.3",
3435
"@tanstack/react-virtual": "^3.11.2",
3536
"@types/mdx": "^2.0.13",
3637
"@typescript-eslint/parser": "^8.4.0",
38+
"clsx": "^2.1.1",
3739
"copy-to-clipboard": "^3.3.2",
3840
"dayjs": "^1.11.5",
3941
"ethers": "6.12.0",
@@ -90,11 +92,11 @@
9092
"eslint-plugin-prettier": "^5.1.3",
9193
"husky": "^8.0.2",
9294
"pino-pretty": "^10.3.1",
93-
"postcss": "^8.4.17",
95+
"postcss": "^8.5.2",
9496
"prettier": "^3.2.4",
9597
"raw-loader": "^4.0.2",
9698
"sitemap": "^7.1.1",
97-
"tailwindcss": "^3.3.0",
99+
"tailwindcss": "^4.0.6",
98100
"turbo": "^2.4.2",
99101
"typescript": "^5.1.6"
100102
},

postcss.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

postcss.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const config = {
2+
plugins: {
3+
"@tailwindcss/postcss": {},
4+
},
5+
}
6+
export default config

src/app/SCR-sSCR/page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { promises as fs } from "fs"
2+
import { notFound } from "next/navigation"
23

3-
import { BNToAmount, genMeta } from "@/utils"
4+
import { BNToAmount, genMeta, isSepolia } from "@/utils"
45

56
import Explaination from "./Explaination"
67
import Header from "./Header"
@@ -21,6 +22,10 @@ const ScrAndsSCRPage = async () => {
2122
next: { revalidate: 3600 },
2223
}).then(res => res.json())
2324

25+
if (isSepolia) {
26+
notFound()
27+
}
28+
2429
return (
2530
<>
2631
<Header circulatingSupply={circulatingSupply} votableSupply={BNToAmount(BigInt(votable_supply))}></Header>

src/app/_canvas-and-badges/Badges/BadgeList/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import LoadingButton from "@/components/LoadingButton"
1313
import LoadingPage from "@/components/LoadingPage"
1414
import { CANVAS_AND_BADGES_PAGE_SYMBOL, CATEGORY_LIST, SORT_LIST } from "@/constants"
1515
import { isAboveScreen } from "@/utils/dom"
16+
import { scrollRequest } from "@/utils/request"
1617

1718
import BadgeCard from "./BadgeCard"
1819
// import BadgeMasonry from "./BadgeMasonry"

src/app/_canvas-and-badges/Header/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { retrieveCanvasBadgeURL } from "@/apis/canvas-badge"
1313
import Button from "@/components/Button"
1414
import { CANVAS_AND_BADGES_PAGE_SYMBOL, CANVAS_URL, HEADER_BADGES, HEADER_STARS, ISSUE_BADGES_URL } from "@/constants"
1515
import useCheckViewport from "@/hooks/useCheckViewport"
16+
import { scrollRequest } from "@/utils/request"
1617

1718
// import Counter from "./Counter"
1819
import Statistic from "./Statistic"

src/app/_canvas/Dashboard/ReferDialog/coupon.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { useRainbowContext } from "@/contexts/RainbowProvider"
1818
import useSnackbar from "@/hooks/useSnackbar"
1919
import useCanvasStore from "@/stores/canvasStore"
2020
import { generateShareTwitterURL } from "@/utils"
21+
import { scrollRequest } from "@/utils/request"
2122

2223
const CouponBox = styled(Box)(({ theme }) => ({
2324
background: `url(${couponBackground.src}) no-repeat center center`,

src/app/_canvas/badge/[id]/BadgeDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const BadgeDetail = props => {
9191
pb: [0, "6rem"],
9292
minHeight: ["unset", "calc(100vh - 6.5rem)"],
9393

94-
height: [`calc(var(--vh, 1vh) * 100 - 6.2rem - ${actionHeight})`, "auto"],
94+
height: [`calc(var(--vh, 1vh) * 100 - 6.4rem - ${actionHeight})`, "auto"],
9595
display: "flex",
9696
alignItems: isOverflow ? "flex-start" : "center",
9797
overflowY: isOverflow ? "auto" : "unset",

src/app/_canvas/components/GridBg/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const Container: any = styled<any>(Box, { shouldForwardProp: prop => prop !== "g
4444
},
4545
},
4646
[theme.breakpoints.down("md")]: {
47-
marginTop: "-6.2rem",
47+
marginTop: "-6.4rem",
4848
height: "calc(var(--vh, 1vh) * 100)",
4949
},
5050
}))

src/app/_canvas/mint/flow/FirstBadgeStep.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import useSnackbar from "@/hooks/useSnackbar"
1313
import { mintBadge } from "@/services/canvasService"
1414
import useCanvasStore from "@/stores/canvasStore"
1515
import { truncateAddress } from "@/utils"
16+
import { scrollRequest } from "@/utils/request"
1617

1718
import StepWrapper from "./StepWrapper"
1819

src/app/_canvas/mint/flow/MintStep.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import useCheckViewport from "@/hooks/useCheckViewport"
1515
import useSnackbar from "@/hooks/useSnackbar"
1616
import useCanvasStore from "@/stores/canvasStore"
1717
import { isUserRejected, recognizeError, sentryDebug, trimErrorMessage } from "@/utils"
18+
import { scrollRequest } from "@/utils/request"
1819

1920
import InsufficientDialog from "./InsufficientDialog"
2021
import StepWrapper from "./StepWrapper"

src/app/_canvas/mint/flow/StepWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const StepWrapper = props => {
1010
pb: ["9.6rem", "6rem"],
1111
display: "flex",
1212
flexDirection: "column",
13-
height: ["calc(100vh - 6.2rem)", "calc(100vh - 6.5rem)"],
13+
height: ["calc(100vh - 6.4rem)", "calc(100vh - 6.5rem)"],
1414
justifyContent: ["flex-start", "center"],
1515
overflowY: "auto",
1616
alignItems: "center",

src/app/_canvas/mint/home/ReferralCodeInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import CheckSvg from "@/assets/svgs/canvas/check.svg"
88
import ErrorSvg from "@/assets/svgs/canvas/error.svg"
99
import LoadingSvg from "@/assets/svgs/canvas/loading.svg"
1010
import useCanvasStore from "@/stores/canvasStore"
11+
import { scrollRequest } from "@/utils/request"
1112

1213
const INVITE_CODE_LENGTH = 5
1314

src/app/_canvas/mint/home/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Container = styled(Box)(({ theme }) => ({
2525
paddingBottom: "6rem",
2626
backgroundColor: "#101010",
2727
[theme.breakpoints.down("sm")]: {
28-
height: "calc(var(--vh, 1vh) * 100 - 6.2rem - 9.6rem)",
28+
height: "calc(var(--vh, 1vh) * 100 - 6.4rem - 9.6rem)",
2929
minHeight: "unset",
3030
padding: "0 1rem",
3131
overflowY: "auto",

src/app/_components/Header/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import Button from "@/components/Button"
77
import OrientationToView from "@/components/Motion/OrientationToView"
88
import useCheckViewport from "@/hooks/useCheckViewport"
99

10+
const ANNOUNCEMENT_HEIGHT = "0rem"
11+
1012
const Title = styled(Typography)(({ theme }) => ({
1113
fontSize: "6.4rem",
1214
lineHeight: "8.8rem",
@@ -40,15 +42,15 @@ const Header = () => {
4042
theme => ({
4143
[theme.breakpoints.up("md")]: {
4244
background: "url(/imgs/homepage/landing-bg.webp) center / cover no-repeat",
43-
aspectRatio: "16 / 9",
44-
marginTop: "-6.5rem",
45+
minHeight: "40rem",
46+
marginTop: `calc(-6.5rem - ${ANNOUNCEMENT_HEIGHT})`,
4547
},
4648
}),
4749
]}
4850
>
4951
{isLandscape && (
5052
<Box>
51-
<video style={{ width: "100vw", objectFit: "cover" }} autoPlay muted loop playsInline preload="none">
53+
<video style={{ width: "100vw", height: "100vh", objectFit: "cover" }} autoPlay muted loop playsInline preload="none">
5254
<source src="/videos/home-header-bg.mp4" type="video/mp4" />
5355
<source src="/videos/home-header-bg-264.mp4" type="video/mp4" />
5456
Not support video
@@ -60,13 +62,13 @@ const Header = () => {
6062
[theme.breakpoints.down("md")]: { paddingTop: "7.2rem" },
6163
[theme.breakpoints.up("md")]: {
6264
position: "absolute",
63-
top: "10rem",
65+
top: `calc(10rem + ${ANNOUNCEMENT_HEIGHT})`,
6466
left: "50%",
6567
transform: "translateX(-50%)",
6668
zIndex: 1,
6769
},
6870
"@media (min-width: 1680px)": {
69-
top: "calc(100vw*0.06 + 6.5rem)",
71+
top: `calc(100vw*0.06 + 6.5rem + ${ANNOUNCEMENT_HEIGHT})`,
7072
},
7173
})}
7274
>

src/app/_story/Header/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const useStyles = makeStyles()(theme => ({
2121
background: " url(/imgs/story/story-hero-bg-mobile.svg) no-repeat center",
2222
backgroundSize: "cover",
2323
paddingTop: "13rem",
24-
marginTop: "-6.2rem",
24+
marginTop: "-6.4rem",
2525
},
2626

2727
"@media (max-width: 375px)": {

src/app/blog/[blogId]/detail.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const BlogContainer = styled(Box)(
2929
padding: 6rem 4rem 14rem;
3030
overflow: visible;
3131
display: flex;
32+
width: 100%;
33+
margin: auto;
3234
${theme.breakpoints.down("md")} {
3335
padding: 4rem 2rem;
3436
display: block;
@@ -104,7 +106,7 @@ const BlogDetail = props => {
104106
<LoadingPage height="80vh"></LoadingPage>
105107
) : (
106108
<Box>
107-
<BlogContainer className="wrapper">
109+
<BlogContainer>
108110
<Box sx={{ width: "32rem", flexShrink: 0, position: "relative" }}>
109111
<BlogNavbar>
110112
<TOC />

src/app/blog/[blogId]/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import { notFound } from "next/navigation"
2+
13
import blogSource from "@/assets/blog/main.data.json"
4+
import { isSepolia } from "@/utils"
25
import { genMeta } from "@/utils/route"
36

47
import Detail from "./detail"
@@ -21,6 +24,9 @@ export const generateMetadata = genMeta(async ({ params }) => {
2124
})
2225

2326
const BlogDetail = async ({ params }) => {
27+
if (isSepolia) {
28+
notFound()
29+
}
2430
const { blogId } = await params
2531
return (
2632
<>

src/app/blog/layout.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { notFound } from "next/navigation"
2+
3+
import { isSepolia } from "@/utils"
14
import { genMeta } from "@/utils/route"
25

36
export const generateMetadata = genMeta(() => ({
@@ -6,5 +9,8 @@ export const generateMetadata = genMeta(() => ({
69
}))
710

811
export default function Layout({ children }) {
12+
if (isSepolia) {
13+
notFound()
14+
}
915
return <>{children}</>
1016
}

src/app/community/Events/List.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import LoadingButton from "@/components/LoadingButton"
99
import LoadingPage from "@/components/LoadingPage"
1010
import SuccessionToView, { SuccessionItem } from "@/components/Motion/SuccessionToView"
1111
import { COMMUNITY_REGION_LIST, COMMUNITY_TIME_LIST } from "@/constants/community"
12+
import { scrollRequest } from "@/utils/request"
1213

1314
import Error from "./Error"
1415
import Card from "./EventCard"

src/app/community/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { notFound } from "next/navigation"
22

3+
import { isSepolia } from "@/utils"
34
import { genMeta } from "@/utils/route"
45

56
export const generateMetadata = genMeta(() => ({
@@ -10,7 +11,7 @@ export const generateMetadata = genMeta(() => ({
1011
}))
1112

1213
export default function Layout({ children }) {
13-
if (process.env.NEXT_PUBLIC_SCROLL_ENVIRONMENT === "Sepolia") {
14+
if (isSepolia) {
1415
notFound()
1516
}
1617
return <>{children}</>

src/app/developer-nft/coming-soon/CheckElegbility/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { MintableDate } from "@/constants"
99
import { useRainbowContext } from "@/contexts/RainbowProvider"
1010
import useCheckViewport from "@/hooks/useCheckViewport"
1111
import { formatDate } from "@/utils"
12+
import { scrollRequest } from "@/utils/request"
1213

1314
const L2_SCAN_URI = process.env.NEXT_PUBLIC_L2_SCAN_URI
1415
const UNIFRA_API_KEY = process.env.NEXT_PUBLIC_UNIFRA_API_KEY

src/app/developer-nft/coming-soon/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Alert from "@/components/Alert/NFTAlert"
88
import SectionWrapper from "@/components/SectionWrapper"
99
import { MintableDate, SCROLL_ORIGINS_NFT } from "@/constants"
1010
import useNFTStore from "@/stores/nftStore"
11-
import { formatDate } from "@/utils"
11+
import { formatDate, isSepolia } from "@/utils"
1212

1313
import CheckElegbility from "./CheckElegbility"
1414
import Header from "./Header"
@@ -19,7 +19,7 @@ import Stepper from "./Stepper"
1919
const ComingSoon = () => {
2020
const { phrase } = useNFTStore()
2121

22-
if (process.env.NEXT_PUBLIC_SCROLL_ENVIRONMENT === "Sepolia") {
22+
if (isSepolia) {
2323
notFound()
2424
}
2525

src/app/developer-nft/mint/flow/QuestionStep.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { useNFTContext } from "@/contexts/NFTContextProvider"
1818
import { useRainbowContext } from "@/contexts/RainbowProvider"
1919
import useNFTStore from "@/stores/nftStore"
2020
import { sentryDebug, trimErrorMessage } from "@/utils"
21+
import { scrollRequest } from "@/utils/request"
2122

2223
import StepWrapper from "./StepWrapper"
2324

src/app/developer-nft/mint/home/ReadyToMint.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useRainbowContext } from "@/contexts/RainbowProvider"
1515
import useCheckViewport from "@/hooks/useCheckViewport"
1616
import useNFTStore from "@/stores/nftStore"
1717
import { formatDate, switchNetwork } from "@/utils"
18+
import { scrollRequest } from "@/utils/request"
1819

1920
import NFTCard from "../../components/NFTCard"
2021
import Statistic from "../../components/Statistic"

src/app/developer-nft/mint/mock/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import SectionWrapper from "@/components/SectionWrapper"
77
import { CHAIN_ID, L2_NAME } from "@/constants"
88
import { useRainbowContext } from "@/contexts/RainbowProvider"
99
import { switchNetwork } from "@/utils"
10+
import { scrollRequest } from "@/utils/request"
1011

1112
const Mock = () => {
1213
const { walletCurrentAddress, chainId, connect } = useRainbowContext()

src/app/developer-nft/mint/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { notFound } from "next/navigation"
22

33
import NFTContextProvider from "@/contexts/NFTContextProvider"
4+
import { isSepolia } from "@/utils"
45
import { genMeta } from "@/utils/route"
56

67
import MintHome from "./home"
@@ -13,7 +14,7 @@ export const generateMetadata = genMeta(() => ({
1314
}))
1415

1516
const Mint = () => {
16-
if (process.env.NEXT_PUBLIC_SCROLL_ENVIRONMENT === "Sepolia") {
17+
if (isSepolia) {
1718
notFound()
1819
}
1920
return (

src/app/ecosystem/Header/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Button from "@/components/Button"
1010
import { GET_IN_TOUCH_LINK } from "@/constants"
1111
import useCheckViewport from "@/hooks/useCheckViewport"
1212
import { formatLargeNumber } from "@/utils"
13+
import { scrollRequest } from "@/utils/request"
1314

1415
import Statistic from "./Statistic"
1516

@@ -31,7 +32,7 @@ const Header = () => {
3132
sx={[
3233
{
3334
position: "relative",
34-
height: ["calc(100vh - 6.2rem)", "72rem", "auto"],
35+
height: ["calc(100vh - 6.4rem)", "72rem", "auto"],
3536
},
3637
theme => ({
3738
[theme.breakpoints.up("md")]: {

src/app/ecosystem/Highlights/HighlightList/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ const Carousel = () => {
3838
slidesPerView = 1
3939
}
4040

41-
console.log(slidesPerView)
42-
4341
const filteredData = Data.filter(blog => blog.type === "Ecosystem highlights" && blog.language === "en")
4442

4543
return (

src/app/ecosystem/Protocols/ProtocolList/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import LoadingPage from "@/components/LoadingPage"
1111
import TextButton from "@/components/TextButton"
1212
import { ECOSYSTEM_NETWORK_LIST } from "@/constants"
1313
import { isAboveScreen } from "@/utils/dom"
14+
import { scrollRequest } from "@/utils/request"
1415

1516
import Error from "./Error"
1617
import NoData from "./NoData"
@@ -75,6 +76,7 @@ const ProtocolList = props => {
7576

7677
const fetchEcosystemList = value => {
7778
setLoading(true)
79+
7880
scrollRequest(`${ecosystemListUrl}${value}`)
7981
.then(({ data, hasMore }) => {
8082
setHasMore(hasMore)

src/app/ecosystem/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { notFound } from "next/navigation"
22

3+
import { isSepolia } from "@/utils"
34
import { genMeta } from "@/utils/route"
45

56
import Contribute from "./Contribute"
@@ -13,7 +14,7 @@ export const generateMetadata = genMeta(() => ({
1314
}))
1415

1516
const Ecosystem = () => {
16-
if (process.env.NEXT_PUBLIC_SCROLL_ENVIRONMENT === "Sepolia") {
17+
if (isSepolia) {
1718
notFound()
1819
}
1920
return (

0 commit comments

Comments
 (0)