Skip to content

Commit

Permalink
Merge pull request #1343 from scroll-tech/governance
Browse files Browse the repository at this point in the history
For Multichain SDK
  • Loading branch information
Holybasil authored Oct 31, 2024
2 parents d424519 + 11ca24a commit 26ab304
Show file tree
Hide file tree
Showing 50 changed files with 494 additions and 6,225 deletions.
1 change: 0 additions & 1 deletion public/imgs/career/career-bg.svg

This file was deleted.

Binary file added public/imgs/career/career-header-bg.webp
Binary file not shown.
526 changes: 0 additions & 526 deletions public/imgs/ecosystem/ecosystem-bg-mobile.svg

This file was deleted.

Binary file added public/imgs/ecosystem/ecosystem-bg-mobile.webp
Binary file not shown.
Binary file removed public/imgs/ecosystem/ecosystem-bg.png
Binary file not shown.
1,182 changes: 0 additions & 1,182 deletions public/imgs/ecosystem/ecosystem-bg.svg

This file was deleted.

Binary file added public/imgs/ecosystem/ecosystem-bg.webp
Binary file not shown.
789 changes: 0 additions & 789 deletions public/imgs/ecosystem/new-ecosystem-bg-mobile.svg

This file was deleted.

654 changes: 0 additions & 654 deletions public/imgs/ecosystem/new-ecosystem-bg-tablet.svg

This file was deleted.

1,172 changes: 0 additions & 1,172 deletions public/imgs/ecosystem/new-ecosystem-bg.svg

This file was deleted.

Binary file added public/imgs/homepage/landing-bg-mobile.webp
Binary file not shown.
Binary file added public/imgs/homepage/landing-bg.webp
Binary file not shown.
1 change: 0 additions & 1 deletion public/imgs/homepage/section_1_bg.svg

This file was deleted.

1,215 changes: 0 additions & 1,215 deletions public/imgs/homepage/section_1_bg_mobile.svg

This file was deleted.

