From a2dcb7a6230d5cd4b08dd2d42c7cd4958de4d8d3 Mon Sep 17 00:00:00 2001 From: Emily Liu Date: Sun, 25 Oct 2020 02:57:39 -0400 Subject: [PATCH] added pop up modal+format+style --- app/ChallengeWeek.js | 10 ++- app/Home.js | 59 ++++++++++++-- app/LunchEvents.js | 169 ++++++++++++++++++++------------------- app/SSLOps.js | 3 +- app/assets/exit.png | Bin 0 -> 6172 bytes app/styles/liststyles.js | 18 +++++ app/styles/morestyles.js | 27 +++++++ 7 files changed, 194 insertions(+), 92 deletions(-) create mode 100644 app/assets/exit.png 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 0000000000000000000000000000000000000000..187469825fae39009c2db6fe313b4d556dd7673a GIT binary patch literal 6172 zcmZ{H1yo$ivgizM0fIXOg3DmRJ$SGH!6jI5ox$Cm;ADaY4=_lOB)9~33$DSPpaVhP zaL)PX-u2&ly;kk2-DTa?Rn>b(Yp5wa!J@zd002*v6lFCLSnLrn&=60N+c`G?0LRMq zY!iqUBq=te0Dl_S6*^LTQe7gkzrH5)1S=Pjlz-Q_=0dhR6bx9o3%FXA92LJ> zJQHj1T@eM~X!}87_%BdCDH?F7$KYD44)j?j(I8<}BMH#~NL!_ztv_e#0qRA}w`J(g z0P>wczMmcMY9HE2EbI>948$z``I+l1;D|L`s`Q&v-LFOfRQ zTys%_L*}(?p@0WW>$&RB?%1U?;z;J*p38nLLiZaXeQmOe^abg!8mZ6sdw#9Qto@pr z?_Ia-j%GEG{C(he50|Zw^umlnHo^z$NnzUKe!x8qF0B35KzcuMDGQWH3>Bk8q7msI zi-M@WCz42!CWlieW3WW@hTHqdeL@+K#CcV(j+a=z%Q+s$0(ehH8my;*5y<|cpzud+ zQE;RN{dMmF(vJNz*j{VkfRF}3NeWBkK@Cm>e{@n8hB*#T%ubBq>N78V8uVPVYM(U+ zvA2B-ZReQpF^t3hgq5QZuWj)wHQe%Pbw1IjI|?=poV8Q{;iMZ{y6QH$a}g}pYCpe;QvJ{EP5%N|!hE4X-J zEmXd^mNUA&9guAO%)vr(ri;V^y;^J5^#I3%%pQ&7fNVM>yEoypx7QQ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