Skip to content

Commit 519882e

Browse files
committed
Merge branch 'dev' into code-accordion
2 parents 29e2672 + 8c3b481 commit 519882e

Some content is hidden

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

45 files changed

+654
-674
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/desci/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ We welcome suggestions for new projects to list - please look at our [listing po
127127
- [DeSci: The Future of Research by Samuel Akinosho](https://lucidsamuel.medium.com/desci-the-future-of-research-b76cfc88c8ec)
128128
- [Science Funding (Epilogue: DeSci and new crypto primitives) by Nadia](https://nadia.xyz/science-funding)
129129
- [Decentralisation is Disrupting Drug Development](https://medium.com/id-theory/decentralisation-is-disrupting-drug-development-28b5ba5d447f)
130+
- [What Is DeSci – Decentralized Science?](​https://usadailytimes.com/2022/09/12/what-is-desci-decentralized-science/)
130131

131132
### Videos {#videos}
132133

@@ -135,3 +136,4 @@ We welcome suggestions for new projects to list - please look at our [listing po
135136
- [Scientific Publishing Is Broken. Can Web3 Fix It?](https://www.youtube.com/watch?v=WkvzYgCvWj8)
136137
- [Juan Benet - DeSci, Independent Labs, & Large Scale Data Science](https://www.youtube.com/watch?v=zkXM9H90g_E)
137138
- [Sebastian Brunemeier - How DeSci Can Transform Biomedical Research & Venture Capital](https://www.youtube.com/watch?v=qB4Tc3FcVbM)
139+
- [Paige Donner - Tooling Open Science with Web3 & The Blockchain](https://www.youtube.com/watch?v=nC-2QWQ-lgw&t=17s)

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/Glossary/GlossaryDefinition/index.tsx

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { ComponentProps } from "react"
2-
import { type HeadingProps, Text, VStack } from "@chakra-ui/react"
32

4-
import Heading from "@/components/Heading"
53
import IdAnchor from "@/components/IdAnchor"
6-
import InlineLink from "@/components/Link"
74
import Translation from "@/components/Translation"
5+
import { Stack } from "@/components/ui/flex"
6+
import InlineLink from "@/components/ui/Link"
7+
8+
import { cn } from "@/lib/utils/cn"
89

910
import { DEFAULT_GLOSSARY_NS } from "@/lib/constants"
1011

@@ -25,42 +26,30 @@ const GlossaryDefinition = ({
2526
size = "md",
2627
options = { ns: DEFAULT_GLOSSARY_NS },
2728
}: GlossaryDefinitionProps) => {
28-
const textStyles = size === "sm" ? { mb: 0 } : {}
29-
30-
const headingPropsForAnchor = (id?: string): HeadingProps => {
31-
if (!id) return {}
32-
return {
33-
scrollMarginTop: 28,
34-
id,
35-
"data-group": true,
36-
position: "relative",
37-
} as HeadingProps
38-
}
29+
const textClasses = size === "sm" ? "mb-0" : ""
3930

4031
return (
41-
<VStack spacing={4} align="stretch" textAlign="start" mb={8}>
42-
<Heading size="md" {...headingPropsForAnchor(term)}>
32+
<Stack className="mb-8 items-stretch gap-4 text-start">
33+
<h4
34+
className={term ? "relative scroll-mt-28" : ""}
35+
{...(term ? { "data-group": true, id: term } : {})}
36+
>
4337
<IdAnchor id={term} />
4438
<Translation
4539
id={term + "-term"}
4640
options={options}
4741
transform={components}
4842
/>
49-
</Heading>
50-
{/**
51-
* `as="span"` prevents hydration warnings for strings that contain
52-
* elements that cannot be nested inside `p` tags, like `ul` tags
53-
* (found in some Glossary definition).
54-
* TODO: Develop a better solution to handle this case.
55-
*/}
56-
<Text as="span" {...textStyles}>
43+
</h4>
44+
45+
<div className={cn("inline-block", textClasses)}>
5746
<Translation
5847
id={term + "-definition"}
5948
options={options}
6049
transform={components}
6150
/>
62-
</Text>
63-
</VStack>
51+
</div>
52+
</Stack>
6453
)
6554
}
6655

src/components/Homepage/useBentoBox.ts

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ import MergeImage from "@/public/images/upgrades/merge.png"
1111
type Breakpoint = "mobile" | "lg" | "xl"
1212
type Direction = "down" | "up" | "right" | "left"
1313
type Color = "primary" | "accent-a" | "accent-b" | "accent-c"
14+
type Category = "stablecoins" | "defi" | "dapps" | "networks" | "assets"
15+
type CopyDetails = {
16+
title: string
17+
children: string
18+
action: string
19+
href: string
20+
}
1421

1522
const gradientStops = "from-20% to-60%"
1623

@@ -88,47 +95,39 @@ const getPosition = (position: number): string =>
8895
export const useBentoBox = () => {
8996
const { t } = useTranslation("page-index")
9097

98+
const getCopy = (category: Category, href: string): CopyDetails => ({
99+
title: t(`page-index:page-index-bento-${category}-title`),
100+
children: t(`page-index:page-index-bento-${category}-content`),
101+
action: t(`page-index:page-index-bento-${category}-action`),
102+
href,
103+
})
104+
91105
return [
92106
{
93-
title: t("page-index-bento-stablecoins-title"),
94-
children: t("page-index:page-index-bento-stablecoins-content"),
95-
action: t("page-index:page-index-bento-stablecoins-action"),
96-
href: "/stablecoins/",
97-
imgSrc: ImpactImage,
98-
imgWidth: 400,
107+
...getCopy("stablecoins", "/stablecoins/"),
108+
imgSrc: ManAndDogImage,
99109
className: cn(colorOptions["primary"], getPosition(0)),
100110
},
101111
{
102-
title: t("page-index:page-index-bento-defi-title"),
103-
children: t("page-index:page-index-bento-defi-content"),
104-
action: t("page-index:page-index-bento-defi-action"),
105-
href: "/defi/",
106-
imgSrc: ManAndDogImage,
112+
...getCopy("defi", "/defi/"),
113+
imgSrc: ImpactImage,
114+
imgWidth: 400,
107115
className: cn(colorOptions["accent-c"], getPosition(1)),
108116
},
109117
{
110-
title: t("page-index:page-index-bento-dapps-title"),
111-
children: t("page-index:page-index-bento-dapps-content"),
112-
action: t("page-index:page-index-bento-dapps-action"),
113-
href: "/dapps/",
118+
...getCopy("networks", "/layer-2/"),
114119
imgSrc: MergeImage,
115120
imgWidth: 320,
116121
className: cn(colorOptions["accent-b"], getPosition(2)),
117122
},
118123
{
119-
title: t("page-index:page-index-bento-networks-title"),
120-
children: t("page-index:page-index-bento-networks-content"),
121-
action: t("page-index:page-index-bento-networks-action"),
122-
href: "/layer-2/",
124+
...getCopy("dapps", "/dapps/"),
123125
imgSrc: ManBabyWomanImage,
124126
imgWidth: 324,
125127
className: cn(colorOptions["accent-a"], getPosition(3)),
126128
},
127129
{
128-
title: t("page-index:page-index-bento-assets-title"),
129-
children: t("page-index:page-index-bento-assets-content"),
130-
action: t("page-index:page-index-bento-assets-action"),
131-
href: "/nft/",
130+
...getCopy("assets", "/nft/"),
132131
imgSrc: RobotBarImage,
133132
imgWidth: 324,
134133
className: cn(colorOptions["primary"], getPosition(4)),

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

0 commit comments

Comments
 (0)