Skip to content

Commit 5426a84

Browse files
committed
DONE! 😎
1 parent 90709fa commit 5426a84

13 files changed

+4297
-240
lines changed

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.enable": true
3+
}

README.md

+51-1
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,63 @@ Install the package using yarn or npm:
2929
import ParallaxScrollView from 'react-native-scroll-view';
3030

3131
<ParallaxScrollView />
32+
33+
<ParallaxScrollView
34+
windowHeight={SCREEN_HEIGHT * 0.4}
35+
backgroundSource='http://i.imgur.com/UyjQBkJ.png'
36+
navBarTitle='John Oliver'
37+
userName='John Oliver'
38+
userTitle='Comedian'
39+
userImage='http://i.imgur.com/RQ1iLOs.jpg'
40+
leftIcon={{name: 'rocket', color: 'rgba(131, 175, 41, 1)', size: 30, type: 'font-awesome'}}
41+
rightIcon={{name: 'user', color: 'rgba(193, 193, 193, 1)', size: 30, type: 'font-awesome'}}
42+
/>
43+
44+
45+
<ParallaxScrollView
46+
windowHeight={SCREEN_HEIGHT * 0.4}
47+
backgroundSource='http://i.imgur.com/UyjQBkJ.png'
48+
navBarTitle='John Oliver'
49+
userName='John Oliver'
50+
userTitle='Comedian'
51+
userImage='http://i.imgur.com/RQ1iLOs.jpg'
52+
leftIcon={{name: 'rocket', color: 'rgba(193, 193, 193, 1)', size: 30, type: 'font-awesome'}}
53+
rightIcon={{name: 'user', color: 'rgba(193, 193, 193, 1)', size: 30, type: 'font-awesome'}}
54+
>
55+
<ScrollView style={{flex: 1, backgroundColor: 'rgba(228, 117, 125, 1)'}}>
56+
<View style={{height: 300, justifyContent: 'center', alignItems: 'center'}}>
57+
<Text style={{fontSize: 32, color: 'white'}}>Custom view</Text>
58+
</View>
59+
<View style={{height: 300, justifyContent: 'center', alignItems: 'center'}}>
60+
<Text style={{fontSize: 32, color: 'white'}}>keep going.</Text>
61+
</View>
62+
<View style={{height: 300, justifyContent: 'center', alignItems: 'center'}}>
63+
<Text style={{fontSize: 32, color: 'white'}}>keep going..</Text>
64+
</View>
65+
<View style={{height: 300, justifyContent: 'center', alignItems: 'center'}}>
66+
<Text style={{fontSize: 32, color: 'white'}}>keep going...</Text>
67+
</View>
68+
<View style={{height: 300, justifyContent: 'center', alignItems: 'center'}}>
69+
<Text style={{fontSize: 32, color: 'white'}}>the end! :)</Text>
70+
</View>
71+
</ScrollView>
72+
</ParallaxScrollView>
3273
```
3374

3475
## API
3576

3677
| prop | default | type | description |
3778
| ---- | ---- | ----| ---- |
38-
| coming soon | none | function | coming soon |
79+
| backgroundSource | http://i.imgur.com/6Iej2c3.png | string | The background image for the header (url) |
80+
| windowHeight | SCREEN_HEIGHT * 0.5 | number | The height of the header window |
81+
| navBarTitle | Katy Friedson | string | The title to be display on the NavBar header |
82+
| userName | Katy Friedson | string | The user name displayed in the collapsable header view |
83+
| userImage | http://i.imgur.com/uma9OfG.jpg | string | The user image displayed in the collapsable header view |
84+
| userTitle | Engineering Manager | string | The user title displayed in the collapsable header view |
85+
| headerView | Profile View | custom object | Pass in a custom object to override the default header view |
86+
| leftIcon | menu | object | Pass in the left icon name and type as an object. ```leftIcon={{name: 'rocket', color: 'red', size: 30, type: 'font-awesome'}}```|
87+
| rightIcon | present | object | Pass in the right icon name and type etc as an object. ```rightIcon={{name: 'user', color: 'blue', size: 30, type: 'font-awesome'}}```|
88+
| *children* | List View | React Components | Render any react views/components as children and these will be rendered below the headerView |
3989

4090
## Try it out
4191

example/.eslintrc

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"parser": "babel-eslint",
3+
"env": {
4+
"browser": true
5+
},
6+
"plugins": [
7+
"react",
8+
"react-native"
9+
],
10+
"extends": [
11+
"eslint:recommended",
12+
"plugin:react/recommended"
13+
],
14+
"globals": {
15+
"describe": false,
16+
"it": false,
17+
"expect": false,
18+
"beforeEach": false,
19+
"before": false,
20+
"afterEach": false,
21+
"after": false,
22+
"jest": false
23+
},
24+
"rules": {
25+
"quotes": ["error", "single"],
26+
"semi": ["error", "always"]
27+
}
28+
}

0 commit comments

Comments
 (0)