@@ -13,41 +13,41 @@ $ yarn add react-native-js-app-tutorial
13
13
` react-native-js-app-tutorial ` has ready templates to show pages. You can import ` Slide ` , a template prepared to show a slide with a default style. If you prefer, you can provide your own template. Just make sure that it belongs to ` IntroSlider ` component (as child).
14
14
15
15
<p align =" center " >
16
- <img src =" ./template. png " alt =" Stepper " width =" 400 " >
16
+ <img src =" ./2018-09-13_09.10.51. png " alt =" Stepper " width =" 340 " >
17
17
</p >
18
18
19
19
You can also override the default skip button, passing a ` skipButton ` prop to ` IntroSlider ` .
20
20
21
21
``` js
22
22
/* @flow */
23
23
24
- import React , { Component } from ' react'
25
- import { StyleSheet } from ' react-native'
26
- import { IntroSlider , Slide } from ' react-native-js-app-tutorial'
24
+ import React , { Component } from ' react' ;
25
+ import { StyleSheet } from ' react-native' ;
26
+ import { IntroSlider , Slide } from ' react-native-js-app-tutorial' ;
27
27
28
28
type Props = {
29
29
navigator : Object
30
- }
30
+ };
31
31
32
32
class Example extends Component < Props> {
33
33
_onSkip = () => {
34
- console .log (' onSkip pressed' )
35
- }
34
+ console .log (' onSkip pressed' );
35
+ };
36
36
37
37
render () {
38
38
return (
39
39
< IntroSlider
40
40
onSkip= {this ._onSkip }
41
41
activeDotStyle= {styles .activeDot }
42
42
showSkipButton= {true }
43
- skipTitleButton= " SALTAR "
44
- skipLastTitleButton= " SIGUIENTE "
43
+ skipTitleButton= " SKIP "
44
+ skipLastTitleButton= " NEXT "
45
45
tintStatusBar= {true }
46
- animationType= {' Pager ' }>
46
+ animationType= {' Parallax ' }>
47
47
< Slide
48
48
image= {{
49
49
uri:
50
- ' https://www.electricasollerense.es/media/gasb2c/filer_public_thumbnails/filer_public/2014/04/11/fibra-logo-domestica.png__1618x1231_q85_crop_subsampling-2_upscale.png '
50
+ ' https://images.pexels.com/photos/259600/pexels-photo-259600.jpeg?cs=srgb&dl=architecture-facade-house-259600.jpg&fm=jpg '
51
51
}}
52
52
title= " Welcome"
53
53
description= " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel mollis risus. Nam dignissim porttitor suscipit."
@@ -59,7 +59,7 @@ class Example extends Component<Props> {
59
59
< Slide
60
60
image= {{
61
61
uri:
62
- ' https://www.electricasollerense.es/media/gasb2c/filer_public_thumbnails/filer_public/2014/04/11/fibra-logo-domestica.png__1618x1231_q85_crop_subsampling-2_upscale.png '
62
+ ' https://images.pexels.com/photos/259600/pexels-photo-259600.jpeg?cs=srgb&dl=architecture-facade-house-259600.jpg&fm=jpg '
63
63
}}
64
64
title= " Welcome 2"
65
65
description= " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel mollis risus. Nam dignissim porttitor suscipit."
@@ -71,7 +71,7 @@ class Example extends Component<Props> {
71
71
< Slide
72
72
image= {{
73
73
uri:
74
- ' https://www.electricasollerense.es/media/gasb2c/filer_public_thumbnails/filer_public/2014/04/11/fibra-logo-domestica.png__1618x1231_q85_crop_subsampling-2_upscale.png '
74
+ ' https://images.pexels.com/photos/259600/pexels-photo-259600.jpeg?cs=srgb&dl=architecture-facade-house-259600.jpg&fm=jpg '
75
75
}}
76
76
title= " Welcome 3"
77
77
description= " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel mollis risus. Nam dignissim porttitor suscipit."
@@ -81,7 +81,7 @@ class Example extends Component<Props> {
81
81
descriptionStyle= {styles .description }
82
82
/ >
83
83
< / IntroSlider>
84
- )
84
+ );
85
85
}
86
86
}
87
87
@@ -96,32 +96,27 @@ const styles = StyleSheet.create({
96
96
fontFamily: ' Avenir Next'
97
97
},
98
98
image: {
99
- width: 250 ,
100
- height: 250
99
+ width: ' 80% ' ,
100
+ height: 200
101
101
}
102
- })
102
+ });
103
103
104
- export default Example
104
+ export default Example ;
105
105
```
106
106
107
107
## API
108
108
109
- | Prop | Type | Required | Description |
110
- | :-----------------: | :-----------: | :------: | :-------------------------------------------------------------------------------------------------------------------------------------------: |
111
- | page | number | No | Index of initial page that should be selected |
112
- | onSkip | Function | No | Function to execute when default skip button is pressed |
113
- | activeDotStyle | Object | No | Styles object of active dot at the bottom |
114
- | inactiveDotStyle | Object | No | Styles object of inactive dot at the bottom |
115
- | skipTitleButton | string | No | Title of the skip button |
116
- | skipLastTitleButton | string | No | Title of the skip button when last page is displayed |
117
- | skipButton | React.Element | No | Display a custom skip button component to override the default template |
118
- | animationType | string | No | Choose a predefined animation to apply on ScrollView's children (default: ` Pager ` , types: Pager, ZoomOut, TranslateY, RotateX, RotateY, Flip) |
119
- | customAnimation | Object | No | Custom animation to apply on ScrollView's children |
120
-
121
- ## TODO
122
-
123
- * [x] Default and custom animations
124
- * [ ] Tests
109
+ | Prop | Type | Required | Description |
110
+ | :-----------------: | :-----------: | :------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------: |
111
+ | page | number | No | Index of initial page that should be selected |
112
+ | onSkip | Function | No | Function to execute when default skip button is pressed |
113
+ | activeDotStyle | Object | No | Styles object of active dot at the bottom |
114
+ | inactiveDotStyle | Object | No | Styles object of inactive dot at the bottom |
115
+ | skipTitleButton | string | No | Title of the skip button |
116
+ | skipLastTitleButton | string | No | Title of the skip button when last page is displayed |
117
+ | skipButton | React.Element | No | Display a custom skip button component to override the default template |
118
+ | animationType | string | No | Choose a predefined animation to apply on ScrollView's children (default: ` Parallax ` , types: Parallax, Pager, ZoomOut, TranslateY, RotateX, RotateY, Flip & FadeIn) |
119
+ | customAnimation | Object | No | Custom animation to apply on ScrollView's children |
125
120
126
121
## License
127
122
0 commit comments