Skip to content

Commit 380487a

Browse files
authored
Merge pull request #13829 from ethereum/gradients
Design system, gradient updates
2 parents 81e45fe + 01b4523 commit 380487a

27 files changed

+193
-267
lines changed

public/content/contributing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Before contributing, make sure you're familiar with:
6868
- our [style guide](/contributing/style-guide/)
6969
- our [code of conduct](/community/code-of-conduct)
7070

71-
<ContributorsQuizBanner mt={16} mb={8} />
71+
<ContributorsQuizBanner className="mt-16 mb-8" />
7272

7373
## How decisions about the site are made {#how-decisions-about-the-site-are-made}
7474

public/content/translations/it/contributing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Prima di contribuire, assicurati di avere familiarità con:
6868
- la nostra [guida di stile](/contributing/style-guide/)
6969
- il nostro [codice di condotta](/community/code-of-conduct)
7070

71-
<ContributorsQuizBanner mt={16} mb={8} />
71+
<ContributorsQuizBanner className="mt-16 mb-8" />
7272

7373
## Come vengono prese le decisioni sul sito {#how-decisions-about-the-site-are-made}
7474

public/content/translations/ja/contributing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ethereum.orgは、オープンソースで運営されているプロジェク
6868
- [スタイルガイド](/contributing/style-guide/)
6969
- [行動規範](/community/code-of-conduct)
7070

71-
<ContributorsQuizBanner mt={16} mb={8} />
71+
<ContributorsQuizBanner className="mt-16 mb-8" />
7272

7373
## サイトに関する決定 {#how-decisions-about-the-site-are-made}
7474

public/content/translations/zh-tw/contributing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Ethereum.org 是一個開源專案,擁有超過 **12000 名**貢獻者,幫
6868
- 我們的[風格指南](/contributing/style-guide/)
6969
- 我們的[行為準則](/community/code-of-conduct)
7070

71-
<ContributorsQuizBanner mt={16} mb={8} />
71+
<ContributorsQuizBanner className="mt-16 mb-8" />
7272

7373
## 如何做出有關網站的決定 {#how-decisions-about-the-site-are-made}
7474

src/components/Banners/ContributorsQuizBanner.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
import { Box, Flex, FlexProps, Heading, Text } from "@chakra-ui/react"
1+
import { Box, Flex, Heading, Text } from "@chakra-ui/react"
22

33
import { Image } from "@/components/Image"
44

5+
import { cn } from "@/lib/utils/cn"
6+
57
import { ButtonLink } from "../Buttons"
68

79
import PeopleLearning from "@/public/images/people-learning.png"
810

