Skip to content

Commit

Permalink
added ui customization
Browse files Browse the repository at this point in the history
  • Loading branch information
dalvira committed Aug 9, 2018
1 parent 452be28 commit daea537
Show file tree
Hide file tree
Showing 9 changed files with 762 additions and 649 deletions.
2 changes: 1 addition & 1 deletion App.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ const styles = StyleSheet.create({
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF'
backgroundColor: 'white'
}
});
4 changes: 0 additions & 4 deletions actions/types.js

This file was deleted.

23 changes: 17 additions & 6 deletions components/BillTotal.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,28 @@ BillTotal.propTypes = {
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'purple'
backgroundColor: '#65CB92'
},
billTotalLabelContainer: {
backgroundColor: 'pink'
marginTop: 30,
alignItems: 'center',
backgroundColor: '#65CB92'
},
billTotalLabel: {
fontSize: 20,
color: 'white'
},
billTotalInputContainer: {
backgroundColor: '#5AB181',
marginLeft: 60,
marginRight: 60
},
billTotalLabel: {},
billTotalInputContainer: {},
billTotalInput: {
height: 40,
height: 60,
borderColor: 'gray',
borderWidth: 1
borderWidth: 1,
fontSize: 45,
textAlign: 'center'
}
});

Expand Down
35 changes: 28 additions & 7 deletions components/Calculation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
import PropTypes from 'prop-types';

const Calculation = ({
calculateTip,
Expand All @@ -14,29 +15,49 @@ const Calculation = ({
return (
<View style={styles.container}>
<View style={styles.tipContainer}>
<Text style={styles.tip}>{calculation}</Text>
<Text style={styles.tip}>${calculation}</Text>
<Text style={styles.perTipper}>per Tipper</Text>
</View>
<View style={styles.calculateButtonContainer}>
<Button onPress={this.handleCalculation} title="Calculate" />
<Button
style={styles.calculateButton}
onPress={this.handleCalculation}
title="Calculate"
color="white"
/>
</View>
</View>
);
};

Calculation.proptypes = {
calculateTip: PropTypes.func.isRequired,
percentage: PropTypes.number.isRequired,
billTotal: PropTypes.number.isRequired,
numOfTippers: PropTypes.number.isRequired,
calculation: PropTypes.number.isRequired
};

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'magenta'
backgroundColor: '#65CB92'
},
tipContainer: {
flex: 2
flex: 2,
alignItems: 'center'
},
tip: {
fontSize: 45,
color: 'white'
},
perTipper: {
fontSize: 20,
color: 'white'
},
tip: {},
perTipper: {},
calculateButtonContainer: {
flex: 1,
backgroundColor: 'orange'
backgroundColor: '#5AB181'
}
});

Expand Down
16 changes: 11 additions & 5 deletions components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Home extends React.Component {
return (
<View style={styles.container}>
<View style={styles.header}>
<Text>Star Tipper</Text>
<Text style={styles.title}>Star Tipper</Text>
</View>
<View style={styles.body}>
<View style={styles.starRatingContainer}>
Expand All @@ -41,18 +41,23 @@ const styles = StyleSheet.create({
flex: 1,
alignSelf: 'stretch',
justifyContent: 'center',
alignItems: 'stretch'
alignItems: 'stretch',
backgroundColor: '#65CB92'
},
header: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'red'
backgroundColor: '#65CB92'
},
title: {
fontSize: 45,
color: 'white',
fontFamily: 'Bodoni 72'
},
title: {},
body: {
flex: 6,
backgroundColor: 'blue'
backgroundColor: 'white'
},
starRatingContainer: {
flex: 0.25
Expand All @@ -63,6 +68,7 @@ const styles = StyleSheet.create({
numOfTippersContainer: {
flex: 0.25
},
footer: {},
calculationContainer: {
flex: 0.25
}
Expand Down
10 changes: 7 additions & 3 deletions components/StarRating.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ StarRating.propTypes = {
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'orange'
backgroundColor: '#65CB92'
},
starButtonsContainer: {
flex: 2,
Expand All @@ -44,9 +44,13 @@ const styles = StyleSheet.create({
},
percentageContainer: {
flex: 1,
backgroundColor: 'green'
backgroundColor: '#65CB92',
alignItems: 'center'
},
percentage: {}
percentage: {
fontSize: 45,
color: 'white'
}
});

export default StarRating;
26 changes: 17 additions & 9 deletions components/TippersSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ const TippersSelection = ({
<Icon.Button
name="arrow-left"
size={40}
backgroundColor="red"
underlayColor="blue"
backgroundColor="#65CB92"
underlayColor="white"
onPress={decrementTippers}
/>
</View>
<View style={styles.numOfTippersContainer}>
<Text>{numOfTippers}</Text>
<Text style={styles.numOfTippers}>{numOfTippers}</Text>
</View>
<View style={styles.numOfTippersMoreContainer}>
<Icon.Button
name="arrow-right"
size={40}
backgroundColor="red"
underlayColor="blue"
backgroundColor="#65CB92"
underlayColor="white"
onPress={incrementTippers}
/>
</View>
Expand All @@ -49,19 +49,27 @@ TippersSelection.propTypes = {
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'teal'
backgroundColor: '#65CB92'
},
numOfTippersLabelContainer: {
backgroundColor: 'skyblue'
alignItems: 'center',
backgroundColor: '#65CB92'
},
numOfTippersLabel: {
fontSize: 20,
color: 'white'
},
numOfTippersLabel: {},
numOfTippersSelectContainer: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center'
},
numOfTippersSelect: {},
numOfTippersContainer: {}
numOfTippersContainer: {},
numOfTippers: {
fontSize: 45,
color: 'white'
}
});

export default TippersSelection;
5 changes: 1 addition & 4 deletions containers/CalculationContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ class CalculationContainer extends React.Component {
}

render() {
console.log(this.props.percentage);
console.log(this.props.billTotal);
console.log(this.props.numOfTippers);
return (
<View style={styles.container}>
<Calculation
Expand All @@ -37,7 +34,7 @@ const mapStateToProps = state => ({
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'teal'
backgroundColor: 'white'
}
});

Expand Down
Loading

0 comments on commit daea537

Please sign in to comment.