Skip to content

Commit 762f468

Browse files
authored
chore(deps): add react-dev-utils resolution (#3105)
1 parent 7f4248d commit 762f468

File tree

7 files changed

+175
-288
lines changed

7 files changed

+175
-288
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react';
2+
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
3+
import { StyleSheet } from 'react-native';
4+
5+
interface ScreenProps {
6+
children: React.ReactNode;
7+
}
8+
9+
export const Screen = ({ children }: ScreenProps) => (
10+
<SafeAreaProvider>
11+
<SafeAreaView style={styles.container}>{children}</SafeAreaView>
12+
</SafeAreaProvider>
13+
);
14+
15+
const styles = StyleSheet.create({
16+
container: {
17+
flex: 1,
18+
alignItems: 'center',
19+
justifyContent: 'center',
20+
},
21+
});

examples/react-native/storybook/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import {
77
} from '@storybook/react-native';
88
import { withKnobs } from '@storybook/addon-knobs';
99
import noop from 'lodash/noop';
10+
11+
import { Screen } from './Screen';
1012
import { loadStories } from './storyLoader';
11-
import { DefaultContainer } from '@aws-amplify/ui-react-native/src/Authenticator/common';
1213

1314
const STORYBOOK_REQUIRE_CYCLE_PREFIX =
1415
'Require cycle: node_modules/core-js/internals/microtask.js';
@@ -26,9 +27,9 @@ export function setupStorybook(initStorybook: boolean) {
2627
// add decorators
2728
addDecorator(withKnobs);
2829
addDecorator((Story: any) => (
29-
<DefaultContainer>
30+
<Screen>
3031
<Story />
31-
</DefaultContainer>
32+
</Screen>
3233
));
3334
}
3435

examples/react-native/storybook/stories/Authenticator.stories.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import React from 'react';
22
import { storiesOf } from '@storybook/react-native';
33
import { AuthChallengeName, CodeDeliveryDetails } from '@aws-amplify/ui';
44
import { GetTotpSecretCode } from '@aws-amplify/ui-react-core/src/Authenticator/hooks';
5-
import { InnerContainer } from '@aws-amplify/ui-react-native/src/Authenticator/common';
5+
import {
6+
InnerContainer,
7+
DefaultContainer,
8+
} from '@aws-amplify/ui-react-native/src/Authenticator/common';
69
import { Authenticator } from '@aws-amplify/ui-react-native';
710
import noop from 'lodash/noop';
811

@@ -155,9 +158,11 @@ const verifyUserProps = {
155158

156159
storiesOf('Authenticator', module)
157160
.addDecorator((Story: any) => (
158-
<InnerContainer>
159-
<Story />
160-
</InnerContainer>
161+
<DefaultContainer>
162+
<InnerContainer>
163+
<Story />
164+
</InnerContainer>
165+
</DefaultContainer>
161166
))
162167
.add('ConfirmResetPassword', () => (
163168
<Authenticator.ConfirmResetPassword {...confirmResetPasswordProps} />

examples/react-native/storybook/ui/Screen.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
]
5656
},
5757
"resolutions": {
58+
"**/@angular-devkit/build-angular/terser": "5.14.2",
59+
"**/@angular-devkit/build-angular/minimatch": "3.0.5",
60+
"**/serve/serve-handler/minimatch": "3.0.5",
5861
"@types/react": "17.0.47",
5962
"ansi-regex": "5.0.1",
6063
"ansi-html": "0.0.8",
@@ -72,11 +75,9 @@
7275
"nth-check": "^2.0.1",
7376
"prismjs": "^1.25.0",
7477
"prism-react-renderer": "1.2.1",
78+
"react-dev-utils": "^11.0.4",
7579
"shell-quote": "1.7.3",
7680
"trim-newlines": "3.0.1",
77-
"**/@angular-devkit/build-angular/terser": "5.14.2",
78-
"**/@angular-devkit/build-angular/minimatch": "3.0.5",
79-
"**/serve/serve-handler/minimatch": "3.0.5",
8081
"trim": "^0.0.3",
8182
"vscode-vue-languageservice": "0.27.26",
8283
"ws": "^7.4.6"

0 commit comments

Comments
 (0)