Home page + others

This commit is contained in:
Emily Liu 2020-12-23 00:23:53 -05:00
parent 290ce494fd
commit f216cfb872
8 changed files with 255 additions and 51 deletions

View File

@ -118,7 +118,7 @@ class Calendar extends React.Component {
render() { render() {
return ( return (
<View> <View>
<View style = {{height: 56, display: 'flex'}}> <View style = {{height: 90, display: 'flex'}}>
<LinearGradient <LinearGradient
colors={['#f99', 'white']} colors={['#f99', 'white']}
style = {{height: '100%', borderBottomColor:'black', borderBottomWidth:0.5, display: 'flex', justifyContent: 'flex-end', paddingBottom: '2.5%'}} style = {{height: '100%', borderBottomColor:'black', borderBottomWidth:0.5, display: 'flex', justifyContent: 'flex-end', paddingBottom: '2.5%'}}

File diff suppressed because one or more lines are too long

View File

@ -30,6 +30,7 @@ import SSLOps, {SSLInfo} from './SSLOps'
import LunchEvents, {LunchInfo} from './LunchEvents' import LunchEvents, {LunchInfo} from './LunchEvents'
import ChallengeWeek from './ChallengeWeek' import ChallengeWeek from './ChallengeWeek'
import Settings from './Settings' import Settings from './Settings'
import Poll from './Poll'
import Images from './Images' import Images from './Images'
import LinearGradient from 'react-native-linear-gradient' import LinearGradient from 'react-native-linear-gradient'
@ -57,7 +58,7 @@ class MoreSwitch extends React.Component {
renderItem={({item})=> renderItem={({item})=>
<TouchableOpacity style={styles.moreitem} onPress={()=>this.props.navigation.navigate(item.key)}> <TouchableOpacity style={styles.moreitem} onPress={()=>this.props.navigation.navigate(item.key)}>
<Image source = {item.img} style = {{height: 40, width: 40, marginRight: 10}}/> <Image source = {item.img} style = {{height: 40, width: 40, marginRight: 10, tintColor: '#e3e3e3'}}/>
<Text style={styles.moretext}>{item.name}</Text> <Text style={styles.moretext}>{item.name}</Text>
</TouchableOpacity> </TouchableOpacity>
} }

View File

@ -6,6 +6,8 @@ import {
View, View,
Text, Text,
StatusBar, StatusBar,
Image,
TouchableOpacity,
} from 'react-native'; } from 'react-native';
import { import {
@ -16,19 +18,54 @@ import {
ReloadInstructions, ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen'; } from 'react-native/Libraries/NewAppScreen';
import {WebView} from 'react-native-webview'; import {WebView} from 'react-native-webview';
import LinearGradient from 'react-native-linear-gradient';
import { Linking } from 'react-native';
import { url } from './resources/fetchInfo.json'
class Poll extends React.Component { class Poll extends React.Component {
/*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))
}*/
render() { render() {
return ( return (
<WebView <View style = {{backgroundColor: 'white'}}>
source = {{uri: 'https://docs.google.com/forms/d/e/1FAIpQLSfR0XP2yo3TV3egz7aMok56wnP9kG4FQt2v3rHrrayf8uC7Vw/viewform?usp=sf_link'}} <View style = {{height: 90, display: 'flex'}}>
javaScriptEnabled={true} <LinearGradient
domStorageEnabled={true} colors={['#f99', 'white']}
startInLoadingState={true} style = {{height: '100%', borderBottomColor:'black', borderBottomWidth:0.5, display: 'flex', justifyContent: 'flex-end', paddingBottom: '2.5%'}}
style={{marginTop: 20}} >
cacheEnabled={true} <Text style = {{fontSize: 24, fontWeight: 'bold', alignSelf: 'center'}}>Polls</Text>
</LinearGradient>
/>
</View>
<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>
) )
} }
} }

BIN
app/assets/polls.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
app/assets/unknown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -1 +1 @@
{"url":"https://6227632bc899.ngrok.io"} {"url":"http://127.0.0.1:5000"}

View File

@ -40,6 +40,10 @@ const styles = StyleSheet.create({
textDecorationStyle: "solid", textDecorationStyle: "solid",
textDecorationColor: "red", textDecorationColor: "red",
}, },
homeTitle: {
fontSize: 20,
fontWeight: 'bold',
},
title3: { title3: {
fontSize: 28, fontSize: 28,
}, },