-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from ReflectionsProjections/myRP
My rp
- Loading branch information
Showing
12 changed files
with
416 additions
and
29 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,53 @@ | ||
import React from 'react'; | ||
import { View, StyleSheet } from 'react-native'; | ||
import Colors from "../constants/Colors"; | ||
|
||
const VerticalProgressBar = ({userPoints = 0}) => { | ||
const percentageFilled = userPoints / 50.0; // 50 is the total number of points to earn | ||
const totalBoxes = 10; | ||
const filledBoxes = Math.trunc(totalBoxes * percentageFilled) | ||
// Create an array representing the boxes | ||
const boxes = Array(totalBoxes).fill(false).map((_, index) => index < filledBoxes).reverse(); | ||
|
||
return ( | ||
<View style={styles.container}> | ||
{boxes.map((isFilled, index) => ( | ||
<View | ||
key={index} | ||
style={[ | ||
styles.box, | ||
isFilled ? styles.filledBox : styles.unfilledBox, | ||
]} | ||
/> | ||
))} | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
flexDirection: 'column', | ||
justifyContent: 'space-between', | ||
width: 50, | ||
padding: 5, | ||
backgroundColor: '#000', // Background similar to the image | ||
borderRadius: 4, | ||
borderColor: '#00ffff', // Border color matching the image | ||
borderWidth: 2, | ||
}, | ||
box: { | ||
flex: 1, | ||
marginBottom: 4, // Space between boxes | ||
}, | ||
filledBox: { | ||
backgroundColor: Colors.TEAL, // Filled box color | ||
}, | ||
unfilledBox: { | ||
backgroundColor: 'transparent', // Unfilled box color | ||
borderColor: Colors.TEAL, // Border color to match the outline | ||
borderWidth: 2, | ||
}, | ||
}); | ||
|
||
export default VerticalProgressBar; |
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Oops, something went wrong.