finished home pg + other minor stuff

This commit is contained in:
Emily Liu 2020-12-24 01:35:25 -05:00
parent 0bf2629664
commit d7d71ef594
6 changed files with 405 additions and 141 deletions

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:<></>}

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>

File diff suppressed because one or more lines are too long

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}>

BIN
app/assets/dep.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
app/assets/email.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB