-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
56 lines (48 loc) · 1.46 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from 'react';
import { Image, Text, Dimensions } from 'react-native';
import { Value } from 'react-native-reanimated';
import {
SafeAreaProvider,
initialWindowSafeAreaInsets,
} from 'react-native-safe-area-context';
import { ParallaxOnboard, ParallaxOnboardPage } from './src';
// eslint-disable-next-line no-console
console.disableYellowBox = true;
const backgroundImage0 =
'https://images.unsplash.com/photo-1581610335641-940f37bb172f';
const backgroundImage1 =
'https://images.unsplash.com/photo-1567705977291-f8f4342e2e9c';
const { width, height } = Dimensions.get('window');
const App = () => {
const animatedValue = new Value(0);
return (
<SafeAreaProvider initialSafeAreaInsets={initialWindowSafeAreaInsets}>
<ParallaxOnboard
speed={0.5}
animatedValue={animatedValue}
dividerWidth={1}
backgroundColor="black"
>
<ParallaxOnboardPage
BackgroundComponent={
<Image
source={{ uri: backgroundImage0 }}
style={{ width, height }}
/>
}
ForegroundComponent={<Text>slide 1</Text>}
/>
<ParallaxOnboardPage
BackgroundComponent={
<Image
source={{ uri: backgroundImage1 }}
style={{ width, height }}
/>
}
ForegroundComponent={<Text>slide 2</Text>}
/>
</ParallaxOnboard>
</SafeAreaProvider>
);
};
export default App;