Skip to content

Commit

Permalink
history
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmineguru committed Dec 17, 2023
1 parent 03b93a8 commit f9cd209
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 68 deletions.
55 changes: 34 additions & 21 deletions frontend/src/screens/Energy/energyHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {
type EnergyEntryRecommendation,
} from '../../models/Energy';
import { useNavigation } from '@react-navigation/native';
import Ionicons from '@expo/vector-icons/Ionicons';

import { type StackNavigationProp } from '@react-navigation/stack';
import { type RootStackParamList } from '../../components/types';
export type StackNavigation = StackNavigationProp<RootStackParamList>;
Expand Down Expand Up @@ -132,6 +134,10 @@ export default function EnergyHistory(): JSX.Element {
return (
<SafeAreaView style={styles.container}>
<ScrollView style={styles.scrollContainer}>
<TouchableOpacity style={styles.backButton} onPress={() => navigation.goBack()}>
<Ionicons name="arrow-back" size={30} color={Colors.DARKDARKGREEN} />
<Text style={styles.buttonText}> Decomposition </Text>
</TouchableOpacity>
<View style={styles.halfScreen}>
<ImageBackground
source={{
Expand Down Expand Up @@ -257,23 +263,20 @@ const styles = StyleSheet.create({
justifyContent: 'center',
},
header: {
fontSize: 30,
fontSize: 36,
color: Colors.WHITE,
fontFamily: 'Montserrat',
fontWeight: '700',
},
headerGreen: {
fontSize: 30,
color: Colors.DARKGREEN,
fontFamily: 'Montserrat',
fontWeight: '700',
},
discription: {
paddingTop: 15,
fontSize: 16,
color: Colors.WHITE,
fontFamily: 'Montserrat',
fontWeight: '700',
fontWeight: '500',
},
headerBox: {
backgroundColor: Colors.BLACKTRANS,
Expand All @@ -287,14 +290,14 @@ const styles = StyleSheet.create({
leaderBoardWidgetContainer: {
backgroundColor: Colors.DARKGREEN,
margin: 15,
borderRadius: 10,
borderRadius: 15,
height: 400,
marginTop: 25,
},
recommendationContainer: {
backgroundColor: Colors.GREYGREEN,
margin: 15,
borderRadius: 10,
borderRadius: 15,
height: 350,
marginTop: 25,
},
Expand All @@ -309,53 +312,53 @@ const styles = StyleSheet.create({
marginTop: 15,
},
itemContainer: {
justifyContent: 'center',
width: '90%',
padding: 15,
borderRadius: 10,
backgroundColor: Colors.DARKGREEN2,
marginBottom: 10,
},
itemName: {
fontWeight: '700',
fontWeight: '600',
fontSize: 16,
fontFamily: 'Montserrat',
color: Colors.WHITE,
},
expandedContent: {
marginTop: 10,
padding: 10,
backgroundColor: Colors.DARKGREEN3,
borderRadius: 10,
width: 320,
width: '100%',
},
historyExpandedContent: {
justifyContent: 'center',
marginTop: 10,
padding: 10,
backgroundColor: Colors.DARKGREEN3,
backgroundColor: Colors.TRANSGREEN,
borderRadius: 10,
width: 350,
width: '90%',
},
descriptionText: {
color: Colors.WHITE,
fontFamily: 'Montserrat',
fontSize: 16,
fontWeight: '700',
fontWeight: '500',
},
flatListContainer: {
width: 350,
},
tab: {
justifyContent: 'center',
height: 50,
width: '90%',
paddingVertical: 8,
paddingHorizontal: 20,
borderRadius: 5,
borderWidth: 1,
borderColor: Colors.DARKGREEN2,
borderRadius: 10,
backgroundColor: Colors.DARKGREEN2,
marginTop: 15,
},
tabText: {
fontWeight: '700',
fontFamily: 'Montserrat',
fontWeight: '500',
color: Colors.WHITE,
},
chartContainer: {
Expand All @@ -364,14 +367,24 @@ const styles = StyleSheet.create({
chart: {
marginVertical: 8,
marginHorizontal: 8,
alignSelf: 'center',
justifyContent: 'center',
marginLeft: -50,
borderRadius: 10,

},
tabTitle: {
fontSize: 18,
fontWeight: 'bold',
fontFamily: 'Montserrat',
color: Colors.WHITE,
textAlign: 'center',
},
backButton: {
alignItems: 'center',
flexDirection: 'row',
},
buttonText: {
color: Colors.DARKDARKGREEN,
fontSize: 16,
fontWeight: '700',
},
});
58 changes: 36 additions & 22 deletions frontend/src/screens/Food/foodHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { type FoodEntry, type MonthlyEntry, type FoodEntryRecommendation } from
import { useNavigation } from '@react-navigation/native';
import { type StackNavigationProp } from '@react-navigation/stack';
import { type RootStackParamList } from '../../components/types';
import Ionicons from '@expo/vector-icons/Ionicons';

export type StackNavigation = StackNavigationProp<RootStackParamList>;

interface Recommendation {
Expand Down Expand Up @@ -158,6 +160,10 @@ export default function FoodHistory(): JSX.Element {

return (
<SafeAreaView style={styles.container}>
<TouchableOpacity style={styles.backButton} onPress={() => navigation.goBack()}>
<Ionicons name="arrow-back" size={30} color={Colors.DARKDARKGREEN} />
<Text style={styles.buttonText}> Decomposition </Text>
</TouchableOpacity>
<ScrollView style={styles.scrollContainer}>
<View style={styles.halfScreen}>
<ImageBackground
Expand Down Expand Up @@ -206,14 +212,15 @@ export default function FoodHistory(): JSX.Element {
},
],
}}
width={380}
width={350}
height={200}
yAxisSuffix=" k"
yAxisLabel="Carbon Footprint" // Add yAxisLabel here
fromZero
chartConfig={{
backgroundColor: Colors.BLACK,
backgroundGradientFrom: Colors.WHITE,

backgroundGradientTo: Colors.WHITE,
decimalPlaces: 2,
color: (opacity = 1) => Colors.DARKLIMEGREEN,
Expand Down Expand Up @@ -284,23 +291,20 @@ const styles = StyleSheet.create({
justifyContent: 'center',
},
header: {
fontSize: 30,
fontSize: 36,
color: Colors.WHITE,
fontFamily: 'Montserrat',
fontWeight: '700',
},
headerGreen: {
fontSize: 30,
color: Colors.DARKGREEN,
fontFamily: 'Montserrat',
fontWeight: '700',
},
discription: {
paddingTop: 15,
fontSize: 16,
color: Colors.WHITE,
fontFamily: 'Montserrat',
fontWeight: '700',
fontWeight: '500',
},
headerBox: {
backgroundColor: Colors.BLACKTRANS,
Expand All @@ -314,14 +318,14 @@ const styles = StyleSheet.create({
leaderBoardWidgetContainer: {
backgroundColor: Colors.DARKGREEN,
margin: 15,
borderRadius: 10,
borderRadius: 15,
height: 400,
marginTop: 25,
},
recommendationContainer: {
backgroundColor: Colors.GREYGREEN,
margin: 15,
borderRadius: 10,
borderRadius: 15,
height: 350,
marginTop: 25,
},
Expand All @@ -336,53 +340,53 @@ const styles = StyleSheet.create({
marginTop: 15,
},
itemContainer: {
justifyContent: 'center',
width: '90%',
padding: 15,
borderRadius: 10,
backgroundColor: Colors.DARKGREEN2,
marginBottom: 10,
},
itemName: {
fontWeight: '700',
fontWeight: '600',
fontSize: 16,
fontFamily: 'Montserrat',
color: Colors.WHITE,
},
expandedContent: {
marginTop: 10,
padding: 10,
backgroundColor: Colors.DARKGREEN3,
borderRadius: 10,
width: 320,
width: '100%',
},
historyExpandedContent: {
justifyContent: 'center',
marginTop: 10,
padding: 10,
backgroundColor: Colors.DARKGREEN3,
backgroundColor: Colors.TRANSGREEN,
borderRadius: 10,
width: 350,
width: '90%',
},
descriptionText: {
color: Colors.WHITE,
fontFamily: 'Montserrat',
fontSize: 16,
fontWeight: '700',
fontWeight: '500',
},
flatListContainer: {
width: 350,
},
tab: {
justifyContent: 'center',
height: 50,
width: '90%',
paddingVertical: 8,
paddingHorizontal: 20,
borderRadius: 5,
borderWidth: 1,
borderColor: Colors.DARKGREEN2,
borderRadius: 10,
backgroundColor: Colors.DARKGREEN2,
marginTop: 15,
},
tabText: {
fontWeight: '700',
fontFamily: 'Montserrat',
fontWeight: '500',
color: Colors.WHITE,
},
chartContainer: {
Expand All @@ -391,14 +395,24 @@ const styles = StyleSheet.create({
chart: {
marginVertical: 8,
marginHorizontal: 8,
alignSelf: 'center',
justifyContent: 'center',
marginLeft: -50,
borderRadius: 10,

},
tabTitle: {
fontSize: 18,
fontWeight: 'bold',
fontFamily: 'Montserrat',
color: Colors.WHITE,
textAlign: 'center',
},
backButton: {
alignItems: 'center',
flexDirection: 'row',
},
buttonText: {
color: Colors.DARKDARKGREEN,
fontSize: 16,
fontWeight: '700',
},
});
2 changes: 0 additions & 2 deletions frontend/src/screens/Transportation/transportationForum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,11 @@ const styles = StyleSheet.create({
},
header: {
color: Colors.DARKGREEN,
fontFamily: 'Montserrat',
fontSize: 25,
fontWeight: '700',
marginBottom: 50,
},
question: {
fontFamily: 'Montserrat',
fontSize: 20,
fontWeight: '700',
color: Colors.DARKGREEN,
Expand Down
Loading

0 comments on commit f9cd209

Please sign in to comment.