Skip to content

Commit ac5daf5

Browse files
authored
Merge pull request #255 from TylerAPfledderer/refactor/stories
Refactor/stories
2 parents b72d7b9 + b23d3a3 commit ac5daf5

File tree

7 files changed

+659
-824
lines changed

7 files changed

+659
-824
lines changed

.storybook/main.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,14 @@ import { propNames } from "@chakra-ui/react"
1515
* The primary recommendation is to upgrade to Yarn 3 if possible
1616
*/
1717

18-
/**
19-
* Temporary list of allowed stories during migration to NextJS
20-
*/
21-
const tempStoryList = ["../src/components/Buttons/**/*.stories.@(ts|tsx)"]
22-
2318
const config: StorybookConfig = {
24-
stories: tempStoryList,
19+
stories: ["../src/components/**/*.stories.{ts,tsx}"],
2520
addons: [
2621
"@storybook/addon-links",
2722
"@storybook/addon-essentials",
28-
"@storybook/addon-onboarding",
2923
"@storybook/addon-interactions",
3024
"@chakra-ui/storybook-addon",
31-
"storybook-react-i18next"
25+
"storybook-react-i18next",
3226
],
3327
staticDirs: ["../public"],
3428
framework: {

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,11 @@
5454
"devDependencies": {
5555
"@chakra-ui/storybook-addon": "5.1.0",
5656
"@netlify/plugin-nextjs": "^4.41.3",
57-
"@storybook/addon-essentials": "7.5.3",
58-
"@storybook/addon-interactions": "7.5.3",
59-
"@storybook/addon-links": "7.5.3",
60-
"@storybook/addon-onboarding": "1.0.8",
61-
"@storybook/nextjs": "7.5.3",
62-
"@storybook/react": "7.5.3",
57+
"@storybook/addon-essentials": "7.6.6",
58+
"@storybook/addon-interactions": "7.6.6",
59+
"@storybook/addon-links": "7.6.6",
60+
"@storybook/nextjs": "7.6.6",
61+
"@storybook/react": "7.6.6",
6362
"@storybook/testing-library": "0.2.2",
6463
"@svgr/webpack": "^8.1.0",
6564
"@types/hast": "^3.0.0",
@@ -77,7 +76,7 @@
7776
"minimist": "^1.2.8",
7877
"polished": "^4.2.2",
7978
"raw-loader": "^4.0.2",
80-
"storybook": "7.5.3",
79+
"storybook": "7.6.6",
8180
"storybook-react-i18next": "^2.0.9",
8281
"ts-node": "^10.9.1",
8382
"typescript": "^5.1.6",

src/components/BannerNotification/BannerNotification.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default {
1818
* and content from `../../content/developers/tutorials/hello-world-smart-contract-fullstack/index.md`
1919
*/
2020
export const PostMergeBanner: StoryFn<typeof BannerNotification> = (args) => {
21-
const { t } = useTranslation()
21+
const { t } = useTranslation("page-upgrades")
2222

2323
return (
2424
<BannerNotification {...args}>

src/components/BaseStories/Heading.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const headingScale: Array<HeadingProps> = [
6868

6969
export const Heading: Story = {
7070
args: {
71-
children: <Translation id="page-index-title" />,
71+
children: <Translation id="page-index:page-index-title" />,
7272
},
7373
render: (args) => (
7474
<VStack w="full">
@@ -85,7 +85,7 @@ export const Heading: Story = {
8585
textAlign="end"
8686
size={obj.size}
8787
>
88-
{obj.size as string|| "xl"}
88+
{(obj.size as string) || "xl"}
8989
</HeadingComponent>
9090
<HeadingComponent flex="3" {...obj}>
9191
{args.children}

src/components/BaseStories/Text.stories.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ type Story = StoryObj<typeof meta>
3737

3838
const textSizes = components.Text.sizes
3939

40+
const SINGLE_TEXT_CHILD = <Translation id="page-index:page-index-title" />
41+
4042
export const Normal: Story = {
4143
args: {
42-
children: <Translation id="page-index-title" />,
44+
children: SINGLE_TEXT_CHILD,
4345
},
4446
render: (args) => {
4547
return (
@@ -65,7 +67,7 @@ export const Normal: Story = {
6567

6668
export const Bold: Story = {
6769
args: {
68-
children: <Translation id="page-index-title" />,
70+
children: SINGLE_TEXT_CHILD,
6971
fontWeight: "bold",
7072
},
7173
render: (args) => {
@@ -91,7 +93,7 @@ export const Bold: Story = {
9193
}
9294
export const Italic: Story = {
9395
args: {
94-
children: <Translation id="page-index-title" />,
96+
children: SINGLE_TEXT_CHILD,
9597
fontStyle: "italic",
9698
},
9799
render: (args) => {
@@ -118,7 +120,7 @@ export const Italic: Story = {
118120

119121
export const Link: StoryObj<typeof ChakraLink> = {
120122
args: {
121-
children: <Translation id="page-index-title" />,
123+
children: SINGLE_TEXT_CHILD,
122124
},
123125
render: (args) => {
124126
return (

src/components/Hero/HubHero/HubHero.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import learnHubHeroImg from "../../../../public/heroes/learn-hub-hero.png"
3030

3131
export const HubHero: StoryObj<typeof meta> = {
3232
args: {
33-
title: "learn-hub",
34-
header: "hero-header",
35-
description: "hero-subtitle",
33+
title: "common:learn-hub",
34+
header: "page-learn:hero-header",
35+
description: "page-learn:hero-subtitle",
3636
heroImg: learnHubHeroImg,
3737
},
3838

@@ -42,7 +42,7 @@ export const HubHero: StoryObj<typeof meta> = {
4242

4343
const buttons: CommonHeroProps["buttons"] = [
4444
{
45-
content: t("hero-button-lets-get-started"),
45+
content: t("page-learn:hero-button-lets-get-started"),
4646
toId: "what-is-crypto-ethereum",
4747
matomo: {
4848
eventCategory: "learn hub hero buttons",

0 commit comments

Comments
 (0)