Skip to content

Commit 958e270

Browse files
committed
Merge branch 'dev' into Shadcn_Migrate_eth.tsx
2 parents 6c8e1b9 + 25430bc commit 958e270

28 files changed

+708
-694
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ethereum-org-website",
3-
"version": "9.4.1",
3+
"version": "9.4.2",
44
"license": "MIT",
55
"private": true,
66
"scripts": {
@@ -36,6 +36,7 @@
3636
"@hookform/resolvers": "^3.8.0",
3737
"@next/bundle-analyzer": "^14.2.5",
3838
"@radix-ui/react-accordion": "^1.2.0",
39+
"@radix-ui/react-avatar": "^1.1.2",
3940
"@radix-ui/react-checkbox": "^1.1.1",
4041
"@radix-ui/react-compose-refs": "^1.1.0",
4142
"@radix-ui/react-dialog": "^1.1.1",

public/images/0xparc-logo.svg

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

src/components/Card/index.tsx

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
import { ReactNode } from "react"
2-
import { Heading, Stack, StackProps, Text } from "@chakra-ui/react"
32

43
import Emoji from "@/components/Emoji"
54

6-
export type CardProps = Omit<StackProps, "children" | "title"> & {
5+
import { cn } from "@/lib/utils/cn"
6+
7+
export type CardProps = {
78
children?: ReactNode
89
emoji?: string
910
title?: ReactNode
1011
description?: ReactNode
12+
className?: string
1113
}
1214

13-
const Card = ({ emoji, title, description, children, ...props }: CardProps) => (
14-
<Stack
15-
spacing="4"
16-
justifyContent="space-between"
17-
bg="ednBackground"
18-
borderRadius="sm"
19-
border="1px"
20-
borderStyle="solid"
21-
borderColor="lightBorder"
22-
p="6"
15+
const Card = ({
16+
emoji,
17+
title,
18+
description,
19+
children,
20+
className,
21+
...props
22+
}: CardProps) => (
23+
<div
24+
className={cn(
25+
"flex flex-col justify-between space-y-4",
26+
"rounded-sm bg-background-highlight",
27+
"border border-solid",
28+
"p-6",
29+
className
30+
)}
2331
{...props}
2432
>
25-
<Stack spacing="4">
33+
<div className="flex flex-col space-y-4">
2634
{emoji && <Emoji className="text-5xl leading-none" text={emoji} />}
27-
<Stack spacing="8">
28-
{title && (
29-
<Heading as="h3" fontSize="2xl">
30-
{title}
31-
</Heading>
32-
)}
33-
{description && <Text>{description}</Text>}
34-
</Stack>
35-
</Stack>
35+
<div className="flex flex-col space-y-8">
36+
{title && <h3 className="text-2xl leading-[1.4]">{title}</h3>}
37+
{description && <p>{description}</p>}
38+
</div>
39+
</div>
3640
{children}
37-
</Stack>
41+
</div>
3842
)
3943

4044
export default Card

src/components/Trilemma/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ const Trilemma = () => {
3535
{t("page-roadmap-vision-trilemma-modal-tip")}:
3636
</p>
3737
</VStack>
38-
<Card {...cardDetail} minH="300px" hideBelow="lg" mt="6" />
38+
<Card {...cardDetail} className="mt-6 hidden min-h-[300px] lg:block" />
3939
</Stack>
4040
<Sheet open={mobileModalOpen} onOpenChange={handleModalClose}>
4141
<SheetContent side="bottom" className="rounded-t-[16px]">
42-
<Card {...cardDetail} background="none" border="none" my="8" />
42+
<Card {...cardDetail} className="my-8 border-none bg-transparent" />
4343
<SheetClose className="absolute right-3 top-5">
4444
<span className="sr-only">Close</span>
4545
<svg

src/components/Avatar/Avatar.stories.tsx renamed to src/components/ui/__stories__/Avatar.stories.tsx

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import * as React from "react"
2-
import { AvatarGroup, HStack, VStack } from "@chakra-ui/react"
3-
import { Meta, StoryObj } from "@storybook/react"
1+
import type { Meta, StoryObj } from "@storybook/react"
42

5-
import Avatar from "."
3+
import { Avatar, AvatarGroup } from "../avatar"
4+
import { HStack, VStack } from "../flex"
65

76
const meta = {
87
title: "Atoms / Media & Icons / Avatars",
@@ -15,13 +14,13 @@ type Story = StoryObj<typeof meta>
1514

1615
export const Single: Story = {
1716
args: {
18-
name: "Dan Abrahmov",
17+
name: "dan abrahmov",
1918
src: "https://bit.ly/dan-abramov",
2019
href: "#",
2120
},
2221
render: (args) => (
23-
<VStack spacing={4}>
24-
{["lg", "md", "sm", "xs"].map((size) => (
22+
<VStack className="gap-4">
23+
{(["lg", "md", "sm", "xs"] as const).map((size) => (
2524
<Avatar key={size} size={size} {...args} />
2625
))}
2726
</VStack>
@@ -35,12 +34,12 @@ export const Group: Story = {
3534
href: "#",
3635
},
3736
render: (args) => (
38-
<VStack spacing={4}>
39-
{["sm", "xs"].map((size) => (
37+
<VStack className="gap-4">
38+
{(["sm", "xs"] as const).map((size) => (
4039
<AvatarGroup key={size} size={size} max={3}>
41-
<Avatar {...args} />
42-
<Avatar {...args} />
43-
<Avatar {...args} />
40+
<Avatar dataTest="one" {...args} />
41+
<Avatar dataTest="two" {...args} />
42+
<Avatar dataTest="three" {...args} />
4443
<Avatar {...args} />
4544
</AvatarGroup>
4645
))}
@@ -51,19 +50,19 @@ export const Group: Story = {
5150
export const WithUsername: Story = {
5251
args: {
5352
name: "Dan Abrahmov",
54-
src: "https://bit.ly/dan-abramov",
55-
href: "#",
53+
src: "http://bit.ly/dan-abramov",
54+
href: "http://bit.ly/dan-abramov",
5655
label: "daneabrahmov",
5756
},
5857
render: (args) => (
59-
<HStack spacing={16}>
58+
<HStack className="gap-4">
6059
<VStack>
61-
{["md", "sm"].map((size, idx) => (
60+
{(["md", "sm", "xs"] as const).map((size, idx) => (
6261
<Avatar key={idx} size={size} {...args} />
6362
))}
6463
</VStack>
6564
<VStack>
66-
{["md", "sm"].map((size, idx) => (
65+
{(["md", "sm", "xs"] as const).map((size, idx) => (
6766
<Avatar key={idx} size={size} direction="column" {...args} />
6867
))}
6968
</VStack>

0 commit comments

Comments
 (0)