911
// TODO: refactor to use CalloutBanner component
10-
function ContributorsQuizBanner(props: FlexProps) {
12+
function ContributorsQuizBanner(props: React.HTMLAttributes<HTMLDivElement>) {
1113
return (
12-
<Flex
13-
as="aside"
14-
flexDir={{ base: "column", md: "row-reverse" }}
15-
bg="layer2Gradient"
16-
borderRadius="base"
14+
<aside
15+
className={cn(
16+
"flex flex-col rounded md:flex-row",
17+
"bg-gradient-to-r from-accent-a/10 to-accent-c/10 dark:from-accent-a/20 dark:to-accent-c-hover/20"
18+
)}
1719
{...props}
1820
>
1921
<Flex
@@ -57,7 +59,7 @@ function ContributorsQuizBanner(props: FlexProps) {
5759
</ButtonLink>
5860
</Box>
5961
</Flex>
60-
</Flex>
62+
</aside>
6163
)
6264
}
6365

src/components/CalloutBanner.tsx

Lines changed: 27 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { useTranslation } from "next-i18next"
2-
import { Flex, type FlexProps } from "@chakra-ui/react"
32

43
import type { TranslationKey } from "@/lib/types"
54

6-
import { Image, type ImageProps } from "@/components/Image"
7-
import OldHeading from "@/components/OldHeading"
8-
import Text from "@/components/OldText"
5+
import { type ImageProps, TwImage } from "@/components/Image"
96

10-
export type CalloutBannerProps = FlexProps & {
11-
children?: React.ReactNode
7+
import { cn } from "@/lib/utils/cn"
8+
9+
export type CalloutBannerProps = React.HTMLAttributes<HTMLDivElement> & {
1210
image: ImageProps["src"]
1311
imageWidth?: number
1412
titleKey: TranslationKey
@@ -23,57 +21,39 @@ const CalloutBanner = ({
2321
descriptionKey,
2422
alt,
2523
children,
24+
className,
2625
...props
2726
}: CalloutBannerProps) => {
2827
const { t } = useTranslation("page-staking")
2928

3029
return (
31-
<Flex
32-
as="aside"
33-
direction={{ base: "column", lg: "row-reverse" }}
34-
bg="layer2Gradient"
35-
p={{ base: 8, sm: 12 }}
36-
borderRadius="base"
30+
<aside
31+
className={cn(
32+
"flex flex-col rounded p-8 sm:p-12 lg:flex-row-reverse",
33+
"bg-gradient-to-r from-accent-a/10 to-accent-c/10 dark:from-accent-a/20 dark:to-accent-c-hover/20",
34+
className
35+
)}
3736
{...props}
3837
>
39-
{image && (
40-
<Flex>
41-
<Image
42-
src={image}
43-
alt={alt}
44-
width={imageWidth}
45-
style={{
46-
objectFit: "contain",
47-
}}
48-
mx="auto"
49-
mt={-24}
50-
mb={{ base: 0, lg: -24 }}
51-
/>
52-
</Flex>
53-
)}
54-
<Flex
55-
flexGrow={1}
56-
flexShrink={0}
57-
flexBasis="50%"
58-
direction="column"
59-
justifyContent="center"
60-
ps={{ base: 0, sm: 4, lg: 8 }}
61-
w={{ base: "full", lg: "inherit" }}
62-
>
63-
<OldHeading
64-
as="h2"
65-
mt={0}
66-
fontSize={{ base: "2xl", sm: "2rem" }}
67-
lineHeight="1.4"
68-
>
38+
<div className="flex">
39+
<TwImage
40+
src={image}
41+
alt={alt}
42+
width={imageWidth}
43+
className="-my-24 mx-auto object-contain max-lg:mb-0"
44+
/>
45+
</div>
46+
47+
<div className="flex w-full flex-shrink-0 flex-grow basis-1/2 flex-col justify-center sm:ps-4 lg:w-[inherit] lg:ps-8">
48+
<h2 className="mb-8 text-2xl leading-xs sm:text-[2rem]">
6949
{t(titleKey)}
70-
</OldHeading>
71-
<Text fontSize="xl" w="90%" lineHeight="140%" mb={8} color="text200">
50+
</h2>
51+
<p className="mb-8 w-[90%] text-xl text-body-medium">
7252
{t(descriptionKey)}
73-
</Text>
53+
</p>
7454
{children}
75-
</Flex>
76-
</Flex>
55+
</div>
56+
</aside>
7757
)
7858
}
7959

src/components/Layer2/Layer2Onboard.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type { ChildOnlyProp } from "@/lib/types"
1313

1414
import { Image } from "@/components/Image"
1515

16+
import { cn } from "@/lib/utils/cn"
1617
import { trackCustomEvent } from "@/lib/utils/matomo"
1718

1819
// Data
@@ -213,7 +214,12 @@ const Layer2Onboard = ({
213214
}
214215

215216
return (
216-
<Box bg="layer2Gradient" borderRadius="sm" p={10}>
217+
<div
218+
className={cn(
219+
"rounded-sm p-10",
220+
"bg-gradient-to-r from-accent-a/10 to-accent-c/10 dark:from-accent-a/20 dark:to-accent-c-hover/20"
221+
)}
222+
>
217223
<Box textAlign="center" maxW="75ch" m="auto">
218224
<OldHeading
219225
fontSize={{ base: "2xl", md: "2rem" }}
@@ -347,7 +353,7 @@ const Layer2Onboard = ({
347353
/>
348354
</Box>
349355
</SimpleGrid>
350-
</Box>
356+
</div>
351357
)
352358
}
353359

src/components/Staking/StakingCommunityCallout.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import React from "react"
12
import { useTranslation } from "next-i18next"
2-
import { Flex, type FlexProps } from "@chakra-ui/react"
3+
import { Flex } from "@chakra-ui/react"
34

45
import { ButtonLink } from "@/components/Buttons"
56
import CalloutBanner from "@/components/CalloutBanner"
@@ -8,9 +9,10 @@ import { trackCustomEvent } from "@/lib/utils/matomo"
89

910
import image from "@/public/images/enterprise-eth.png"
1011

11-
export type StakingCommunityCalloutProps = FlexProps & {
12-
id?: string
13-
}
12+
export type StakingCommunityCalloutProps =
13+
React.HTMLAttributes<HTMLDivElement> & {
14+
id?: string
15+
}
1416

1517
const StakingCommunityCallout = (props: StakingCommunityCalloutProps) => {
1618
const { t } = useTranslation("page-staking")

src/components/Staking/StakingComparison.tsx

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useTranslation } from "next-i18next"
2-
import { Box, Flex, Heading, useTheme } from "@chakra-ui/react"
2+
import { Box, Heading, useTheme } from "@chakra-ui/react"
33

44
import type { StakingPage, TranslationKey } from "@/lib/types"
55

@@ -12,8 +12,11 @@ import InlineLink from "@/components/Link"
1212
import OldHeading from "@/components/OldHeading"
1313
import Text from "@/components/OldText"
1414

15+
import { cn } from "@/lib/utils/cn"
1516
import { MatomoEventOptions, trackCustomEvent } from "@/lib/utils/matomo"
1617

18+
import { Flex } from "../ui/flex"
19+
1720
interface DataType {
1821
title: TranslationKey
1922
linkText: TranslationKey
@@ -112,33 +115,20 @@ const StakingComparison = ({ page, className }: StakingComparisonProps) => {
112115

113116
return (
114117
<Flex
115-
direction="column"
116-
gap={8}
117-
bg="linear-gradient(
118-
83.46deg,
119-
rgba(127, 127, 213, 0.2) 7.03%,
120-
rgba(138, 168, 231, 0.2) 52.42%,
121-
rgba(145, 234, 228, 0.2) 98.77%
122-
)"
123-
py={8}
124-
px={{ base: 6, md: 8 }}
125-
mt={16}
126-
className={className}
118+
className={cn(
119+
"mt-16 flex-col gap-8 px-6 py-8 md:px-8",
120+
"bg-gradient-to-r from-accent-a/10 to-accent-c/10 dark:from-accent-a/20 dark:to-accent-c-hover/20",
121+
className
122+
)}
127123
>
128124
<OldHeading fontSize="2rem">
129125
{t("page-staking-comparison-with-other-options")}
130126
</OldHeading>
131127
{selectedData.map(
132128
({ title, linkText, href, color, content, glyph, matomo }, idx) => (
133-
<Flex gap={6} direction={{ base: "column", md: "row" }} key={idx}>
129+
<Flex className="flex-col gap-6 md:flex-row" key={idx}>
134130
{!!glyph && (
135-
<Flex
136-
direction="column"
137-
justify="flex-start"
138-
align="center"
139-
w={12}
140-
maxH={12}
141-
>
131+
<Flex className="max-h-12 w-12 flex-col items-center justify-start">
142132
{glyph}
143133
</Flex>
144134
)}

src/components/Staking/StakingLaunchpadWidget.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { useState } from "react"
22
import { useTranslation } from "next-i18next"
33
import { FaTools } from "react-icons/fa"
4-
import { Box, Flex } from "@chakra-ui/react"
4+
import { Box } from "@chakra-ui/react"
55

66
import { ButtonLink } from "@/components/Buttons"
77
import Text from "@/components/OldText"
88
import Translation from "@/components/Translation"
99

10+
import { cn } from "@/lib/utils/cn"
1011
import { trackCustomEvent } from "@/lib/utils/matomo"
1112

13+
import { Flex } from "../ui/flex"
1214
import Select, { type SelectOnChange } from "../ui/Select"
1315

1416
type StakingDataOption = { label: string; value: string }
@@ -47,10 +49,10 @@ const StakingLaunchpadWidget = () => {
4749

4850
return (
4951
<Flex
50-
bg="layer2Gradient"
51-
borderRadius="base"
52-
flexDir="column"
53-
p={{ base: 6, md: 8 }}
52+
className={cn(
53+
"flex-col rounded p-6 md:p-8",
54+
"bg-gradient-to-r from-accent-a/10 to-accent-c/10 dark:from-accent-a/20 dark:to-accent-c-hover/20"
55+
)}
5456
>
5557
<Text as="span" color="text200">
5658
<Translation id="page-staking:page-staking-launchpad-widget-span" />

0 commit comments

Comments
 (0)