Prettify misc files
This commit is contained in:
@@ -9,7 +9,7 @@ import { Colors, Containers } from '../../styles'
|
||||
const SelectBoxGroup = ({ labels, optionsState, onSelect }) => {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{Object.keys(labels).map(key => {
|
||||
{Object.keys(labels).map((key) => {
|
||||
const isActive = optionsState[key]
|
||||
const boxStyle = [styles.box, isActive && styles.boxActive]
|
||||
const textStyle = [styles.text, isActive && styles.textActive]
|
||||
@@ -31,25 +31,25 @@ const SelectBoxGroup = ({ labels, optionsState, onSelect }) => {
|
||||
SelectBoxGroup.propTypes = {
|
||||
labels: PropTypes.object.isRequired,
|
||||
onSelect: PropTypes.func.isRequired,
|
||||
optionsState: PropTypes.object.isRequired
|
||||
optionsState: PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
box: {
|
||||
...Containers.box
|
||||
...Containers.box,
|
||||
},
|
||||
boxActive: {
|
||||
...Containers.boxActive
|
||||
...Containers.boxActive,
|
||||
},
|
||||
container: {
|
||||
...Containers.selectGroupContainer
|
||||
...Containers.selectGroupContainer,
|
||||
},
|
||||
text: {
|
||||
color: Colors.orange
|
||||
color: Colors.orange,
|
||||
},
|
||||
textActive: {
|
||||
color: 'white'
|
||||
}
|
||||
color: 'white',
|
||||
},
|
||||
})
|
||||
|
||||
export default SelectBoxGroup
|
||||
|
||||
@@ -9,23 +9,21 @@ import { Colors, Containers } from '../../styles'
|
||||
export default function SelectTabGroup({ activeButton, buttons, onSelect }) {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{
|
||||
buttons.map(({ label, value }, i) => {
|
||||
const isActive = value === activeButton
|
||||
const boxStyle = [styles.box, isActive && styles.boxActive]
|
||||
const textStyle = [styles.text, isActive && styles.textActive]
|
||||
{buttons.map(({ label, value }, i) => {
|
||||
const isActive = value === activeButton
|
||||
const boxStyle = [styles.box, isActive && styles.boxActive]
|
||||
const textStyle = [styles.text, isActive && styles.textActive]
|
||||
|
||||
return (
|
||||
<TouchableOpacity
|
||||
onPress={() => onSelect(value)}
|
||||
key={i}
|
||||
style={boxStyle}
|
||||
>
|
||||
<AppText style={textStyle}>{label}</AppText>
|
||||
</TouchableOpacity>
|
||||
)
|
||||
})
|
||||
}
|
||||
return (
|
||||
<TouchableOpacity
|
||||
onPress={() => onSelect(value)}
|
||||
key={i}
|
||||
style={boxStyle}
|
||||
>
|
||||
<AppText style={textStyle}>{label}</AppText>
|
||||
</TouchableOpacity>
|
||||
)
|
||||
})}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -33,23 +31,23 @@ export default function SelectTabGroup({ activeButton, buttons, onSelect }) {
|
||||
SelectTabGroup.propTypes = {
|
||||
activeButton: PropTypes.number,
|
||||
buttons: PropTypes.array.isRequired,
|
||||
onSelect: PropTypes.func.isRequired
|
||||
onSelect: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
box: {
|
||||
...Containers.box
|
||||
...Containers.box,
|
||||
},
|
||||
boxActive: {
|
||||
...Containers.boxActive
|
||||
...Containers.boxActive,
|
||||
},
|
||||
container: {
|
||||
...Containers.selectGroupContainer
|
||||
...Containers.selectGroupContainer,
|
||||
},
|
||||
text: {
|
||||
color: Colors.orange
|
||||
color: Colors.orange,
|
||||
},
|
||||
textActive: {
|
||||
color: 'white'
|
||||
}
|
||||
})
|
||||
color: 'white',
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user