2020-08-09 17:01:25 -04:00
|
|
|
import React from 'react';
|
|
|
|
import {
|
|
|
|
SafeAreaView,
|
|
|
|
StyleSheet,
|
|
|
|
ScrollView,
|
|
|
|
View,
|
|
|
|
Text,
|
|
|
|
StatusBar,
|
2020-12-23 00:23:53 -05:00
|
|
|
Image,
|
|
|
|
TouchableOpacity,
|
2020-08-09 17:01:25 -04:00
|
|
|
} from 'react-native';
|
|
|
|
|
|
|
|
import {
|
|
|
|
Header,
|
|
|
|
LearnMoreLinks,
|
|
|
|
Colors,
|
|
|
|
DebugInstructions,
|
|
|
|
ReloadInstructions,
|
|
|
|
} from 'react-native/Libraries/NewAppScreen';
|
2020-11-20 02:44:02 -05:00
|
|
|
import {WebView} from 'react-native-webview';
|
2020-12-23 00:23:53 -05:00
|
|
|
import LinearGradient from 'react-native-linear-gradient';
|
|
|
|
import { Linking } from 'react-native';
|
|
|
|
import { url } from './resources/fetchInfo.json'
|
|
|
|
|
2020-08-09 17:01:25 -04:00
|
|
|
class Poll extends React.Component {
|
2020-12-23 00:23:53 -05:00
|
|
|
|
|
|
|
/*constructor(props) {
|
|
|
|
super(props)
|
|
|
|
this.state = {
|
|
|
|
data: []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
fetch(`${url}/api/en/lunchEvents`,{
|
|
|
|
headers: {
|
|
|
|
'Cache-Control': 'no-cache'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
.then((response) => {
|
|
|
|
return response.text();
|
|
|
|
})
|
|
|
|
.then((json) => {
|
|
|
|
this.setState({data: JSON.parse(json)});
|
|
|
|
})
|
|
|
|
.catch((error) => console.error(error))
|
|
|
|
}*/
|
|
|
|
|
2020-08-09 17:01:25 -04:00
|
|
|
render() {
|
|
|
|
return (
|
2020-12-23 00:23:53 -05:00
|
|
|
<View style = {{backgroundColor: 'white'}}>
|
|
|
|
<View style={{backgroundColor: 'white', height: '100%', display: 'flex', alignItems: 'center'}}>
|
|
|
|
<TouchableOpacity onPress={()=>Linking.openURL("https://google.com")}>
|
|
|
|
<Image source={require('./assets/polls.png')} style={{marginTop: 50, height: 300, width: 300, tintColor: 'red'}}/>
|
|
|
|
</TouchableOpacity>
|
|
|
|
<Text style ={{fontSize: 20, marginTop: 30}}>Press the image to take the poll!</Text>
|
|
|
|
</View>
|
|
|
|
</View>
|
2020-08-09 17:01:25 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Poll;
|