Skip to content

Commit 7ec15c3

Browse files
authored
Add scroll open announcement (#1405)
1 parent 8bc7cbc commit 7ec15c3

File tree

3 files changed

+43
-31
lines changed

3 files changed

+43
-31
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"react-countdown": "^2.3.2",
4646
"react-device-detect": "^2.2.3",
4747
"react-dom": "^18.2.0",
48+
"react-fast-marquee": "^1.6.5",
4849
"react-ga4": "^2.1.0",
4950
"react-mailchimp-subscribe": "^2.1.3",
5051
"react-markdown": "^8.0.3",

src/components/Header/announcement.tsx

+28-22
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
11
import { usePathname } from "next/navigation"
22
import { useMemo } from "react"
3+
import Marquee from "react-fast-marquee"
34

4-
import { Stack } from "@mui/material"
5-
import { styled } from "@mui/system"
5+
import { Box } from "@mui/material"
66

77
import { isMainnet } from "@/utils"
88

9-
const AnnouncementStack = styled<any>(Stack, { shouldForwardProp: prop => prop !== "production" })(({ theme, production }) => ({
10-
lineHeight: "2.6rem",
11-
background: production ? "rgb(181, 245, 236)" : theme.palette.primary.main,
12-
textAlign: "center",
13-
color: production ? theme.palette.text.primary : theme.palette.primary.contrastText,
14-
fontSize: "1.6rem",
15-
padding: "1.2rem",
16-
display: "inline-block",
17-
width: "100%",
18-
[theme.breakpoints.down("sm")]: {
19-
lineHeight: "2rem",
20-
},
21-
}))
22-
239
const Announcement = () => {
24-
const displayAnnouncement = false
10+
const displayAnnouncement = true
2511
const pathname = usePathname()
26-
2712
const isHome = pathname === "/"
2813

2914
const announcementContent = useMemo(() => {
3015
if (isMainnet && isHome) {
3116
return (
3217
<>
33-
🔥 Applications for the Level Up Grants Program are open until August 25. <strong className="underline"> Apply now!</strong>
18+
Join Scroll Open: Build the Future of the Open Economy{" "}
19+
<div className="inline-block w-[5px] h-[5px] rounded-full bg-current mx-[20px] align-middle"></div>
20+
Jan 27 - March 17
21+
<div className="inline-block w-[5px] h-[5px] rounded-full bg-current mx-[20px] align-middle"></div>
3422
</>
3523
)
3624
}
@@ -39,14 +27,32 @@ const Announcement = () => {
3927

4028
const rightHref = useMemo(() => {
4129
if (isMainnet && isHome) {
42-
return "https://tally.so/r/mYdQP5"
30+
return "https://open.scroll.io"
4331
}
4432
return ""
4533
}, [isMainnet, isHome])
4634

4735
return displayAnnouncement && announcementContent ? (
48-
<a href={rightHref} rel="noopener noreferrer">
49-
<AnnouncementStack production={isMainnet}>{announcementContent}</AnnouncementStack>
36+
<a href={rightHref} rel="noopener noreferrer" className="mb-[1.6rem]">
37+
<Box
38+
sx={{
39+
backgroundColor: theme => (isMainnet ? theme.palette.common.white : theme.palette.primary.main),
40+
color: theme => (isMainnet ? theme.palette.text.primary : theme.palette.primary.contrastText),
41+
fontSize: "1.6rem",
42+
lineHeight: {
43+
xs: "2rem",
44+
sm: "2.6rem",
45+
},
46+
padding: "1.6rem",
47+
width: "100%",
48+
borderBottom: "1px solid #101010",
49+
fontWeight: "500",
50+
}}
51+
>
52+
<Marquee autoFill pauseOnHover gradient={false}>
53+
{announcementContent}
54+
</Marquee>
55+
</Box>
5056
</a>
5157
) : null
5258
}

yarn.lock

+14-9
Original file line numberDiff line numberDiff line change
@@ -3039,17 +3039,17 @@
30393039
"@swc/counter" "^0.1.3"
30403040
tslib "^2.4.0"
30413041

3042-
"@tanstack/query-core@5.55.3":
3043-
version "5.55.3"
3044-
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.55.3.tgz#fee3c2ffd65cd6cf195820eccab662508ff84ad1"
3045-
integrity sha512-JpRWbOiTBaddMg/oYNBeBle3m0wFTZnfLc2dtZgjdr3NZaqSGzIkPDFf6gjTWKq5zxWJTZNtsKSihVKQ7wL3VQ==
3042+
"@tanstack/query-core@5.62.16":
3043+
version "5.62.16"
3044+
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.62.16.tgz#f7efc92b1562a054748bc00c7f8d9d833407503b"
3045+
integrity sha512-9Sgft7Qavcd+sN0V25xVyo0nfmcZXBuODy3FVG7BMWTg1HMLm8wwG5tNlLlmSic1u7l1v786oavn+STiFaPH2g==
30463046

3047-
"@tanstack/[email protected]":
3048-
version "5.55.3"
3049-
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.55.3.tgz#8acaba9fd3cdf250bd3c6ee8d4ae00c951da3642"
3050-
integrity sha512-DzVFYNKMZPaEj+RNmG1lUjmR3CVFf1GoPvE03/0IN+5C8/VYiIMUhi4YgLQPnksrUarIzPPw1N2MPRvuRysLwQ==
3047+
"@tanstack/react-query@^5.55.3":
3048+
version "5.63.0"
3049+
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.63.0.tgz#18e00e24a485f707cfd41f4b30679f70e6ca6016"
3050+
integrity sha512-QWizLzSiog8xqIRYmuJRok9VELlXVBAwtINgVCgW1SNvamQwWDO5R0XFSkjoBEj53x9Of1KAthLRBUC5xmtVLQ==
30513051
dependencies:
3052-
"@tanstack/query-core" "5.55.3"
3052+
"@tanstack/query-core" "5.62.16"
30533053

30543054
"@trivago/prettier-plugin-sort-imports@^4.0.0":
30553055
version "4.3.0"
@@ -8694,6 +8694,11 @@ react-dom@^18.2.0:
86948694
loose-envify "^1.1.0"
86958695
scheduler "^0.23.0"
86968696

8697+
react-fast-marquee@^1.6.5:
8698+
version "1.6.5"
8699+
resolved "https://registry.yarnpkg.com/react-fast-marquee/-/react-fast-marquee-1.6.5.tgz#98929ae93eef087a607a71e9d45ab76bba97dc16"
8700+
integrity sha512-swDnPqrT2XISAih0o74zQVE2wQJFMvkx+9VZXYYNSLb/CUcAzU9pNj637Ar2+hyRw6b4tP6xh4GQZip2ZCpQpg==
8701+
86978702
react-ga4@^2.1.0:
86988703
version "2.1.0"
86998704
resolved "https://registry.yarnpkg.com/react-ga4/-/react-ga4-2.1.0.tgz#56601f59d95c08466ebd6edfbf8dede55c4678f9"

0 commit comments

Comments
 (0)