Skip to content

Instantly share code, notes, and snippets.

@padupuy
Created May 10, 2017 17:11
Show Gist options
  • Save padupuy/c59a27e26cc3e11c76ec1464d776c4ab to your computer and use it in GitHub Desktop.
Save padupuy/c59a27e26cc3e11c76ec1464d776c4ab to your computer and use it in GitHub Desktop.
import React, {PropTypes} from 'react';
import {
StyleSheet,
View,
Text,
TouchableHighlight,
Dimensions
} from 'react-native';
import {Actions} from "react-native-router-flux";
import Carousel from '../carousel/Carousel';
const {width, height} = Dimensions.get('window');
const LightBox = ({data}) => {
const {imageList = [], index = 0} = data;
return (
<View style={styles.container}>
<TouchableHighlight
style={[styles.button, styles.close]}
underlayColor="#aaa"
onPress={Actions.pop}
>
<Text style={styles.closeText}>Fermer</Text>
</TouchableHighlight>
<Carousel index={index}
items={imageList}
width={width}
height={height}/>
</View>
);
};
LightBox.propTypes = {
data: PropTypes.object.isRequired
};
export default LightBox;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#000',
position: 'relative',
},
close: {
position: 'absolute',
right: 20,
top: 20,
zIndex: 1
},
closeText: {
color: 'white',
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment