Skip to content

Commit 85e3262

Browse files
committed
Fix Flashcards and Writer story by env var
1 parent b07128f commit 85e3262

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

.storybook/main.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,4 @@ module.exports = {
1616
enableCrashReports: false,
1717
builder: "webpack5",
1818
},
19-
env: (config) => ({
20-
...config,
21-
PUBLIC_URL: "/typey-type",
22-
}),
2319
};

src/pages/progress/components/LessonsProgress.stories.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,31 +101,33 @@ const testLessonIndex = [
101101
},
102102
];
103103

104+
const fakePUBLIC_URL = "."; // should be '/typey-type' but that requires setting the Storybook environment variable for PUBLIC_URL and that in turn breaks other stories
105+
104106
const testLessonsProgress = {
105-
"/typey-type/lessons/fundamentals/introduction/lesson.txt": {
107+
[`${fakePUBLIC_URL}/lessons/fundamentals/introduction/lesson.txt`]: {
106108
numberOfWordsMemorised: 52,
107109
numberOfWordsSeen: 0,
108110
numberOfWordsToDiscover: 0,
109111
},
110-
"/typey-type/lessons/fundamentals/one-syllable-words-with-simple-keys/lesson.txt":
112+
[`${fakePUBLIC_URL}/lessons/fundamentals/one-syllable-words-with-simple-keys/lesson.txt`]:
111113
{
112114
numberOfWordsMemorised: 0,
113115
numberOfWordsSeen: 4,
114116
numberOfWordsToDiscover: 160,
115117
},
116-
"/typey-type/lessons/fundamentals/one-syllable-words-with-more-consonants/lesson.txt":
118+
[`${fakePUBLIC_URL}/lessons/fundamentals/one-syllable-words-with-more-consonants/lesson.txt`]:
117119
{
118120
numberOfWordsMemorised: 0,
119121
numberOfWordsSeen: 0,
120122
numberOfWordsToDiscover: 96,
121123
},
122-
"/typey-type/lessons/fundamentals/multi-syllable-words-with-suffixes/lesson.txt":
124+
[`${fakePUBLIC_URL}/lessons/fundamentals/multi-syllable-words-with-suffixes/lesson.txt`]:
123125
{
124126
numberOfWordsMemorised: 9,
125127
numberOfWordsSeen: 524,
126128
numberOfWordsToDiscover: 842,
127129
},
128-
"/typey-type/lessons/stories/proverbial-phrases/proverbial-phrases-starting-with-e/lesson.txt":
130+
[`${fakePUBLIC_URL}/lessons/stories/proverbial-phrases/proverbial-phrases-starting-with-e/lesson.txt`]:
129131
{
130132
numberOfWordsMemorised: 0,
131133
numberOfWordsSeen: 0,
@@ -145,5 +147,4 @@ LessonsProgressStory.args = {
145147
lessonIndex: testLessonIndex,
146148
lessonsProgress: testLessonsProgress,
147149
setAnnouncementMessage: () => undefined,
148-
PUBLIC_URL: process.env.PUBLIC_URL,
149150
};

0 commit comments

Comments
 (0)