Skip to content

Commit df88eb8

Browse files
committed
feat(call to contribute): add calltocontribute story [#13733]
1 parent 81b80c6 commit df88eb8

File tree

5 files changed

+80
-6
lines changed

5 files changed

+80
-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 "../Buttons"
8+
import InlineLink from "../Link"
9+
import OldHeading from "../OldHeading"
10+
import Text from "../OldText"
11+
import Translation from "../Translation"
1212

1313
export type CallToContributeProps = {
1414
editPath: string

src/styles/global.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
/* ! Deprecating primary-pressed */
7575
--primary-pressed: var(--blue-400);
7676

77+
/* To be reviewed */
78+
--secondary: "#666666";
79+
7780
--body: var(--gray-800);
7881
--body-medium: var(--gray-500);
7982
--body-light: var(--gray-200);
@@ -143,6 +146,9 @@
143146
/* ! Deprecating primary-pressed */
144147
--primary-pressed: var(--orange-800);
145148

149+
/* To be reviewed */
150+
--secondary: "#b2b2b2";
151+
146152
--body: var(--gray-100);
147153
--body-medium: var(--gray-400);
148154
--body-light: var(--gray-600);
@@ -170,7 +176,7 @@
170176
/* ! Deprecating success-neutral */
171177
--success-neutral: var(--green-900);
172178

173-
/* Misc sematics: light mode */
179+
/* Misc sematics: dark mode */
174180
--tooltip-shadow: rgba(255, 255, 255, 0.24);
175181
--switch-background: rgba(255, 255, 255, 0.24);
176182
--hub-hero-content-bg: rgba(34, 34, 34, 0.8);
@@ -278,3 +284,10 @@
278284
}
279285
}
280286
}
287+
288+
/* styles for classes within markdown */
289+
@layer components {
290+
.citation p {
291+
@apply text-secondary;
292+
}
293+
}

tailwind.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ const config = {
113113
dark: "var(--primary-dark)",
114114
pressed: "var(--primary-pressed)",
115115
},
116+
secondary: {
117+
DEFAULT: "var(--secondary)",
118+
},
116119
body: {
117120
DEFAULT: "var(--body)",
118121
medium: "var(--body-medium)",

0 commit comments

Comments
 (0)