Skip to content

Commit 9936028

Browse files
gwyneplainekyledurand
authored andcommitted
fix app provider stories (#9278)
Remerging #9264 into v11.x.x to fix bad rebase Co-authored-by: kyledurand <kyle.durand@shopify.com>
1 parent 88aa367 commit 9936028

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

polaris-react/src/components/AppProvider/AppProvider.stories.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type {Args, ComponentMeta} from '@storybook/react';
33
import {
44
AppProvider,
55
Avatar,
6-
Box,
76
Button,
87
LegacyCard,
98
AlphaCard,
@@ -12,15 +11,14 @@ import {
1211
Text,
1312
VerticalStack,
1413
} from '@shopify/polaris';
15-
import {useFeatures} from '@shopify/polaris/utilities/features';
1614

1715
export default {
1816
component: AppProvider,
1917
args: {omitAppProvider: true},
2018
parameters: {layout: 'fullscreen'},
2119
} as ComponentMeta<typeof AppProvider>;
2220

23-
export function Default() {
21+
export function Default(_, context) {
2422
return (
2523
<AppProvider
2624
i18n={{
@@ -39,6 +37,9 @@ export function Default() {
3937
},
4038
},
4139
}}
40+
features={{
41+
polarisSummerEditions2023: context.globals.polarisSummerEditions2023,
42+
}}
4243
>
4344
<Page>
4445
<LegacyCard>
@@ -80,7 +81,7 @@ export function Default() {
8081
);
8182
}
8283

83-
export function WithI18n() {
84+
export function WithI18n(_, context) {
8485
return (
8586
<AppProvider
8687
i18n={{
@@ -99,6 +100,9 @@ export function WithI18n() {
99100
},
100101
},
101102
}}
103+
features={{
104+
polarisSummerEditions2023: context.globals.polarisSummerEditions2023,
105+
}}
102106
>
103107
<Page>
104108
<LegacyCard>
@@ -140,7 +144,7 @@ export function WithI18n() {
140144
);
141145
}
142146

143-
export function WithLinkComponent() {
147+
export function WithLinkComponent(_, context) {
144148
const CustomLinkComponent = ({children, url, ...rest}) => {
145149
return (
146150
<a
@@ -154,7 +158,13 @@ export function WithLinkComponent() {
154158
};
155159

156160
return (
157-
<AppProvider linkComponent={CustomLinkComponent} i18n={{}}>
161+
<AppProvider
162+
linkComponent={CustomLinkComponent}
163+
i18n={{}}
164+
features={{
165+
polarisSummerEditions2023: context.globals.polarisSummerEditions2023,
166+
}}
167+
>
158168
<Page
159169
backAction={{content: 'Products', url: '#'}}
160170
title="Jar With Lock-Lid"
@@ -169,7 +179,6 @@ export function WithLinkComponent() {
169179
export const WithSummerEditionsFeature = {
170180
render: (_args: Args, {globals: {polarisSummerEditions2023}}) => {
171181
const CheckFeature = () => {
172-
const {polarisSummerEditions2023} = useFeatures();
173182
return (
174183
<AlphaCard>
175184
<VerticalStack gap="4">

0 commit comments

Comments
 (0)