diff --git a/app/ChallengeWeek.js b/app/ChallengeWeek.js index b7f0244..006c8b5 100644 --- a/app/ChallengeWeek.js +++ b/app/ChallengeWeek.js @@ -6,6 +6,7 @@ import { View, Text, StatusBar, + Linking, } from 'react-native'; import { @@ -15,7 +16,7 @@ import { DebugInstructions, ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; - +import styles from './styles/liststyles'; import { url } from './resources/fetchInfo.json' class ChallengeWeek extends React.Component { @@ -43,9 +44,10 @@ class ChallengeWeek extends React.Component { return } else { return ( - - {this.state.data.title} - {this.state.data.text} + + {this.state.data.title} + {this.state.data.text} + Linking.openURL(this.state.data.link)}>{this.state.data.link} ) } diff --git a/app/Home.js b/app/Home.js index 2d388e6..9bfc2ad 100644 --- a/app/Home.js +++ b/app/Home.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useState } from 'react'; import { SafeAreaView, StyleSheet, @@ -6,6 +6,9 @@ import { View, Text, StatusBar, + Modal, + TouchableHighlight, + Image, } from 'react-native'; import { @@ -15,15 +18,61 @@ import { DebugInstructions, ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; +import styles from './styles/morestyles' +function Home1() { + +const [modalVisible, setModalVisible] = useState(true); + return ( + + + + + + {setModalVisible(!modalVisible);}}> + + + + + + hgjriwogjewope + + + + + + + + + ) +} class Home extends React.Component { + constructor(props) { + super(props) + this.state = { + data: [], + isLoading:true + } + } + + /*componentDidMount() { + fetch(`${url}/api/en/popup`,{ + headers: { + 'Cache-Control': 'no-cache' + }} + ).then((response) => { + return response.text(); + }).then((json) => { + this.setState({data: JSON.parse(json),isLoading:false}); + }).catch((error) => console.error(error)) + }*/ + render() { return ( - - - + + + ) } } - export default Home; \ No newline at end of file diff --git a/app/LunchEvents.js b/app/LunchEvents.js index a1db09b..8309934 100644 --- a/app/LunchEvents.js +++ b/app/LunchEvents.js @@ -24,93 +24,98 @@ import styles from './styles/liststyles' import { url } from './resources/fetchInfo.json' const Stack = createStackNavigator(); -const LunchEvent = (props) => { - const item = props.item - return( - - props.navigation.navigate('LunchInfo', {data:props.data,name:props.name,text:item.text,loc:item.loc})} activeOpacity={0.8}> - - - {item.title} - - - - ) -} export const LunchInfo = ({route}) => { - const item = route.params; - return ( - - - Description: - {item.text} - - - Location: - {item.loc} - - - ) - } + const item = route.params; + return ( + + {item.name} + + Description: + {item.text} + + + Location: + {item.loc} + + + ) +} + +function LunchEvent (props) { + const item = props.item + return( + + props.navigation.navigate('LunchInfo', {data:props.data,name:item.title,text:item.text,loc:item.loc})} activeOpacity={0.8}> + + + {item.title} + + + + ) +} + function Lunch () { - return ( - - - - ({ - title:route.params.name - })} - /> - - - ) + return ( + + + + ({ + headerTitleStyle:[styles.headerTitle,{alignSelf:'center'}], + title:route.params.name + })} + /> + + + ) } class LunchEvents 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() { - return ( - - } - keyExtractor={item=>JSON.stringify(item)} - /> - - ) - } + + 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() { + return ( + + } + keyExtractor={item=>JSON.stringify(item)} + /> + + ) + } } export default Lunch; + diff --git a/app/SSLOps.js b/app/SSLOps.js index 72860ba..737561a 100644 --- a/app/SSLOps.js +++ b/app/SSLOps.js @@ -30,13 +30,14 @@ export const SSLInfo = ({route}) => { console return ( + {item.name} Description: {item.text} Who: - {item.teacher} + {item.teacher} Where: diff --git a/app/assets/exit.png b/app/assets/exit.png new file mode 100644 index 0000000..1874698 Binary files /dev/null and b/app/assets/exit.png differ diff --git a/app/styles/liststyles.js b/app/styles/liststyles.js index 67ed989..127eff8 100644 --- a/app/styles/liststyles.js +++ b/app/styles/liststyles.js @@ -34,6 +34,14 @@ const styles = StyleSheet.create({ fontSize: 28, fontWeight: 'bold', }, + title2: { + fontSize: 22, + fontWeight: 'bold', + color: 'red', + textDecorationLine: 'underline', + textDecorationStyle: "solid", + textDecorationColor: "red", + }, link: { fontSize: 28, textDecorationLine: 'underline', @@ -45,6 +53,16 @@ const styles = StyleSheet.create({ borderRadius: 6, padding: 5, marginBottom: 10, + }, + headerTitle: { + fontSize: 24, + }, + eventTitle: { + textAlign: 'center', + fontSize: 32, + fontWeight: 'bold', + padding: 5, + marginBottom: 10, } }); diff --git a/app/styles/morestyles.js b/app/styles/morestyles.js index bfc07cf..3a6e32a 100644 --- a/app/styles/morestyles.js +++ b/app/styles/morestyles.js @@ -57,6 +57,33 @@ const styles=StyleSheet.create({ tabBarIcon: { height: 50, width: 50, + }, + popup: { + height: '90%', + display: 'flex', + flexDirection: 'column', + justifyContent: "center", + alignItems: "center", + }, + modal: { + marginHorizontal: 20, + marginTop: '20%', + height: '100%', + backgroundColor: "white", + borderRadius: 20, + padding: 15, + shadowColor: "black", + shadowOffset: { + width: 0, + height: 2 + }, + shadowOpacity: 0.5, + shadowRadius: 7, + }, + modalText: { + marginVertical: '10%', + textAlign: "center", + fontSize: 20, } });