-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.ios.js
113 lines (104 loc) · 3.37 KB
/
index.ios.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
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import RN from 'react-native';
const { BlurView, VibrancyView } = require('react-native-blur');
import {
StyleSheet,
AppRegistry,
NativeModules,
LayoutAnimation,
TouchableHighlight,
Image,
Text,
View
} from 'react-native';
class townskeTV extends Component {
constructor(props) {
super(props);
this.state = {
on: true
};
}
componentWillUpdate() {
LayoutAnimation.spring()
}
render() {
console.log(this.state.focussed)
return (
<Image source={{uri: "https://townske.imgix.net/331c89bc-332f-e6b9-3e0b-9eb56e885ce3.jpg?fit=min&w=1800"}}style={styles.container}>
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
<View style={{top: 100}}>
<BlurView blurType="light" style={{flex: 1}}>
<View style={{flexDirection: 'row', justifyContent: 'center', padding: 20, paddingBottom: 120 }}>
<View style={{flexDirection: !this.state.on ? 'column' : 'row'}}>
<TouchableHighlight style={[styles.button, this.state.focussed === 0 ? styles.focussed : null]} underlayColor="#777" onFocus={() => this.setState({focussed: 0})} onPress={e => this.setState({focussed: 0})}>
<Text style={styles.buttonText}>This is my button</Text>
</TouchableHighlight>
<TouchableHighlight style={[styles.button, this.state.focussed === 1 ? styles.focussed : null]} underlayColor="#777" onFocus={() => this.setState({focussed: 1})} onPress={e => this.setState({on: !this.state.on})}>
<Text style={styles.buttonText}>This is my button</Text>
</TouchableHighlight>
</View>
<TouchableHighlight style={[styles.button, {height: this.state.on ? 60 : 130}, this.state.focussed === 2 ? styles.focussed : null]} onFocus={() => this.setState({focussed: 2})} underlayColor="#777" onPress={e => console.log(e)}>
<Text style={styles.buttonText}>This is my button</Text>
</TouchableHighlight>
</View>
</BlurView>
</View>
</Image>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#aaa"
},
button: {
marginLeft: 10, width: 250, height: 60, marginBottom: 10, alignItems: 'center', justifyContent: 'center', backgroundColor: '#333',
borderRadius: 2,
shadowColor: "#000000",
shadowOpacity: 0.3,
shadowRadius: 5,
shadowOffset: {
height: 4,
width: 0
}
},
focussed: {
transform: [{scale:1.1}],
shadowRadius: 10
},
buttonText: {
fontSize: 18,
color: 'white'
},
welcome: {
fontSize: 48,
textAlign: 'center',
margin: 100,
backgroundColor: 'transparent',
color: 'white',
},
instructions: {
textAlign: 'center',
backgroundColor: 'transparent',
color: 'white',
marginBottom: 5,
},
});
AppRegistry.registerComponent('townskeTV', () => townskeTV);