-
Notifications
You must be signed in to change notification settings - Fork 0
/
Slides.js
116 lines (103 loc) · 3.08 KB
/
Slides.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import React from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Video,
asset,
VrButton,
Image,
VideoControl,
Environment,
VideoPano,
staticResourceURL,
staticAssetURL
} from 'react-360';
import { Linking } from 'react-native';
export default class Slides extends React.Component {
state = {
index : 1 ,
};
increment = () => {
if(this.state.index < 3){
this.setState({
index: (this.state.index += 1)
});
}else{
this.setState({
index: (this.state.index = 1)
});
}
};
decrese = () => {
if(this.state.index > 1){
this.setState({
index: (this.state.index -=1)
});
}else{
this.setState({
index : (this.state.index = 3)
})
}
}
loadInBrowser = () => {
Linking.openURL('https://www.genelec.com/').catch(err => console.error("Couldn't load page", err));
};
render() {
return (
<View style={styles.slides} >
<Text style={styles.titleText}>Our Products</Text>
<View style={styles.ProductSlide}>
<VrButton onClick={()=>{this.decrese()}}>
<Image style={{width: 60.0, height:60.0 }} source={{uri: './static_assets/icons/previous.png' }} />
</VrButton>
<Image style={{width: 200.0, height:200.0 }} source={{uri: `./static_assets/products/product${this.state.index}.png` }} />
<VrButton onClick={() => this.increment()}>
<Image style={{width: 60.0, height:60.0 }} source={{uri: './static_assets/icons/next.png' }} />
</VrButton>
</View>
<View style={styles.visite}>
<Image style={{width: 60.0, height:60.0 }} source={{uri: './static_assets/icons/internet.png' }} />
<View style={{height:60,width:200, marginLeft:10, borderRadius: 20 , alignItems:'center',justifyContent:'center',backgroundColor:'#0d181e'}}>
<VrButton onClick={this.loadInBrowser}>
<Text style={styles.buyText}>Buy now</Text>
</VrButton>
</View>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
slides:{
justifyContent: 'center',
alignItems: 'center',
},
ProductSlide:{
width: 700,
height: 100,
marginTop:110,
backgroundColor: 'rgba(255, 255, 255, 0)',
justifyContent: 'space-between',
alignItems: 'center',
flexDirection: 'row',
paddingLeft : 10,
paddingRight:10
},
visite:{
justifyContent: 'space-between',
alignItems: 'center',
flexDirection: 'row',
marginTop: 90
},
buyText:{
fontSize: 30,
fontWeight: "bold"
},
titleText:{
fontSize: 47,
fontWeight: "bold",
marginTop:40
}
});