85 lines
2.4 KiB
JavaScript
85 lines
2.4 KiB
JavaScript
import React from 'react'
|
|
import { View, ScrollView, Text, StyleSheet, Image, ImageBackground, TouchableOpacity, Platform } from 'react-native'
|
|
import Theme from '../theme.style.js';
|
|
|
|
export default function BoardCarousel(props) {
|
|
return (
|
|
<View style={styles.container}><ScrollView
|
|
horizontal={true}
|
|
contentContainerStyle={{ ...styles.scrollView, width: `${100 * props.intervals}%` }}
|
|
showsHorizontalScrollIndicator={false}
|
|
onContentSizeChange={props.onContentSizeChange}
|
|
onScroll={props.onScroll}
|
|
scrollEventThrottle={200}
|
|
pagingEnabled
|
|
decelerationRate="fast"
|
|
>
|
|
{props.items.map((item, index) => {
|
|
return (
|
|
<ImageBackground key={index} source={item.image} style={{flex: 1, resizeMode: "cover", backgroundColor: Theme.colors.primary}}>
|
|
<View style={{flex: 1, flexDirection: 'column', justifyContent: 'flex-end', alignItems: 'flex-start', padding: 30, bottom: Platform.OS == 'ios' ? 60 : 35}}>
|
|
<Text style={{fontSize: 16.5, color: '#fff'}}>{item.title}</Text>
|
|
<Text style={{color: '#fff'}}>{item.subtitle}</Text>
|
|
</View>
|
|
</ImageBackground>
|
|
)
|
|
})}
|
|
</ScrollView>
|
|
<View style={styles.bullets}>
|
|
{props.bullets}
|
|
</View>
|
|
<View style={styles.button}>
|
|
<TouchableOpacity style={{ padding: 10 }} onPress={props.onPress || null}>
|
|
<Text style={{color: Theme.colors.primary, fontSize: 16}}>GET STARTED</Text>
|
|
</TouchableOpacity>
|
|
</View></View>)
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
statsHead: {
|
|
paddingTop: 10,
|
|
paddingHorizontal: 12,
|
|
},
|
|
container: {
|
|
height: '100%',
|
|
width: '100%',
|
|
backgroundColor: '#fbfbfb',
|
|
shadowColor: '#fcfcfc',
|
|
shadowOpacity: 1,
|
|
shadowOffset: {
|
|
width: 0,
|
|
height: 5
|
|
},
|
|
},
|
|
scrollView: {
|
|
display: 'flex',
|
|
flexDirection: 'row',
|
|
overflow: 'hidden',
|
|
width: '100%',
|
|
height: '100%'
|
|
},
|
|
bullets: {
|
|
position: 'absolute',
|
|
bottom: Platform.OS == 'ios' ? 35 : 0,
|
|
display: 'flex',
|
|
justifyContent: 'flex-start',
|
|
flexDirection: 'row',
|
|
paddingHorizontal: 10,
|
|
paddingTop: 5,
|
|
},
|
|
button: {
|
|
position: 'absolute',
|
|
bottom: Platform.OS == 'ios' ? 50 : 20,
|
|
right: 35,
|
|
display: 'flex',
|
|
justifyContent: 'flex-end',
|
|
flexDirection: 'row',
|
|
paddingHorizontal: 10,
|
|
paddingTop: 5,
|
|
},
|
|
bullet: {
|
|
paddingHorizontal: 3,
|
|
alignSelf: 'center',
|
|
left: 20
|
|
}
|
|
}); |