blazerapp/app/Home.js

119 lines
3.6 KiB
JavaScript
Raw Normal View History

2020-10-25 02:57:39 -04:00
import React, { useState } from 'react';
2020-08-09 17:01:25 -04:00
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
2020-10-25 02:57:39 -04:00
Modal,
TouchableHighlight,
Image,
2020-08-09 17:01:25 -04:00
} from 'react-native';
import {
Header,
LearnMoreLinks,
Colors,
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
2020-10-25 02:57:39 -04:00
import styles from './styles/morestyles'
2020-12-21 22:34:09 -05:00
import { url } from './resources/fetchInfo.json'
import LinearGradient from 'react-native-linear-gradient';
2020-10-25 02:57:39 -04:00
function Home1() {
const [modalVisible, setModalVisible] = useState(true);
return (
<View>
<View>
<Modal animationType="slide" transparent={true} visible={modalVisible}>
<View style={styles.modal}>
<View style={{display: 'flex', flexDirection:'row', justifyContent: 'flex-end'}}>
<TouchableHighlight onPress={() => {setModalVisible(!modalVisible);}}>
<Image source = {require('./assets/exit.png')} style = {{height: 40, width: 40}}/>
</TouchableHighlight>
</View>
<View>
<Image source = {require('./assets/blair_logo.png')} style = {{alignSelf: 'center', marginTop: '5%', height: 325, width: 325}}/>
2020-12-21 22:34:09 -05:00
<Text style={styles.modalText}>{url}</Text>
2020-10-25 02:57:39 -04:00
</View>
</View>
</Modal>
</View>
<View>
</View>
</View>
)
}
2020-08-09 17:01:25 -04:00
class Home extends React.Component {
2020-10-25 02:57:39 -04:00
constructor(props) {
super(props)
this.state = {
data: [],
2020-12-21 22:34:09 -05:00
isLoading:true
2020-10-25 02:57:39 -04:00
}
}
/*componentDidMount() {
fetch(`${url}/api/en/popup`,{
headers: {
'Cache-Control': 'no-cache'
}}
).then((response) => {
2020-12-21 22:34:09 -05:00
return response.text();list
2020-10-25 02:57:39 -04:00
}).then((json) => {
this.setState({data: JSON.parse(json),isLoading:false});
}).catch((error) => console.error(error))
}*/
2020-08-09 17:01:25 -04:00
render() {
return (
2020-10-25 02:57:39 -04:00
<View>
2020-12-21 22:34:09 -05:00
<View style = {{height: 56, display: 'flex'}}>
<LinearGradient
colors={['#f99', 'white']}
style = {{height: '100%', borderBottomColor:'black', borderBottomWidth:0.5, display: 'flex', justifyContent: 'flex-end', paddingBottom: '2.5%'}}
>
<Text style = {{fontSize: 24, fontWeight: 'bold', alignSelf: 'center'}}>Blair</Text>
</LinearGradient>
</View>
2020-10-25 02:57:39 -04:00
<Home1></Home1>
2020-12-21 22:34:09 -05:00
<ScrollView>
<View style = {{height: 210, display: 'flex'}}>
<LinearGradient
colors={['#f99', 'white']}
style = {{height: '100%', borderBottomColor:'black', borderBottomWidth:0.5, display: 'flex', justifyContent: 'flex-end', paddingBottom: '2.5%'}}
>
<Text style = {{fontSize: 24, fontWeight: 'bold', alignSelf: 'center'}}>Blair</Text>
</LinearGradient>
</View>
<View style = {{height: 210, display: 'flex'}}>
<LinearGradient
colors={['#f99', 'white']}
style = {{height: '100%', borderBottomColor:'black', borderBottomWidth:0.5, display: 'flex', justifyContent: 'flex-end', paddingBottom: '2.5%'}}
>
<Text style = {{fontSize: 24, fontWeight: 'bold', alignSelf: 'center'}}>Blair</Text>
</LinearGradient>
</View>
<View style = {{height: 210, display: 'flex'}}>
<LinearGradient
colors={['#f99', 'white']}
style = {{height: '100%', borderBottomColor:'black', borderBottomWidth:0.5, display: 'flex', justifyContent: 'flex-end', paddingBottom: '2.5%'}}
>
<Text style = {{fontSize: 24, fontWeight: 'bold', alignSelf: 'center'}}>Blair</Text>
</LinearGradient>
</View>
</ScrollView>
2020-10-25 02:57:39 -04:00
</View>
2020-08-09 17:01:25 -04:00
)
}
}
export default Home;