diff --git a/components/rewards/PointsHistory.js b/components/rewards/PointsHistory.js index b74df2ca..7f3ba4c6 100644 --- a/components/rewards/PointsHistory.js +++ b/components/rewards/PointsHistory.js @@ -1,5 +1,6 @@ import React from 'react'; import { Button, ScrollView, StyleSheet, Text, View } from 'react-native'; +import { Overline } from '../BaseComponents'; import Transaction from './Transaction'; /** * @prop @@ -14,8 +15,8 @@ const styles = StyleSheet.create({ function PointsHistory({ transactions, user, updates, navigation }) { // Only display if transactions have mounted + // TODO @kennethlien fix spacing at line 44 if (transactions) { - const recent = transactions.splice(0, 3); return ( {/* Prompt to upload receipt */} @@ -36,19 +37,11 @@ function PointsHistory({ transactions, user, updates, navigation }) { ) : ( )} + {/* end receipt prompt */} {/* Points history */} - Recent Transactions - {recent.map(transaction => ( - - ))} - Complete History + Recent TraNsAcTiOnS {transactions.map(transaction => ( ({ percentage: prevState.percentage + 20 })); + } + + render() { + return ( +
+

A React Progress Bar

+ + +
+ +
+ +
this.setState({ percentage: 0 })}> + Reset +
+
+ ); + } +} + +export const ProgressBar = props => { + return ( +
+ +
+ ); +}; + +const Filler = props => { + return
; +}; + +// Other React Stuff + +// Check out my free youtube video on how to build a thumbnail gallery in react +// https://www.youtube.com/watch?v=GZ4d3HEn9zg + +// https://medium.com/@ItsMeDannyZ/build-an-image-slider-with-react-es6-264368de68e4 + +// Follow me on Github! +// https://github.com/DZuz14 diff --git a/components/rewards/RewardsHome.js b/components/rewards/RewardsHome.js index 77095b10..3d7b3158 100644 --- a/components/rewards/RewardsHome.js +++ b/components/rewards/RewardsHome.js @@ -1,6 +1,9 @@ import React from 'react'; -import { Platform, StyleSheet, Text, View } from 'react-native'; -import { Body } from '../BaseComponents'; +import { View } from 'react-native'; +import { Body, Caption, Title } from '../BaseComponents'; +import { styles } from '../../styled/rewards'; +import { ProgressBar } from '../rewards/ProgressBar'; + /** * @prop * */ @@ -8,18 +11,21 @@ import { Body } from '../BaseComponents'; function RewardsHome({ transactions, user }) { return ( + - {`Welcome, ${user.name}`} + {`Welcome, ${user.name}`} {user.points} total points - + {' '} {`${1000 - (parseInt(user.points) % 1000)} points to your next reward`} - + - Your transaction history: + + Your transaction history: + {transactions.splice(0, 3).map(transaction => { return ( @@ -36,36 +42,4 @@ function RewardsHome({ transactions, user }) { ); } - -const styles = StyleSheet.create({ - tabBarInfoContainer: { - position: 'absolute', - bottom: 150, - left: 0, - right: 0, - ...Platform.select({ - ios: { - shadowColor: 'black', - shadowOffset: { width: 0, height: 3 }, - shadowOpacity: 0.1, - shadowRadius: 3 - }, - android: { - elevation: 20 - } - }), - alignItems: 'center', - backgroundColor: '#fbfbfb', - paddingVertical: 20 - }, - navigationFilename: { - marginTop: 5 - }, - getStartedContainer: { - alignItems: 'center', - marginHorizontal: 50, - paddingVertical: 20 - } -}); - export default React.memo(RewardsHome); diff --git a/components/rewards/Transaction.js b/components/rewards/Transaction.js index e3d46c4e..9e56e493 100644 --- a/components/rewards/Transaction.js +++ b/components/rewards/Transaction.js @@ -4,10 +4,9 @@ import { TouchableOpacity } from 'react-native'; import { Card, ContentContainer, - IconContainer, - MainText, - Overline + IconContainer } from '../../styled/transaction'; +import { Caption, Body } from '../../components/BaseComponents'; /** * @prop @@ -22,10 +21,10 @@ function Transaction(props) { - + {date.toLocaleDateString()} @ {storeName} - - {points} Points Redeemed + + {points} Points Redeemed diff --git a/screens/rewards/RewardsScreen.js b/screens/rewards/RewardsScreen.js index eea4b687..450383c6 100644 --- a/screens/rewards/RewardsScreen.js +++ b/screens/rewards/RewardsScreen.js @@ -17,6 +17,7 @@ import { styles, TopTab } from '../../styled/rewards'; +import { Body, Caption, Title } from '../../components/BaseComponents'; const routes = [ { key: 'home', title: 'My Rewards' }, @@ -163,11 +164,12 @@ export default class RewardsScreen extends React.Component { this.props.navigation.navigate('Stores')}> {/* TODO: change this to a proper icon */} - + - + + Healthy Rewards - </Text> +