-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# This is a combination of 3 commits.
# This is the 1st commit message: Completed survey component # This is the commit message #2: populated answers on question view # This is the commit message #3: added styling to Surveys question header # This is the commit message #4: added radio button component # This is the commit message #5: added radio buttons and functionality for answer choice # This is the commit message #6: added progress bar base files # This is the commit message #7: initial progress bar # This is the commit message #8: styles on progressbar # This is the commit message #9: finished progress bar component # This is the commit message #10: refactored progress bar to track progress dynamically # This is the commit message #1: created progress bar container with arrows # This is the commit message #2: implemented dynamic rendering of survey questions # This is the commit message #3: fixed survey question layout
- Loading branch information
1 parent
78269d6
commit a00ee06
Showing
16 changed files
with
9,339 additions
and
118 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
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,25 @@ | ||
import React from 'react'; | ||
import { Text, View } from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import { styles } from './styles'; | ||
|
||
const ProgressBar = ({ overlayText, completePerc, totalSteps }) => { | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<View style={[styles.complete, { flex: completePerc }]} /> | ||
<View style={styles.textContainer}> | ||
<Text style={styles.overlay}> | ||
{overlayText} | ||
</Text> | ||
</View> | ||
<View style={[styles.incomplete, { flex: Math.abs(completePerc - totalSteps) }]} /> | ||
</View> | ||
); | ||
} | ||
|
||
export default ProgressBar; | ||
|
||
ProgressBar.propTypes = { | ||
|
||
} |
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,3 @@ | ||
import Progressbar from './ProgressBar'; | ||
|
||
export default Progressbar; |
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,36 @@ | ||
import { Dimensions, StyleSheet } from 'react-native' | ||
import { colors, typography } from '../../config/styles'; | ||
|
||
export const styles = StyleSheet.create({ | ||
container: { | ||
flexDirection: 'row', | ||
width: Dimensions.get('window').width / 1.75, | ||
height: 22.5, | ||
borderRadius: 20, | ||
borderWidth: 3, | ||
borderColor: colors.black, | ||
backgroundColor: colors.taxiYellow, | ||
marginBottom: 3, | ||
alignSelf: 'center' | ||
}, | ||
textContainer: { | ||
position: 'absolute', | ||
width: Dimensions.get('window').width / 1.75, | ||
zIndex: 2, | ||
backgroundColor: 'transparent', | ||
alignSelf: 'center' | ||
}, | ||
overlay: { | ||
textAlign: 'center', | ||
fontFamily: typography.fontMainRegular, | ||
fontSize: typography.norwester10, | ||
color: colors.lightGrey | ||
}, | ||
complete: { | ||
}, | ||
incomplete: { | ||
backgroundColor: colors.white, | ||
borderTopRightRadius: 20, | ||
borderBottomRightRadius: 20 | ||
} | ||
}); |
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,30 @@ | ||
import React, { Component } from 'react' | ||
import { | ||
View, | ||
TouchableWithoutFeedback | ||
} from 'react-native'; | ||
import { styles } from './styles'; | ||
|
||
const RadioButton = ({ isSelected, children, onPress }) => { | ||
return ( | ||
<View> | ||
<TouchableWithoutFeedback | ||
onPress={onPress} | ||
> | ||
<View style={styles.buttonContainer}> | ||
<View style={[styles.radio, styles.outerStyle]}> | ||
{(isSelected) | ||
? <View style={styles.innerStyle} /> | ||
: null | ||
} | ||
</View> | ||
<View style={styles.buttonLabel}> | ||
{children} | ||
</View> | ||
</View> | ||
</TouchableWithoutFeedback> | ||
</View> | ||
) | ||
} | ||
|
||
export default RadioButton; |
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,3 @@ | ||
import RadioButton from './RadioButton'; | ||
|
||
export default RadioButton; |
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,48 @@ | ||
import { StyleSheet } from 'react-native' | ||
import { colors } from '../../config/styles'; | ||
|
||
const defaultProps = { | ||
size: 20, | ||
borderWidth: 4, | ||
selectedColor: colors.taxiYellow, | ||
unselectedColor: colors.lightestGrey, | ||
borderColor: colors.black | ||
}; | ||
|
||
const { | ||
size, | ||
borderWidth, | ||
borderColor, | ||
selectedColor, | ||
unselectedColor | ||
} = defaultProps; | ||
|
||
export const styles = StyleSheet.create({ | ||
radio: { | ||
justifyContent: 'center', | ||
alignItems: 'center' | ||
}, | ||
innerStyle: { | ||
width: size - borderWidth, | ||
height: size - borderWidth, | ||
borderRadius: size / 2, | ||
backgroundColor: selectedColor | ||
}, | ||
outerStyle: { | ||
borderColor: borderColor, | ||
backgroundColor: unselectedColor, | ||
width: size + borderWidth, | ||
height: size + borderWidth, | ||
borderRadius: size * 2, | ||
borderWidth: borderWidth | ||
}, | ||
buttonLabel: { | ||
marginLeft: 10, | ||
alignItems: 'center', | ||
justifyContent: 'center' | ||
}, | ||
buttonContainer: { | ||
flexDirection: 'row', | ||
padding: 10 | ||
} | ||
}); |
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.