-
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.
Merge branch 'main' into feature/72/recommendations-page
- Loading branch information
Showing
11 changed files
with
516 additions
and
95 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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
const Colors = { | ||
LIGHTFGREEN: '#E0EEC6', | ||
DARKGREEN: '#243E36', | ||
LIGHTFGREEN: '#d8edc2', | ||
DARKGREEN: '#012b26', | ||
DARKTRANS: '#07332f', | ||
DARKGREEN2: '#224A3E', | ||
DARKGREEN3: '#2E5C4E', | ||
WHITE: '#fff', | ||
BLACK: '000', | ||
WHITE: '#ffffff', | ||
BLACK: '#000000', | ||
DARKLIMEGREEN: '#4B8552', | ||
GREY: '#ccc', | ||
GREY: '#cccccc', | ||
FILLGREEN: '#7CA982', | ||
ERROR: 'red', | ||
TRANSGREEN: '#366959', | ||
BLACKTRANS: '#000000aa', | ||
BLUE: 'blue', | ||
GREYGREEN: '#B4C792', | ||
TEAL: '#6bcfca' | ||
}; | ||
|
||
export default Colors; |
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
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,70 @@ | ||
import React from 'react'; | ||
import { View, Text, StyleSheet } from 'react-native'; | ||
import Colors from '../../assets/colorConstants'; | ||
import { getUserLevel } from '../models/User'; | ||
import { type ExpProgressBarProps } from './types'; | ||
|
||
const ExpProgressBar: React.FC<ExpProgressBarProps> = ({ thisUser }) => { | ||
const lvl = getUserLevel(thisUser); | ||
// testing--const lvl = 7; | ||
const lvlThresh = [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000]; | ||
const maxExp = lvlThresh[lvl - 1]; | ||
|
||
const curr = thisUser.score; | ||
// testing--const curr = 14039; | ||
|
||
const progress = (curr / maxExp) * 100; | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<View style={styles.progressBar}> | ||
<View style={[styles.currProgression, { width: `${progress}%` }]} /> | ||
</View> | ||
<View style={styles.textBox}> | ||
<View style={styles.levelContainer}> | ||
<Text style={styles.texts}> Level: {lvl}</Text> | ||
</View> | ||
<View style={styles.progContainer}> | ||
<Text style={styles.texts}> {`${curr}/${maxExp}`}</Text> | ||
</View> | ||
</View> | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
width: 250, | ||
marginVertical: 4, | ||
}, | ||
progressBar: { | ||
flexDirection: 'row', | ||
height: 5, | ||
backgroundColor: Colors.WHITE, | ||
borderRadius: 10, | ||
overflow: 'hidden', | ||
}, | ||
currProgression:{ | ||
backgroundColor: Colors.TEAL, | ||
height: '100%', | ||
|
||
}, | ||
levelContainer:{ | ||
flex: 1, | ||
justifyContent: 'flex-start', | ||
paddingLeft: 5, | ||
}, | ||
texts:{ | ||
marginTop: 5, | ||
color: Colors.WHITE, | ||
fontSize: 12, | ||
}, | ||
progContainer:{ | ||
justifyContent: 'flex-end', | ||
}, | ||
textBox:{ | ||
flexDirection: 'row' | ||
} | ||
}); | ||
|
||
export default ExpProgressBar; |
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,21 @@ | ||
import { type challenge } from "../types"; | ||
|
||
const sampleChallenges: challenge[] = [ | ||
{ | ||
id: 1, | ||
title: 'Meatless Mondays', | ||
description: 'Try going vegitarian (or vegan for a bigger challenge) for an entire Monday', | ||
}, | ||
{ | ||
id: 2, | ||
title: "One man's treasure another man's innovation", | ||
description: 'Visit a thrift shop and turn 3 items into one sculpture', | ||
}, | ||
{ | ||
id: 3, | ||
title: 'Good re-Soup', | ||
description: 'Reuse and repurpose your leftovers by turning it into stock!', | ||
}, | ||
]; | ||
|
||
export default sampleChallenges; |
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
Oops, something went wrong.