-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c56225f
commit d3bfe0b
Showing
8 changed files
with
434 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
> Why do I have a folder named ".expo" in my project? | ||
The ".expo" folder is created when an Expo project is started using "expo start" command. | ||
|
||
> What do the files contain? | ||
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds. | ||
- "packager-info.json": contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator. | ||
- "settings.json": contains the server configuration that is used to serve the application manifest. | ||
|
||
> Should I commit the ".expo" folder? | ||
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine. | ||
|
||
Upon project creation, the ".expo" folder is already added to your ".gitignore" file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"hostType": "lan", | ||
"lanType": "ip", | ||
"devClient": true, | ||
"dev": true, | ||
"minify": false, | ||
"urlRandomness": null, | ||
"https": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
154 changes: 87 additions & 67 deletions
154
frontend/sac-mobile/app/(calendar)/components/agendaItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,103 @@ | ||
import React, {useCallback} from 'react'; | ||
import {StyleSheet, Alert, View, Text, TouchableOpacity, Button} from 'react-native'; | ||
|
||
import React, { useCallback } from 'react'; | ||
import { | ||
Alert, | ||
Button, | ||
StyleSheet, | ||
Text, | ||
TouchableOpacity, | ||
View | ||
} from 'react-native'; | ||
|
||
interface ItemProps { | ||
item: any; | ||
item: any; | ||
} | ||
|
||
const AgendaItem = (props: ItemProps) => { | ||
const {item} = props; | ||
const { item } = props; | ||
|
||
const buttonPressed = useCallback(() => { | ||
Alert.alert('Show me more'); | ||
}, []); | ||
|
||
const buttonPressed = useCallback(() => { | ||
Alert.alert('Show me more'); | ||
}, []); | ||
const itemPressed = useCallback(() => { | ||
Alert.alert(item.title); | ||
}, []); | ||
|
||
const itemPressed = useCallback(() => { | ||
Alert.alert(item.title); | ||
}, []); | ||
if (!item) { | ||
return ( | ||
<View style={styles.emptyItem}> | ||
<Text style={styles.emptyItemText}> | ||
No Events Planned Today | ||
</Text> | ||
</View> | ||
); | ||
} | ||
|
||
if (!item) { | ||
return ( | ||
<View style={styles.emptyItem}> | ||
<Text style={styles.emptyItemText}>No Events Planned Today</Text> | ||
</View> | ||
<TouchableOpacity onPress={itemPressed} style={styles.item}> | ||
<View> | ||
<Text style={styles.itemHourText}>{item.hour}</Text> | ||
<Text style={styles.itemDurationText}>{item.duration}</Text> | ||
</View> | ||
<View> | ||
<Text style={styles.itemTitleText}>{item.title}</Text> | ||
<Text style={styles.itemText}>{item.location}</Text> | ||
</View> | ||
<View style={styles.itemButtonContainer}> | ||
<Button color={'grey'} title={'Info'} onPress={buttonPressed} /> | ||
</View> | ||
</TouchableOpacity> | ||
); | ||
} | ||
|
||
return ( | ||
<TouchableOpacity onPress={itemPressed} style={styles.item}> | ||
<View> | ||
<Text style={styles.itemHourText}>{item.hour}</Text> | ||
<Text style={styles.itemDurationText}>{item.duration}</Text> | ||
</View> | ||
<Text style={styles.itemTitleText}>{item.title}</Text> | ||
<View style={styles.itemButtonContainer}> | ||
<Button color={'grey'} title={'Info'} onPress={buttonPressed}/> | ||
</View> | ||
</TouchableOpacity> | ||
); | ||
}; | ||
|
||
export default React.memo(AgendaItem); | ||
|
||
|
||
const styles = StyleSheet.create({ | ||
item: { | ||
padding: 20, | ||
backgroundColor: 'white', | ||
borderBottomWidth: 1, | ||
borderBottomColor: 'lightgrey', | ||
flexDirection: 'row' | ||
}, | ||
itemHourText: { | ||
color: 'black' | ||
}, | ||
itemDurationText: { | ||
color: 'grey', | ||
fontSize: 12, | ||
marginTop: 4, | ||
marginLeft: 4 | ||
}, | ||
itemTitleText: { | ||
color: 'black', | ||
marginLeft: 16, | ||
fontWeight: 'bold', | ||
fontSize: 16 | ||
}, | ||
itemButtonContainer: { | ||
flex: 1, | ||
alignItems: 'flex-end' | ||
}, | ||
emptyItem: { | ||
paddingLeft: 20, | ||
height: 52, | ||
justifyContent: 'center', | ||
borderBottomWidth: 1, | ||
borderBottomColor: 'lightgrey' | ||
item: { | ||
marginTop: 4, | ||
marginBottom: 4, | ||
marginLeft: 16, | ||
marginRight: 8, | ||
padding: 20, | ||
backgroundColor: 'white', | ||
shadowColor: 'black', | ||
shadowOpacity: 0.25, | ||
shadowOffset: { width: 0, height: 2 }, | ||
flexDirection: 'row', | ||
borderRadius: 12 | ||
}, | ||
itemHourText: { | ||
color: 'black' | ||
}, | ||
itemText: { | ||
color: 'black', | ||
paddingLeft: 16 | ||
}, | ||
emptyItemText: { | ||
color: 'lightgrey', | ||
fontSize: 14 | ||
} | ||
}); | ||
itemDurationText: { | ||
color: 'grey', | ||
fontSize: 12, | ||
marginTop: 4, | ||
marginLeft: 'auto' | ||
}, | ||
itemTitleText: { | ||
color: 'black', | ||
marginLeft: 16, | ||
fontWeight: 'bold', | ||
fontSize: 16 | ||
}, | ||
itemButtonContainer: { | ||
flex: 1, | ||
alignItems: 'flex-end' | ||
}, | ||
emptyItem: { | ||
paddingLeft: 20, | ||
height: 52, | ||
justifyContent: 'center', | ||
borderBottomWidth: 1, | ||
borderBottomColor: 'lightgrey' | ||
}, | ||
emptyItemText: { | ||
color: 'lightgrey', | ||
fontSize: 14 | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.