Skip to content

Commit dda310c

Browse files
Merge pull request #3062 from input-output-hk/fix/ddw-1142-storybook-locales-working
[DDW-1142] Fix the locale passed to the stories
2 parents 57e284d + 2a44a0b commit dda310c

File tree

13 files changed

+41
-32
lines changed

13 files changed

+41
-32
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## vNext
4+
5+
### Features
6+
7+
### Fixes
8+
9+
### Chores
10+
11+
- Fixed locale in Storybook ([PR 3062](https://github.com/input-output-hk/daedalus/pull/3062))
12+
313
## 5.1.0
414

515
### Chores

storybook/stories/common/Widgets.stories.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ storiesOf('Common / Widgets', module)
146146
</div>
147147
</div>
148148
))
149-
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { locale: string;}) =... Remove this comment to see the full error message
150-
.add('BigButtonForDialogs', (props: { locale: string }) => (
149+
.add('BigButtonForDialogs', (_, props) => (
151150
<div>
152151
<div
153152
style={{
@@ -201,12 +200,10 @@ storiesOf('Common / Widgets', module)
201200
</div>
202201
))
203202
.add('TinySwitch', () => <TinySwitch />)
204-
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { locale: string;}) =... Remove this comment to see the full error message
205-
.add('TinySwitch - short label', (props: { locale: string }) => (
203+
.add('TinySwitch - short label', (_, props) => (
206204
<TinySwitch label={intl[props.locale].formatMessage(messages.save)} />
207205
))
208-
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { locale: string;}) =... Remove this comment to see the full error message
209-
.add('ButtonLink', (props: { locale: string }) => (
206+
.add('ButtonLink', (_, props) => (
210207
<ButtonLink
211208
label={intl[props.locale].formatMessage(messages.save)}
212209
// @ts-ignore ts-migrate(2769) FIXME: No overload matches this call.

storybook/stories/navigation/Sidebar.stories.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ storiesOf('Navigation / Sidebar', module)
113113
))
114114
.addDecorator(withKnobs) // ====== Stories ======
115115
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { currentTheme: strin... Remove this comment to see the full error message
116-
.add('No Category', (props: { currentTheme: string }) => (
116+
.add('No Category', (_, props: { currentTheme: string }) => (
117117
<Sidebar
118118
menus={emptyMenus}
119119
categories={CATEGORIES_WITH_DELEGATION_COUNTDOWN}
@@ -131,7 +131,7 @@ storiesOf('Navigation / Sidebar', module)
131131
/>
132132
))
133133
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { currentTheme: strin... Remove this comment to see the full error message
134-
.add('Wallets Category', (props: { currentTheme: string }) => (
134+
.add('Wallets Category', (_, props: { currentTheme: string }) => (
135135
<Sidebar
136136
menus={emptyMenus}
137137
categories={CATEGORIES_WITH_DELEGATION_COUNTDOWN}
@@ -149,7 +149,7 @@ storiesOf('Navigation / Sidebar', module)
149149
/>
150150
))
151151
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { currentTheme: strin... Remove this comment to see the full error message
152-
.add('Wallet Selected', (props: { currentTheme: string }) => (
152+
.add('Wallet Selected', (_, props: { currentTheme: string }) => (
153153
<Sidebar
154154
categories={CATEGORIES_WITH_DELEGATION_COUNTDOWN}
155155
activeSidebarCategory={CATEGORIES_WITH_DELEGATION_COUNTDOWN[0].route}
@@ -169,7 +169,7 @@ storiesOf('Navigation / Sidebar', module)
169169
/>
170170
))
171171
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { currentTheme: strin... Remove this comment to see the full error message
172-
.add('Hardware Wallet Selected', (props: { currentTheme: string }) => (
172+
.add('Hardware Wallet Selected', (_, props: { currentTheme: string }) => (
173173
<Sidebar
174174
categories={CATEGORIES_WITH_DELEGATION_COUNTDOWN}
175175
activeSidebarCategory={CATEGORIES_WITH_DELEGATION_COUNTDOWN[1].route}
@@ -188,7 +188,7 @@ storiesOf('Navigation / Sidebar', module)
188188
/>
189189
))
190190
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { currentTheme: strin... Remove this comment to see the full error message
191-
.add('Delegation Category', (props: { currentTheme: string }) => (
191+
.add('Delegation Category', (_, props: { currentTheme: string }) => (
192192
<Sidebar
193193
menus={emptyMenus}
194194
categories={CATEGORIES_WITH_DELEGATION_COUNTDOWN}
@@ -208,7 +208,7 @@ storiesOf('Navigation / Sidebar', module)
208208
.add(
209209
'Decentralization Progress Category',
210210
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { currentTheme: strin... Remove this comment to see the full error message
211-
(props: { currentTheme: string }) => (
211+
(_, props: { currentTheme: string }) => (
212212
<Sidebar
213213
menus={emptyMenus}
214214
categories={CATEGORIES_WITHOUT_DELEGATION_COUNTDOWN}
@@ -227,7 +227,7 @@ storiesOf('Navigation / Sidebar', module)
227227
)
228228
)
229229
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { currentTheme: strin... Remove this comment to see the full error message
230-
.add('Network label', (props: { currentTheme: string }) => (
230+
.add('Network label', (_, props: { currentTheme: string }) => (
231231
<Sidebar
232232
menus={emptyMenus}
233233
categories={CATEGORIES_WITH_DELEGATION_COUNTDOWN}

storybook/stories/news/AlertsOverlay.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ storiesOf('News / Overlays', module)
9292
<StoryDecorator>{withKnobs(story, context)}</StoryDecorator>
9393
))
9494
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '(props: { locale: string;}) =... Remove this comment to see the full error message
95-
.add('Alerts', (props: { locale: string }) => (
95+
.add('Alerts', (_, props: { locale: string }) => (
9696
<AlertsOverlay
9797
allAlertsCount={getAlerts(props.locale).length}
9898
alerts={getAlerts(props.locale)}

storybook/stories/news/AppUpdateOverlay.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ storiesOf('News / Overlays', module)
1111
.addDecorator((story) => <StoryDecorator>{story()}</StoryDecorator>)
1212
.addDecorator(withKnobs)
1313
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '({ locale }: { locale: string; }... Remove this comment to see the full error message
14-
.add('Update', ({ locale }: { locale: string }) => {
14+
.add('Update', (_, { locale }: { locale: string }) => {
1515
const scenario = radios(
1616
'Scenario',
1717
{

storybook/stories/news/NewsFeed.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ storiesOf('News / NewsFeed', module)
6262
</div>
6363
))
6464
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '({ locale }: { locale: string; }... Remove this comment to see the full error message
65-
.add('Fetched', ({ locale }: { locale: string }) => {
65+
.add('Fetched', (_, { locale }: { locale: string }) => {
6666
const displayAppUpdateNewsItem = boolean('displayAppUpdateNewsItem', true);
6767
const updateDownloadProgress = displayAppUpdateNewsItem
6868
? number('updateDownloadProgress', 30, updateDownloadProgressOptions)

storybook/stories/nodes/errors/Errors.stories.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ storiesOf('Nodes / Errors', module)
1212
)) // ====== Stories ======
1313
.add('No Disk Space Error', NoDiskSpaceErrorStory)
1414
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '({ locale }: { locale: string; }... Remove this comment to see the full error message
15-
.add('System Time Error', SystemTimeErrorStory);
15+
.add('System Time Error', (_, props) => (
16+
<SystemTimeErrorStory locale={props.locale} />
17+
));

storybook/stories/settings/general/General.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ storiesOf('Settings / General', module)
113113
}}
114114
/>
115115
))
116-
.add('Terms of Service', (props) => {
116+
.add('Terms of Service', (_, props) => {
117117
const termsOfUseSource = require(`../../../../source/renderer/app/i18n/locales/terms-of-use/${props.locale}.md`);
118118

119119
return (

storybook/stories/settings/language/Language.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
storiesOf('Settings / Language', module)
1313
.addDecorator((story) => <StoryDecorator>{story()}</StoryDecorator>) // ====== Stories ======
1414
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '({ locale }: { locale: string; }... Remove this comment to see the full error message
15-
.add('Select Language - initial', ({ locale }: { locale: string }) => (
15+
.add('Select Language - initial', (_, { locale }: { locale: string }) => (
1616
<div>
1717
<InitialSettings
1818
onSubmit={action('submit')}
@@ -25,7 +25,7 @@ storiesOf('Settings / Language', module)
2525
</div>
2626
))
2727
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '({ locale }: { locale: string; }... Remove this comment to see the full error message
28-
.add('Select Language - submitting', ({ locale }: { locale: string }) => (
28+
.add('Select Language - submitting', (_, { locale }: { locale: string }) => (
2929
<div>
3030
<InitialSettings
3131
onSubmit={action('submit')}

storybook/stories/staking/Staking.stories.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ storiesOf('Decentralization / Staking', module)
112112
.addDecorator(decorator) // ====== Stories ======
113113
.add(
114114
pageNames['delegation-center'],
115-
(props) => (
115+
(_, props) => (
116116
// @ts-ignore ts-migrate(2739) FIXME: Type '{ isEpochsInfoAvailable: true; id: string; n... Remove this comment to see the full error message
117117
<StakingDelegationCenterStory {...props} isEpochsInfoAvailable />
118118
),
@@ -122,7 +122,7 @@ storiesOf('Decentralization / Staking', module)
122122
)
123123
.add(
124124
'Delegation Center - Loading',
125-
(props) => (
125+
(_, props) => (
126126
// @ts-ignore ts-migrate(2739) FIXME: Type '{ isLoading: true; isEpochsInfoAvailable: tr... Remove this comment to see the full error message
127127
<StakingDelegationCenterStory
128128
{...props}
@@ -136,7 +136,7 @@ storiesOf('Decentralization / Staking', module)
136136
)
137137
.add(
138138
'Delegation Center - Not an Shelley era',
139-
(props) => (
139+
(_, props) => (
140140
// @ts-ignore ts-migrate(2739) FIXME: Type '{ isEpochsInfoAvailable: false; id: string; ... Remove this comment to see the full error message
141141
<StakingDelegationCenterStory {...props} isEpochsInfoAvailable={false} />
142142
),
@@ -217,7 +217,7 @@ storiesOf('Decentralization / Staking', module)
217217
)
218218
.add(
219219
'Delegation Wizard',
220-
(props) => {
220+
(_, props) => {
221221
const oversaturationPercentage = number('Oversaturation Percentage', 0, {
222222
min: 0,
223223
max: 1000,
@@ -239,14 +239,14 @@ storiesOf('Decentralization / Staking', module)
239239
.add(
240240
'Delegation Wizard - Delegation Not Available',
241241
// @ts-ignore ts-migrate(2769) FIXME: No overload matches this call.
242-
(props) => <StakingDelegationSteps {...props} isDisabled />,
242+
(_, props) => <StakingDelegationSteps {...props} isDisabled />,
243243
{
244244
id: 'wizard',
245245
}
246246
)
247247
.add(
248248
'Undelegate Confirmation',
249-
(props) => (
249+
(_, props) => (
250250
<StakingUndelegateConfirmationStory
251251
{...props}
252252
isHardwareWallet={boolean('isHardwareWallet', false)}
@@ -258,7 +258,7 @@ storiesOf('Decentralization / Staking', module)
258258
)
259259
.add(
260260
'Undelegate Confirmation - unknownn stake pool',
261-
(props) => (
261+
(_, props) => (
262262
<StakingUndelegateConfirmationStory {...props} unknownStakePool />
263263
),
264264
{
@@ -268,7 +268,7 @@ storiesOf('Decentralization / Staking', module)
268268
.add(
269269
'Undelegate Confirmation Result',
270270
// @ts-ignore ts-migrate(2345) FIXME: Argument of type '({ locale, }: { locale: string; ... Remove this comment to see the full error message
271-
StakingUndelegateConfirmationResultStory,
271+
(_, props) => <StakingUndelegateConfirmationResultStory {...props} />,
272272
{
273273
id: 'undelegate-confirmation-result',
274274
}

0 commit comments

Comments
 (0)