Binary file added public/videos/ecosystem-header-bg-264.mp4
Binary file not shown.
Binary file added public/videos/ecosystem-header-bg.mp4
Binary file not shown.
Binary file added public/videos/home-header-bg-264.mp4
Binary file not shown.
Binary file added public/videos/home-header-bg.mp4
Binary file not shown.
Binary file added src/assets/images/home/feature-img-1.webp
Binary file not shown.
Binary file added src/assets/images/home/feature-img-2.webp
Binary file not shown.
Binary file removed src/assets/images/home/feature_icon_1.png
Binary file not shown.
Binary file removed src/assets/images/home/feature_icon_2.png
Binary file not shown.
Binary file removed src/assets/images/home/feature_icon_3.png
Binary file not shown.
Binary file removed src/assets/images/home/feature_icon_4.png
Binary file not shown.
3 changes: 3 additions & 0 deletions src/assets/svgs/community/arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/svgs/header/Discord.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/svgs/header/SDK.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/components/Header/SubmenuLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const SubmenuLink = ({
icon,
dark,
reload,
onClick,
}: {
label: string
text?: string
Expand All @@ -103,14 +104,15 @@ const SubmenuLink = ({
icon?: any
dark?: boolean
reload?: boolean
onClick?: () => {}
}) => (
<>
{isExternal ? (
<StyledLink dark={dark} href={href} target="_blank" rel="noopener noreferrer">
<StyledLink dark={dark} href={href} onClick={onClick} target="_blank" rel="noopener noreferrer">
<SubmenuLinkContent icon={icon} label={label} text={text} isExternal={isExternal} />
</StyledLink>
) : (
<StyledNavLink dark={dark} to={href} reloadDocument={reload}>
<StyledNavLink dark={dark} to={href} onClick={onClick} reloadDocument={reload}>
<SubmenuLinkContent icon={icon} label={label} text={text} isExternal={isExternal} />
</StyledNavLink>
)}
Expand Down
111 changes: 68 additions & 43 deletions src/components/Header/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ReactComponent as HomeSvg } from "@/assets/svgs/header/Home.svg"
import { ReactComponent as IssuesSvg } from "@/assets/svgs/header/Issues.svg"
import { ReactComponent as LevelUpSvg } from "@/assets/svgs/header/LevelUp.svg"
import { ReactComponent as ProjectsSvg } from "@/assets/svgs/header/Projects.svg"
import { ReactComponent as SDKSvg } from "@/assets/svgs/header/SDK.svg"
import { ReactComponent as SessionsSvg } from "@/assets/svgs/header/Sessions.svg"
import { ReactComponent as StatusSvg } from "@/assets/svgs/header/Status.svg"
import { isSepolia, requireEnv } from "@/utils"
Expand Down Expand Up @@ -98,55 +99,79 @@ const mainnetNavigations = [
children: [
{
label: "",
type: "grid",
children: [
{
text: "Mainnet Deployment",
label: "Let’s go live now!",
key: "mainnet-resources",
rootKey: "develop",
href: "/portal",
icon: EthereumSvg,
},
{
label: "Try and test it out",
text: "Sepolia Testnet",
key: "sepolia-resources",
rootKey: "develop",
href: "https://sepolia.scroll.io/portal",
isExternal: true,
icon: BuildSvg,
label: "DEPLOY AN APP",
items: [
{
text: "Mainnet Deployment",
label: "Let’s go live now!",
key: "mainnet-resources",
rootKey: "develop",
href: "/portal",
icon: EthereumSvg,
},
{
label: "Try and test it out",
text: "Sepolia Testnet",
key: "sepolia-resources",
rootKey: "develop",
href: "https://sepolia.scroll.io/portal",
isExternal: true,
icon: BuildSvg,
},
{
label: "Understand all the details to build",
text: "Docs",
key: "docs",
href: "https://docs.scroll.io/en/home/",
isExternal: true,
icon: DocsSvg,
},
{
label: "Scroll network health indicator",
text: "Status",
key: "status",
href: "https://status.scroll.io/",
isExternal: true,
icon: StatusSvg,
},
],
},
{
label: "Understand all the details to build",
text: "Docs",
key: "docs",
href: "https://docs.scroll.io/en/home/",
isExternal: true,
icon: DocsSvg,
label: "DEPLOY A CHAIN",
items: [
{
label: "Own your blockspace",
text: "Scroll SDK",
key: "sdk",
href: "https://docs.scroll.io/en/sdk",
isExternal: true,
icon: SDKSvg,
},
],
},
{
label: "Scroll network health indicator",
text: "Status",
key: "status",
href: "https://status.scroll.io/",
isExternal: true,
icon: StatusSvg,
},
{
label: "Learn, build and innovate",
text: "Level Up",
key: "lelvel-up",
href: "https://levelupweb3.xyz",
isExternal: true,
icon: LevelUpSvg,
},
{
label: "Help Scroll get better",
text: "Bug Bounty",
key: "bug-bounty",
href: "https://immunefi.com/bounty/scroll/",
isExternal: true,
icon: IssuesSvg,
label: "MORE",
items: [
{
label: "Learn, build and innovate",
text: "Level Up",
key: "lelvel-up",
href: "https://levelupweb3.xyz",
isExternal: true,
icon: LevelUpSvg,
},
{
label: "Help Scroll get better",
text: "Bug Bounty",
key: "bug-bounty",
href: "https://immunefi.com/bounty/scroll/",
isExternal: true,
icon: IssuesSvg,
},
],
},
],
},
Expand Down
53 changes: 43 additions & 10 deletions src/components/Header/desktop_header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const SubMenuList = styled(Box)(({ theme }) => ({
const SectionList = styled<any>(Box, { shouldForwardProp: prop => prop !== "dark" })(({ theme, dark }) => ({
display: "flex",
flexDirection: "column",
width: "100%",
flex: 1,
gap: "1.6rem",
"&:nth-of-type(n+2)": {
borderLeft: `1px solid ${theme.palette.text.primary}`,
Expand Down Expand Up @@ -149,19 +149,44 @@ const App = ({ currentMenu }) => {
setAnchorEl(null)
}

const handleResetIsHover = () => {
setIsHover(false)
}

const renderSubMenuList = children => {
return children.map((section, idx) => (
<SectionList key={idx} dark={dark}>
{section.label && (
<Typography sx={{ fontSize: "1.4rem", fontWeight: "bold", lineHeight: "2rem", color: "text.primary" }}>{section.label}</Typography>
)}

{section.children
// only show sub menu item when the href is set
?.filter(subItem => subItem.href)
.map(subItem => (
<SubmenuLink key={subItem.label} {...subItem}></SubmenuLink>
))}
{section.type === "grid" ? (
<Box
sx={{
display: "grid",
gridTemplateColumns: "repeat(2, min-content)",
gridTemplateRows: "1fr min-content",
columnGap: "2.4rem",
}}
>
{section.children.map((item, index) => (
<Stack direction="column" spacing="2.4rem" sx={{ gridRow: !index ? "1/3" : "unset", height: "min-content" }}>
<Typography sx={{ fontSize: "1.4rem", fontWeight: 700 }}>{item.label}</Typography>
{item.items.map(item => (
<SubmenuLink key={item.label} {...item} onClick={handleResetIsHover}></SubmenuLink>
))}
</Stack>
))}
</Box>
) : (
<>
{section.children
// only show sub menu item when the href is set
?.filter(subItem => subItem.href)
.map(subItem => (
<SubmenuLink key={subItem.label} {...subItem} onClick={handleResetIsHover}></SubmenuLink>
))}
</>
)}
</SectionList>
))
}
Expand All @@ -172,7 +197,6 @@ const App = ({ currentMenu }) => {
<SubMenuButton
direction="row"
alignItems="center"
// spacing="6px"
dark={dark}
className={currentMenu === item.key ? "active" : ""}
onMouseEnter={e => handleMouseEnter(e, item.key)}
Expand Down Expand Up @@ -240,7 +264,16 @@ const App = ({ currentMenu }) => {
}

return (
<StyledBox bgColor={navbarBg} dark={dark} onMouseEnter={() => setIsHover(true)} onMouseLeave={() => setIsHover(false)}>
<StyledBox
bgColor={navbarBg}
dark={dark}
onMouseEnter={() => {
setIsHover(true)
}}
onMouseLeave={e => {
setIsHover(false)
}}
>
<Announcement />
<Container>
<HeaderContainer>
Expand Down
30 changes: 24 additions & 6 deletions src/components/Header/mobile_header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,30 @@ const App = ({ currentMenu }) => {
{section.label}
</Typography>
)}
{section.children
// only show sub items with href
?.filter(subItem => subItem.href)
.map(subItem => (
<SubmenuLink key={subItem.label} dark={dark} {...subItem}></SubmenuLink>
))}
{section.type === "grid" ? (
<Stack direction="column" spacing="2rem">
{section.children.map((item, index) => (
<Stack direction="column" spacing="1.6rem">
{/* <Divider textAlign="left" sx={{ color: "text.primary", }}>
{item.label}
</Divider> */}
<Typography sx={{ fontSize: "1.4rem", fontWeight: 700 }}>{item.label}</Typography>
{item.items.map(item => (
<SubmenuLink key={item.label} {...item}></SubmenuLink>
))}
</Stack>
))}
</Stack>
) : (
<>
{section.children
// only show sub items with href
?.filter(subItem => subItem.href)
.map(subItem => (
<SubmenuLink key={subItem.label} dark={dark} {...subItem}></SubmenuLink>
))}
</>
)}
</SectionList>
))}
</List>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/useCheckCustomNavBarBg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useLocation } from "react-router-dom"

import useScrollTrigger from "@mui/material/useScrollTrigger"

const TRANSPARENT_BG_PAGE_LIST = ["/story", "/sessions"]
const TRANSPARENT_BG_PAGE_LIST = ["/", "/ecosystem", "/story", "/sessions"]
// themeBackground
const CUSTOM_BG_PAGE_MAP = {
"/brand-kit": "brand",
Expand Down
10 changes: 7 additions & 3 deletions src/components/Motion/OrientationToView.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { motion } from "framer-motion"

import { Box } from "@mui/material"

import useCheckViewport from "@/hooks/useCheckViewport"

const MotionBox = motion(Box)

const OrientationToView = props => {
const { children, direction = "up", once = true, delay, ...restProps } = props

Expand Down Expand Up @@ -49,16 +53,16 @@ const OrientationToView = props => {
},
}
return (
<motion.div
<MotionBox
initial="hidden"
whileInView="show"
variants={variants[direction]}
viewport={{ once, amount: isPortrait ? 0.3 : 1 }}
viewport={{ once, amount: isPortrait ? 0.2 : 0.8 }}
transition={{ ease: [0.16, 1, 0.3, 1], duration: 1, delay }}
{...restProps}
>
{children}
</motion.div>
</MotionBox>
)
}

Expand Down
Loading

0 comments on commit 26ab304

Please sign in to comment.