finished home pg + other minor stuff

This commit is contained in:
Emily Liu committed 2020-12-24 01:35:25 -05:00
1 parent 0bf2629664
commit d7d71ef594
6 files changed
+405 -141

No files matched your search

+14 -8
View File
@@ -25,23 +25,29 @@ const getCurrentDate=()=>{
var month = new Date().getMonth() + 1;
var year = new Date().getFullYear();
return year + '-' + month + '-' + date;
return year + ',' + month + ',' + date;
}
const getWeekDate=()=>{
var date = new Date().getDate()-8;
var month = new Date().getMonth()+1;
var year = new Date().getFullYear();
return year + ',' + month + ',' + date;
}
const Event = ({item}) => {
const [visible, setVisible] = useState(false)
const date = item.item.date.split('-')
const today = new Date(getCurrentDate())
const week = new Date().setDate(new Date().getDate() - 8)
const itemDate = new Date(item.item.date)
const week = new Date(getWeekDate())
const extra = (
<>
<Text style={{fontSize:20}}>{item.item.text}</Text>
<Text style={{fontSize:20}}>Location: {item.item.location}</Text>
</>
)
if (itemDate >= today) {
if (itemDate.getTime() >= today.getTime()) {
return (
<TouchableOpacity style={styles.item1} onPress={()=>setVisible(!visible)} activeOpacity={0.8}>
<View style = {{display: 'flex', flexDirection: 'row', alignContent: 'center', justifyContent: 'space-between'}}>
@@ -50,14 +56,14 @@ const Event = ({item}) => {
<Text style={styles.title3}>{item.item.title}</Text>
</View>
<View style = {{display: 'flex', flexDirection: 'row', alignContent: 'center'}}>
<Text style = {{fontSize: 16, alignSelf: 'center'}}>{`${date[1]}/${date[2]}/${date[0]}`}</Text>
<Text style = {{fontSize: 16, alignSelf: 'center'}}>{item.item.date}</Text>
</View>
</View>
{visible?extra:<></>}
</TouchableOpacity>
)
}
else if (itemDate >= week){
else if (itemDate.getTime() >= week.getTime()){
return (
<TouchableOpacity style={{backgroundColor: '#e3e3e3', padding: 15, borderBottomWidth: 1, borderColor: 'black', width: '100%',}} onPress={()=>setVisible(!visible)} activeOpacity={0.8}>
<View style = {{display: 'flex', flexDirection: 'row', alignContent: 'center', justifyContent: 'space-between'}}>
@@ -66,7 +72,7 @@ const Event = ({item}) => {
<Text style={styles.title3}>{item.item.title}</Text>
</View>
<View style = {{display: 'flex', flexDirection: 'row', alignContent: 'center'}}>
<Text style = {{fontSize: 16, alignSelf: 'center'}}>{`${date[1]}/${date[2]}/${date[0]}`}</Text>
<Text style = {{fontSize: 16, alignSelf: 'center'}}>{item.item.date}</Text>
</View>
</View>
{visible?extra:<></>}
+10 -5
View File
@@ -36,15 +36,15 @@ export const ClubInfo = ({route}) => {
return (
<View style = {{padding: 10, backgroundColor: 'white', height: '100%'}}>
<View style ={styles.infoContainer}>
<Text style = {styles.title1}>Meeting Time and Day: </Text>
<Text style = {[styles.title1, {fontSize: 24}]}>Meeting Time and Day: </Text>
<Text style = {{fontSize:20}}>{item.meeting}</Text>
</View>
<View style ={styles.infoContainer}>
<Text style = {styles.title1}>Zoom Link: </Text>
<Text style = {[styles.title1, {fontSize: 24}]}>Zoom Link: </Text>
<Text style = {[styles.linktext,{fontSize:20}]} onPress={() => Linking.openURL(item.link)}>{item.link}</Text>
</View>
<View style ={styles.infoContainer}>
<Text style = {styles.title1}>Sponsor: </Text>
<Text style = {[styles.title1, {fontSize: 24}]}>Sponsor: </Text>
<Text style = {{fontSize:20}}>{item.sponsor}</Text>
</View>
</View>
@@ -65,6 +65,11 @@ function ClubElement (props) {
)
}
const background = (<LinearGradient
colors={['#f99', 'white']}
style = {{flex:1,borderBottomColor:'black',borderBottomWidth:0.5}}
/>)
function Club () {
return (
<NavigationContainer independent={true}>
@@ -81,8 +86,8 @@ function Club () {
component = {ClubInfo}
options={({route})=>({
title:route.params.name,
headerTitleStyle:[morestyles.headerTitle,{alignSelf:'center'}],
headerRight:()=>(<></>)
headerTitleStyle:[morestyles.headerTitle,{alignSelf:'center'}],
headerBackground: ()=>background
})}
/>
</Stack.Navigator>
+366 -127
View File
@@ -10,6 +10,7 @@ import {
TouchableHighlight,
Image,
FlatList,
Linking,
} from 'react-native';
import {
@@ -27,58 +28,227 @@ import StudentWeek from './StudentWeek';
import { TouchableOpacity } from 'react-native-gesture-handler';
import { NavigationContainer } from '@react-navigation/native'
import { createStackNavigator } from '@react-navigation/stack'
import Calendar from './Calendar';
import Announcements from './Announcements'
import AsyncStorage from '@react-native-community/async-storage'
const STORAGE_KEY = "teacherAnnouncements"
const Stack = createStackNavigator()
const getCurrentDate=()=>{
var date = new Date().getDate();
var month = new Date().getMonth() + 1;
var year = new Date().getFullYear();
return year + '-' + month + '-' + date;
return year + ',' + month + ',' + date;
}
const getWeekDate=()=>{
var date = new Date().getDate()-8;
var month = new Date().getMonth()+1;
var year = new Date().getFullYear();
return year + ',' + month + ',' + date;
}
const Event = ({item}) => {
const calendarIconURI = item.item.image !== undefined?`data:image/png;charset=utf-8;base64,${item.item.image}`:''
const [visible, setVisible] = useState(false)
const date = item.item.date.split('-')
const STORAGE_KEY = "teacherAnnouncements"
const Stack = createStackNavigator()
const Announcement = ({item}) => {
const date = new Date
const dateStr = `${date.getMonth()+1}/${date.getDate()}/${date.getFullYear()}`
const dateInfo = dateStr===item.item.date&&item.item.time!==undefined?item.item.time:item.item.date;
return (
<View style={liststyles.item1}>
<View style = {{display: 'flex', flexDirection: 'row', justifyContent: 'space-between'}}>
<View style = {{width: '75%'}}>
<Text style={liststyles.title3}>{item.item.message}</Text>
</View>
<View style = {{display: 'flex', flexDirection: 'row'}}>
{dateInfo!==undefined?<Text style={{fontSize: 16, alignSelf: 'center'}}>{dateInfo}</Text>:<></>}
</View>
</View>
</View>
)
}
export const TeacherList = ({route}) => {
return (
<View style={{}}>
<FlatList
data={route.params.data}
renderItem={item=><Announcement item={item}/>}
keyExtractor={item=>JSON.stringify(item)}
/>
</View>
)
}
export const whatsNew = ({route}) => {
const item = route.params
return (
<View style={{display:'flex', paddingHorizontal: '2%', backgroundColor: 'white', height: '100%'}}>
<View style={{height: '33%'}}>
<Text style={[liststyles.homeTitle, {marginBottom: '2%'}]}>Today</Text>
<ScrollView horizontal='true' style={{height: '100%', display: 'flex', flexDirection: 'row', paddingHorizontal: '2%'}}>
<View style={{display:'flex', flexDirection: 'row'}}>
<FlatList
data={item.data}
renderItem={item=><Today item={item}/>}
keyExtractor={item=>JSON.stringify(item)}
horizontal
/>
</View>
</ScrollView>
</View>
<View style={{height: '33%'}}>
<Text style={[liststyles.homeTitle, {marginBottom: '2%'}]}>Future</Text>
<ScrollView horizontal='true' style={{height: '100%', display: 'flex', flexDirection: 'row', paddingHorizontal: '2%'}}>
<View style={{display:'flex', flexDirection: 'row'}}>
<FlatList
data={item.data}
renderItem={item=><Future item={item}/>}
keyExtractor={item=>JSON.stringify(item)}
horizontal
/>
</View>
</ScrollView>
</View>
<View style={{height: '33%'}}>
<Text style={[liststyles.homeTitle, {marginBottom: '2%'}]}>Past Week</Text>
<ScrollView horizontal='true' style={{height: '100%', display: 'flex', flexDirection: 'row', paddingHorizontal: '2%'}}>
<View style={{display:'flex', flexDirection: 'row'}}>
<FlatList
data={item.data}
renderItem={item=><PastWeek item={item}/>}
keyExtractor={item=>JSON.stringify(item)}
horizontal
/>
</View>
</ScrollView>
</View>
</View>
)
}
const Today = ({item}) => {
const newIconURI = item.item.icon !== undefined?`data:image/png;charset=utf-8;base64,${item.item.icon}`:''
const today = new Date(getCurrentDate())
const week = new Date().setDate(new Date().getDate() - 8)
const itemDate = new Date(item.item.date)
const extra = (
<>
<Text style={{fontSize:20}}>{item.item.text}</Text>
<Text style={{fontSize:20}}>Location: {item.item.location}</Text>
</>
)
if (itemDate >= today) {
if (itemDate.getTime() == today.getTime()) {
return (
<TouchableOpacity style={{display:'flex', borderWidth:2, borderColor: 'black', borderRadius: 8, width: 120, height: 226, marginRight: 10}} onPress={()=>setVisible(!visible)} activeOpacity={0.8}>
<View>
<Image source = {{calendarIconURI}} style = {{height: '78%', width: '100%', borderTopLeftRadius: 8, borderTopRightRadius: 8}}/>
<View style={{height: '22%', paddingHorizontal: '2%'}}>
<Text style={{fontSize: 16}}>{item.item.title}</Text>
<Text style={{fontSize: 12}}>{`${date[1]}/${date[2]}/${date[0]}`}</Text>
</View>
<View style={{display:'flex', borderWidth:2, borderColor: 'black', borderRadius: 8, width: 120, height: '100%', marginRight: 10}} onPress={()=>setVisible(!visible)} activeOpacity={0.8}>
<Image source = {{newIconURI}} style = {{height: '76%', width: '100%', borderTopLeftRadius: 8, borderTopRightRadius: 8}}/>
<View style={{height: '24%', paddingHorizontal: '2%'}}>
<Text style={{fontSize: 16}}>{item.item.name}</Text>
<Text style={{fontSize: 12}}>{item.item.date}</Text>
</View>
</TouchableOpacity>
</View>
)
}
else if (itemDate >= week){
else {
return (
<TouchableOpacity style={{backgroundColor: '#e3e3e', display:'flex', borderWidth:1, borderColor: 'black', borderRadius: 8, width: 120, height: 226, marginRight: 10}} onPress={()=>setVisible(!visible)} activeOpacity={0.8}>
<View>
<Image source = {{calendarIconURI}} style = {{height: '78%', width: '100%', borderTopLeftRadius: 8, borderTopRightRadius: 8}}/>
<View style={{height: '22%', paddingHorizontal: '2%', backgroundColor: '#e3e3e3', borderBottomLeftRadius: 8, borderBottomRightRadius: 8}}>
<Text style={{fontSize: 16}}>{item.item.title}</Text>
<Text style={{fontSize: 12}}>{`${date[1]}/${date[2]}/${date[0]}`}</Text>
null
)
}
}
const Future = ({item}) => {
const newIconURI = item.item.icon !== undefined?`data:image/png;charset=utf-8;base64,${item.item.icon}`:''
const today = new Date(getCurrentDate())
const itemDate = new Date(item.item.date)
if (itemDate.getTime() > today.getTime()) {
return (
<View style={{display:'flex', borderWidth:2, borderColor: 'black', borderRadius: 8, width: 120, height: '100%', marginRight: 10}} onPress={()=>setVisible(!visible)} activeOpacity={0.8}>
<Image source = {{newIconURI}} style = {{height: '76%', width: '100%', borderTopLeftRadius: 8, borderTopRightRadius: 8}}/>
<View style={{height: '24%', paddingHorizontal: '2%'}}>
<Text style={{fontSize: 16}}>{item.item.name}</Text>
<Text style={{fontSize: 12}}>{item.item.date}</Text>
</View>
</View>
)
}
else {
return (
null
)
}
}
const PastWeek = ({item}) => {
const newIconURI = item.item.icon !== undefined?`data:image/png;charset=utf-8;base64,${item.item.icon}`:''
const today = new Date(getCurrentDate())
const week = new Date(getWeekDate())
const itemDate = new Date(item.item.date)
if (itemDate.getTime() >= week.getTime() && today.getTime()>itemDate.getTime()) {
return (
<View style={{display:'flex', borderWidth:2, borderColor: 'black', borderRadius: 8, width: 120, height: '100%', marginRight: 10}} onPress={()=>setVisible(!visible)} activeOpacity={0.8}>
<Image source = {{newIconURI}} style = {{height: '76%', width: '100%', borderTopLeftRadius: 8, borderTopRightRadius: 8}}/>
<View style={{height: '24%', paddingHorizontal: '2%'}}>
<Text style={{fontSize: 16}}>{item.item.name}</Text>
<Text style={{fontSize: 12}}>{item.item.date}</Text>
</View>
</View>
)
}
else {
return (
null
)
}
}
const AnnouncementToday = ({item}) => {
const date = new Date
const dateStr = `${date.getMonth()+1}/${date.getDate()}/${date.getFullYear()}`
const dateInfo = dateStr===item.item.date&&item.item.time!==undefined?item.item.time:'';
const itemDate = new Date(item.item.date)
const today = new Date(getCurrentDate())
const teacher = item.item.teacher !==""?item.item.teacher:"No Teacher"
if (itemDate.getTime()===today.getTime()) {
return (
<View style = {{display: 'flex', flexDirection: 'row', alignItems: 'center', paddingVertical: '2%', justifyContent: 'space-between', borderBottomWidth: 1, borderTopWidth: 1}}>
<View style = {{width: '75%'}}>
<Text style={{fontSize: 18}}>{item.item.message}</Text>
</View>
<View style = {{width: '25%', display: 'flex', flexDirection: 'row'}}>
<Text style={{fontSize: 14, alignSelf: 'center'}}>{teacher}{'\t'}{dateInfo}</Text>
</View>
</View>
</TouchableOpacity>
)
}
else {
return (
null
)
}
}
const New = ({item}) => {
const calendarIconURI = item.item.icon !== undefined?`data:image/png;charset=utf-8;base64,${item.item.icon}`:''
const today = new Date(getCurrentDate())
const week = new Date(getWeekDate())
const itemDate = new Date(item.item.date)
if (itemDate.getTime() >= today.getTime()) {
return (
<View style={{display:'flex', borderWidth:2, borderColor: 'black', borderRadius: 8, width: 120, height: '95%', marginRight: 10}} onPress={()=>setVisible(!visible)} activeOpacity={0.8}>
<Image source = {{calendarIconURI}} style = {{height: '76%', width: '100%', borderTopLeftRadius: 8, borderTopRightRadius: 8}}/>
<View style={{height: '24%', paddingHorizontal: '2%'}}>
<Text style={{fontSize: 16}}>{item.item.name}</Text>
<Text style={{fontSize: 12}}>{item.item.date}</Text>
</View>
</View>
)
}
else if (itemDate.getTime() >= week.getTime()){
return (
<View style={{backgroundColor: '#e3e3e', display:'flex', borderWidth:1, borderColor: 'black', borderRadius: 8, width: 120, height: '95%', marginRight: 10}} onPress={()=>setVisible(!visible)} activeOpacity={0.8}>
<Image source = {{calendarIconURI}} style = {{height: '76%', width: '100%', borderTopLeftRadius: 8, borderTopRightRadius: 8}}/>
<View style={{height: '24%', paddingHorizontal: '2%', backgroundColor: '#e3e3e3', borderBottomLeftRadius: 8, borderBottomRightRadius: 8}}>
<Text style={{fontSize: 16}}>{item.item.name}</Text>
<Text style={{fontSize: 12}}>{item.item.date}</Text>
</View>
</View>
)
}
else {
@@ -89,8 +259,8 @@ const Event = ({item}) => {
}
function Home1() {
const [modalVisible, setModalVisible] = useState(false);
const [modalVisible, setModalVisible] = useState(false);
return (
<View>
<View>
@@ -108,10 +278,132 @@ const [modalVisible, setModalVisible] = useState(false);
</View>
</Modal>
</View>
<View>
</View>
)
}
const background = (<LinearGradient
colors={['#f99', 'white']}
style = {{flex:1,borderBottomColor:'black',borderBottomWidth:0.5}}
/>)
function HomeStack() {
return (
<NavigationContainer independent={true}>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={Home}
options={{
title:'Blair',
headerTitleStyle:styles.headerTitle,
headerBackground: ()=>background
}}
/>
<Stack.Screen
name="new"
component={whatsNew}
options={({route})=> ({
title:"What's New",
headerTitleStyle:styles.headerTitle,
headerBackground: ()=>background
})}
/>
<Stack.Screen
name="Announcements"
component={Announcements}
options={({route})=> ({
title:"Announcements",
headerTitleStyle:styles.headerTitle,
headerBackground: ()=>background
})}
/>
<Stack.Screen
name="TeacherList"
component={TeacherList}
options={({route})=>({
headerTitleStyle:[styles.headerTitle,{alignSelf:'center',fontSize:Math.min(24,24*23/route.params.name.length)}],
title:route.params.name,
headerRight:()=>(<></>),
headerBackground: ()=>background
})}
/>
</Stack.Navigator>
</NavigationContainer>
)
}
function HomeScreen (props) {
const iconURI = props.studentData.icon !== undefined?`data:image/png;charset=utf-8;base64,${props.studentData.icon}`:`data:image/png;charset-utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAMZWlDQ1BJQ0MgUHJvZmlsZQAASImVlwdck0cbwO8dmSSsQARkhL1EkRlARggrgoBMQVRCEkgYMSYEETe1VMG6RRRHRasiFq1WQOpAxDqL4raOxoFKpRaruFD5LgNq7Td+3/1+994/zz333PM8uXvfOwAMVHyZrBA1BKBIWixPig5nTcrIZJEeAhowABhwBCP5AoWMk5gYB2AZav9eXl0DiLq97KG29c/+/1qMhSKFAAAkC3KOUCEogtwGAF4ukMmLASBGQLn9zGKZmsWQTeTQQchz1Jyn5RVqztHydo1OShIXcgsAZBqfL88DQL8DylklgjxoR/8hZE+pUCIFwMAEcohAzBdCToE8qqhoupoXQHaB+jLIuyCzcz6xmfc3+znD9vn8vGHWxqUp5AiJQlbIn/V/puZ/l6JC5dAcTrDSxPKYJHX8MIc3CqbHqpkGuVeaE5+gzjXkNxKhNu8AoFSxMiZVq49aChRcmD/AhOwp5EfEQraEHCUtjI/TyXNyJVE8yHC1oKWSYl6KbuxikSIyWWdzo3x6UsIQ58q5HN3YRr5cM69av0NZkMrR2b8hFvGG7L8sE6ekQ6YCgFFLJGnxkPUhmygKkmO1OphdmZgbP6QjVyap/XeAzBZJo8O19rGsXHlUkk5fVqQYiherEEt48TquKRanxGjzg+0W8DX+m0FuEkk5qUN2RIpJcUOxCEURkdrYsU6RNFUXL3ZXVhyepBvbJytM1OnjZFFhtFpuB9lCUZKsG4uPK4aLU2sfj5MVJ6Zo/cSz8/njE7X+4CUgDnBBBGABJaw5YDrIB5LO3uZe+EvbEwX4QA7ygAh46CRDI9I1PV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7n6Yg2nuqhsB/Yu29UFP8AGiEjfq4zm0DYB+sTrDqLwBAfVRPCQOot/dw1RVFrreX1hYN3ngIbwYHX1gBQGoF4IN8cHBg0+DgB3hHxW4C0DZDe9dUFyK8G3zjo6ZLzNIF4LOivYd+EuPnLVB7oBn+t/Zf+Z2KUSELugwAAACKZVhJZk1NACoAAAAIAAQBGgAFAAAAAQAAAD4BGwAFAAAAAQAAAEYBKAADAAAAAQACAACHaQAEAAAAAQAAAE4AAAAAAAAAkAAAAAEAAACQAAAAAQADkoYABwAAABIAAAB4oAIABAAAAAEAAAA8oAMABAAAAAEAAAA8AAAAAEFTQ0lJAAAAU2NyZWVuc2hvdEzNjqkAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAHUaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjQuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXh Line truncated
return(
<ScrollView style={{height: '100%', backgroundColor: 'white'}}>
<View style={{height: 275, backgroundColor: 'white', padding: '2%'}}>
<View style={{display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: '2%'}}>
<Text style={liststyles.homeTitle}>What's New?</Text>
<TouchableOpacity onPress={()=>props.navigation.navigate('new', {data:props.data})}>
<Text style={{color: 'blue', textDecorationLine: 'underline'}}>View All</Text>
</TouchableOpacity>
</View>
<ScrollView horizontal='true' style={{display: 'flex', flexDirection: 'row', paddingHorizontal: '2%'}}></ScrollView>
<View style={{display:'flex', flexDirection: 'row', padding: '2%'}}>
<FlatList
data={props.data}
renderItem={item=><New item={item}/>}
keyExtractor={item=>JSON.stringify(item)}
horizontal
/>
</View>
</View>
</View>
<View style={{height: 275, backgroundColor: 'white', padding: '2%'}}>
<Text style={liststyles.homeTitle}>Student of the Week</Text>
<View style={{display: 'flex', flexDirection: 'row', paddingTop: '5%', paddingHorizontal: '2%', justifyContent: 'space-between'}}>
<View style={{display: 'flex', borderWidth: 1, borderColor: 'black', borderRadius: 8, width: '32%', height: '100%'}}>
<View style={{height:'70%'}}>
<Image source = {{iconURI}} style = {{height:'100%', width: '100%', borderTopRightRadius: 8, borderTopLeftRadius:8}}/>
</View>
<View style ={{paddingHorizontal: '2%', height: '15%'}}>
<Text style={{fontWeight: 'bold', fontSize: 18}}>{props.studentData.name}</Text>
<Text>Grade {props.studentData.year}</Text>
</View>
</View>
<View style={{borderWidth: 1, borderColor: 'black', borderRadius: 8, width: '64%', height: '100%', padding: '2%'}}>
<Text style={{fontSize: 16}}><Text style={{fontWeight: 'bold'}}>Hobbies: </Text>{props.studentData.hobbies}</Text>
<Text style={{fontSize: 16}}><Text style={{fontWeight: 'bold'}}>Achievements: </Text>{props.studentData.achievements}</Text>
<Text style={{fontSize: 16}}><Text style={{fontWeight: 'bold'}}>Messages: </Text>{props.studentData.messages}</Text>
</View>
</View>
</View>
<View style={{padding: '2%'}}>
<View style ={{display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: '2%'}}>
<Text style={liststyles.homeTitle}>Announcements</Text>
<TouchableOpacity onPress={()=>props.navigation.navigate(Announcements)}>
<Text style={{color: 'blue', textDecorationLine: 'underline'}}>View All</Text>
</TouchableOpacity>
</View>
<FlatList
data={props.annData}
renderItem={item=><AnnouncementToday item={item}/>}
keyExtractor={item=>JSON.stringify(item)}
/>
</View>
<View style={{height: 220, display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between'}}>
<View style={{display: 'flex', alignItems: 'center', width: '50%'}}>
<TouchableOpacity onPress={() => Linking.openURL(props.challengeData.link)}>
<Image source={require('./assets/challenge.png')} style={{height: 200, width: 200}}/>
</TouchableOpacity>
</View>
<View style={{display: 'flex', alignItems: 'center', width: '50%'}}>
<TouchableOpacity onPress={() => Linking.openURL(props.pollData.link)}>
<Image source={require('./assets/polls.png')} style={{height: 200, width: 200}}/>
</TouchableOpacity>
</View>
</View>
</ScrollView>
)
}
@@ -120,9 +412,12 @@ class Home extends React.Component {
super(props)
this.state = {
studentData: [],
announcementsData:[],
challengeData:[],
annData:[],
data:[],
pollData:[],
challengeData:[],
teacherNames: [],
favoriteNames: [],
isLoading:true
}
}
@@ -140,6 +435,16 @@ class Home extends React.Component {
AsyncStorage.setItem(STORAGE_KEY,JSON.stringify(favoriteNames)).catch(console.log).done()
}
componentDidMount() {
fetch(`${url}/api/en/challenge`,{
headers: {
'Cache-Control': 'no-cache'
}}
).then((response) => {
return response.text();
}).then((json) => {
this.setState({challengeData: JSON.parse(json),isLoading:false});
}).catch((error) => console.error(error))
fetch(`${url}/api/en/student`,{
headers: {
'Cache-Control': 'no-cache'
@@ -150,16 +455,6 @@ class Home extends React.Component {
this.setState({studentData: JSON.parse(json),isLoading:false});
}).catch((error) => console.error(error))
fetch(`${url}/api/en/challenge`,{
headers: {
'Cache-Control': 'no-cache'
}}
).then((response) => {
return response.text();
}).then((json) => {
this.setState({challengeData: JSON.parse(json),isLoading:false});
}).catch((error) => console.error(error))
this.getData()
this.props.navigation.addListener(
'focus',
@@ -176,27 +471,8 @@ class Home extends React.Component {
.done()
}
getData1() {
fetch(`${url}/api/en/announcements`,{
headers: {
'Cache-Control': 'no-cache'
}
}
)
.then((response) => {
return response.text()
})
.then((txt) => {
const data = JSON.parse(txt).data;
const teacherNames = [...new Set(data.filter(x=>x.teacher!=null&&x.teacher.trim()!=='').map(x=>x.teacher))];
teacherNames.sort()
this.setState({data: data, teacherNames: teacherNames.map(x=>({name:x})),isLoading:false});
})
.catch((error) => console.error(error))
}
getData() {
fetch(`${url}/api/en/events`,{
fetch(`${url}/api/en/new`,{
headers: {
'Cache-Control': 'no-cache'
} })
@@ -211,71 +487,34 @@ class Home extends React.Component {
.catch((error) => console.error(error))
}
getData1() {
fetch(`${url}/api/en/announcements`,{
headers: {
'Cache-Control': 'no-cache'
}
}
)
.then((response) => {
return response.text()
})
.then((txt) => {
const data = JSON.parse(txt).data;
const teacherNames = [...new Set(data.filter(x=>x.teacher!=null&&x.teacher.trim()!=='').map(x=>x.teacher))];
teacherNames.sort()
this.setState({annData: data, teacherNames: teacherNames.map(x=>({name:x})),isLoading:false});
})
.catch((error) => console.error(error))
}
render() {
const iconURI = this.state.studentData.icon !== undefined?`data:image/png;charset=utf-8;base64,${this.state.studentData.icon}`:`data:image/png;charset-utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAMZWlDQ1BJQ0MgUHJvZmlsZQAASImVlwdck0cbwO8dmSSsQARkhL1EkRlARggrgoBMQVRCEkgYMSYEETe1VMG6RRRHRasiFq1WQOpAxDqL4raOxoFKpRaruFD5LgNq7Td+3/1+994/zz333PM8uXvfOwAMVHyZrBA1BKBIWixPig5nTcrIZJEeAhowABhwBCP5AoWMk5gYB2AZav9eXl0DiLq97KG29c/+/1qMhSKFAAAkC3KOUCEogtwGAF4ukMmLASBGQLn9zGKZmsWQTeTQQchz1Jyn5RVqztHydo1OShIXcgsAZBqfL88DQL8DylklgjxoR/8hZE+pUCIFwMAEcohAzBdCToE8qqhoupoXQHaB+jLIuyCzcz6xmfc3+znD9vn8vGHWxqUp5AiJQlbIn/V/puZ/l6JC5dAcTrDSxPKYJHX8MIc3CqbHqpkGuVeaE5+gzjXkNxKhNu8AoFSxMiZVq49aChRcmD/AhOwp5EfEQraEHCUtjI/TyXNyJVE8yHC1oKWSYl6KbuxikSIyWWdzo3x6UsIQ58q5HN3YRr5cM69av0NZkMrR2b8hFvGG7L8sE6ekQ6YCgFFLJGnxkPUhmygKkmO1OphdmZgbP6QjVyap/XeAzBZJo8O19r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+utelZ/qyL2Ie+fvJ9+/9UDw4OlDxcP33Yse0R9VP7Z5XP/E68nhnqiei79N/q37qezpQG/F70a/b3zm8uyHP8L+ON83qa/7ufz54J9LX5i/2PnS52V7f2L/3VdFrwZeV74xf7PrLfvtqXfp7x4PzHxPel/zwfVD68fYj7cHiwYHZXw5X3MUwGBFc+G54c+dANAzAGBchOeHydo7n6Yg2nuqhsB/Yu29UFP8AGiEjfq4zm0DYB+sTrDqLwBAfVRPCQOot/dw1RVFrreX1hYN3ngIbwYHX1gBQGoF4IN8cHBg0+DgB3hHxW4C0DZDe9dUFyK8G3zjo6ZLzNIF4LOivYd+EuPnLVB7oBn+t/Zf+Z2KUSELugwAAACKZVhJZk1NACoAAAAIAAQBGgAFAAAAAQAAAD4BGwAFAAAAAQAAAEYBKAADAAAAAQACAACHaQAEAAAAAQAAAE4AAAAAAAAAkAAAAAEAAACQAAAAAQADkoYABwAAABIAAAB4oAIABAAAAAEAAAA8oAMABAAAAAEAAAA8AAAAAEFTQ0lJAAAAU2NyZWVuc2hvdEzNjqkAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAHUaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjQuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9 Line truncated
return (
<View>
<View style = {{height: 90, 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>
<Home1></Home1>
<ScrollView style={{height: '100%', backgroundColor: 'white'}}>
<View style={{height: 275, backgroundColor: 'white', padding: '2%'}}>
<View style={{display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: '2%'}}>
<Text style={liststyles.homeTitle}>What's New?</Text>
<TouchableOpacity onPress={()=>this.navigation.navigate(Calendar)}>
<Text style={{color: 'blue', textDecorationLine: 'underline'}}>View All</Text>
</TouchableOpacity>
</View>
<ScrollView horizontal='true' style={{height: '105%', display: 'flex', flexDirection: 'row', paddingHorizontal: '2%'}}>
<View style={{display:'flex', flexDirection: 'row'}}>
<FlatList
data={this.state.data}
renderItem={item=><Event item={item}/>}
keyExtractor={item=>JSON.stringify(item)}
horizontal
/>
</View>
</ScrollView>
</View>
<View style={{height: 275, backgroundColor: 'white', padding: '2%'}}>
<Text style={liststyles.homeTitle}>Student of the Week</Text>
<View style={{display: 'flex', flexDirection: 'row', paddingTop: '5%', paddingHorizontal: '2%', justifyContent: 'space-between'}}>
<View style={{display: 'flex', borderWidth: 1, borderColor: 'black', borderRadius: 8, width: '32%', height: '100%'}}>
<View style={{height:'70%'}}>
<Image source = {{iconURI}} style = {{height:'100%', width: '100%', borderTopRightRadius: 8, borderTopLeftRadius:8}}/>
</View>
<View style ={{paddingHorizontal: '2%', height: '15%'}}>
<Text style={{fontWeight: 'bold', fontSize: 18}}>{this.state.studentData.name}</Text>
<Text>Grade {this.state.studentData.year}</Text>
</View>
</View>
<View style={{borderWidth: 1, borderColor: 'black', borderRadius: 8, width: '64%', height: '100%', padding: '2%'}}>
<Text style={{fontSize: 16}}><Text style={{fontWeight: 'bold'}}>Hobbies: </Text>{this.state.studentData.hobbies}</Text>
<Text style={{fontSize: 16}}><Text style={{fontWeight: 'bold'}}>Achievements: </Text>{this.state.studentData.achievements}</Text>
<Text style={{fontSize: 16}}><Text style={{fontWeight: 'bold'}}>Messages: </Text>{this.state.studentData.messages}</Text>
</View>
</View>
</View>
<TouchableOpacity style={{height: 400, padding: '2%'}}>
<Text style={liststyles.homeTitle}>Announcements</Text>
</TouchableOpacity>
</ScrollView>
<HomeScreen navigation={this.props.navigation} annData={this.state.annData} studentData={this.state.studentData} data={this.state.data} challengeData = {this.state.challengeData}></HomeScreen>
</View>
)
}
}
export default Home;
export default HomeStack;
+15 -1
View File
@@ -26,7 +26,21 @@ import { url } from './resources/fetchInfo.json'
const StaffElement = ({item}) => {
const [visible, setVisible] = useState(false)
const extra = [...item.item.emails.map(email=>(<Text key={email}>{'\n'}Email: <Text style={styles.linktext} onPress={()=>Linking.openURL("mailto:"+email)}>{email}</Text></Text>))]
const extra = (
[
...item.item.emails.map(email=>(
<View style={{display: 'flex', flexDirection: 'row', alignItems: 'center', marginTop: '2%', paddingHorizontal: '1%'}}>
<Image source={require('./assets/email.png')} style={{height: 22, width: 22}}/>
<Text key={email}><Text style={styles.linktext} onPress={()=>Linking.openURL("mailto:"+email)}>{' '}{email}</Text></Text>
</View>
)),
<View style={{display: 'flex', flexDirection: 'row', alignItems: 'center', marginTop: '2%', paddingHorizontal: '1%'}}>
<Image source = {require('./assets/dep.png')} style={{height: 22, width: 22}}/>
<Text>{' '}{item.item.department}</Text>
</View>
]
)
//const extra = [...item.item.emails.map(email=>(<Text key={email}>{'\n'}Email: <Text style={styles.linktext} onPress={()=>Linking.openURL("mailto:"+email)}>{email}</Text></Text>))]
return(
<View>
<TouchableOpacity style={styles.item1} onPress={()=>setVisible(!visible)} activeOpacity={0.8}>
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB