File tree Expand file tree Collapse file tree 7 files changed +175
-288
lines changed
examples/react-native/storybook Expand file tree Collapse file tree 7 files changed +175
-288
lines changed Original file line number Diff line number Diff line change
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
+ } ) ;
File renamed without changes.
Original file line number Diff line number Diff line change 7
7
} from '@storybook/react-native' ;
8
8
import { withKnobs } from '@storybook/addon-knobs' ;
9
9
import noop from 'lodash/noop' ;
10
+
11
+ import { Screen } from './Screen' ;
10
12
import { loadStories } from './storyLoader' ;
11
- import { DefaultContainer } from '@aws-amplify/ui-react-native/src/Authenticator/common' ;
12
13
13
14
const STORYBOOK_REQUIRE_CYCLE_PREFIX =
14
15
'Require cycle: node_modules/core-js/internals/microtask.js' ;
@@ -26,9 +27,9 @@ export function setupStorybook(initStorybook: boolean) {
26
27
// add decorators
27
28
addDecorator ( withKnobs ) ;
28
29
addDecorator ( ( Story : any ) => (
29
- < DefaultContainer >
30
+ < Screen >
30
31
< Story />
31
- </ DefaultContainer >
32
+ </ Screen >
32
33
) ) ;
33
34
}
34
35
Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ import React from 'react';
2
2
import { storiesOf } from '@storybook/react-native' ;
3
3
import { AuthChallengeName , CodeDeliveryDetails } from '@aws-amplify/ui' ;
4
4
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' ;
6
9
import { Authenticator } from '@aws-amplify/ui-react-native' ;
7
10
import noop from 'lodash/noop' ;
8
11
@@ -155,9 +158,11 @@ const verifyUserProps = {
155
158
156
159
storiesOf ( 'Authenticator' , module )
157
160
. addDecorator ( ( Story : any ) => (
158
- < InnerContainer >
159
- < Story />
160
- </ InnerContainer >
161
+ < DefaultContainer >
162
+ < InnerContainer >
163
+ < Story />
164
+ </ InnerContainer >
165
+ </ DefaultContainer >
161
166
) )
162
167
. add ( 'ConfirmResetPassword' , ( ) => (
163
168
< Authenticator . ConfirmResetPassword { ...confirmResetPasswordProps } />
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55
55
]
56
56
},
57
57
"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" ,
58
61
"@types/react" : " 17.0.47" ,
59
62
"ansi-regex" : " 5.0.1" ,
60
63
"ansi-html" : " 0.0.8" ,
72
75
"nth-check" : " ^2.0.1" ,
73
76
"prismjs" : " ^1.25.0" ,
74
77
"prism-react-renderer" : " 1.2.1" ,
78
+ "react-dev-utils" : " ^11.0.4" ,
75
79
"shell-quote" : " 1.7.3" ,
76
80
"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" ,
80
81
"trim" : " ^0.0.3" ,
81
82
"vscode-vue-languageservice" : " 0.27.26" ,
82
83
"ws" : " ^7.4.6"
You can’t perform that action at this time.
0 commit comments