Skip to content

Commit 52161a6

Browse files
authored
Merge pull request #13782 from Baystef/feat/calltocontribute-story
Create story tests for CallToContribute component [#13733]
2 parents 79e057d + 3787b30 commit 52161a6

File tree

4 files changed

+64
-6
lines changed

4 files changed

+64
-6
lines changed

.storybook/i18next.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const ns = [
2222
"page-developers-index",
2323
"page-what-is-ethereum",
2424
"page-upgrades-index",
25+
"page-developers-docs",
2526
] as const
2627
const supportedLngs = Object.keys(baseLocales)
2728

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { Meta, StoryObj } from "@storybook/react"
2+
3+
import { ChildOnlyProp } from "@/lib/types"
4+
5+
import { langViewportModes } from "../../../.storybook/modes"
6+
7+
import CallToContributeComponent from "."
8+
9+
const meta = {
10+
title: "Molecules / Navigation / CallToContribute",
11+
component: CallToContributeComponent,
12+
args: {
13+
editPath:
14+
"https://github.com/ethereum/ethereum-org-website/tree/dev/public/content/developers/docs/index.md",
15+
},
16+
parameters: {
17+
layout: "fullscreen",
18+
chromatic: {
19+
modes: {
20+
...langViewportModes,
21+
},
22+
},
23+
},
24+
decorators: [
25+
(Story) => (
26+
<ContentContainer>
27+
<Content>
28+
<Story />
29+
</Content>
30+
</ContentContainer>
31+
),
32+
],
33+
} satisfies Meta<typeof CallToContributeComponent>
34+
35+
export default meta
36+
37+
type Story = StoryObj<typeof meta>
38+
39+
const ContentContainer = (props: ChildOnlyProp) => {
40+
return (
41+
<div
42+
className="flex w-full justify-between bg-background-highlight py-0 ps-0 lg:pe-8"
43+
{...props}
44+
/>
45+
)
46+
}
47+
48+
const Content = (props: ChildOnlyProp) => {
49+
return (
50+
<div
51+
className="mx-auto w-full flex-1 px-8 pb-8 pt-8 md:px-16 md:pb-16 md:pt-12 lg:w-0"
52+
{...props}
53+
/>
54+
)
55+
}
56+
57+
export const CallToContribute: Story = {}

src/components/CallToContribute.tsx renamed to src/components/CallToContribute/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { Flex, FlexProps, Icon } from "@chakra-ui/react"
44

55
import { ChildOnlyProp } from "@/lib/types"
66

7-
import { ButtonLink } from "./Buttons"
8-
import InlineLink from "./Link"
9-
import OldHeading from "./OldHeading"
10-
import Text from "./OldText"
11-
import Translation from "./Translation"
7+
import { ButtonLink } from "@/components/Buttons"
8+
import InlineLink from "@/components/Link"
9+
import OldHeading from "@/components/OldHeading"
10+
import Text from "@/components/OldText"
11+
import Translation from "@/components/Translation"
1212

1313
export type CallToContributeProps = {
1414
editPath: string

src/styles/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
/* ! Deprecating success-neutral */
171171
--success-neutral: var(--green-900);
172172

173-
/* Misc sematics: light mode */
173+
/* Misc sematics: dark mode */
174174
--tooltip-shadow: rgba(255, 255, 255, 0.24);
175175
--switch-background: rgba(255, 255, 255, 0.24);
176176
--hub-hero-content-bg: rgba(34, 34, 34, 0.8);

0 commit comments

Comments
 (0)