Separates TemperatureSlider component, adds minor post-review changes

This commit is contained in:
mashazyu
2020-03-30 17:13:47 +02:00
committed by Sofiya Tepikin
parent 42bc91d9c2
commit 45cff710c8
6 changed files with 171 additions and 139 deletions
+4 -15
View File
@@ -3,21 +3,15 @@ import PropTypes from 'prop-types'
import { StyleSheet, View } from 'react-native'
import AppText from './app-text'
import AppIcon from './app-icon'
import { Colors, Containers, Spacing, Typography } from '../../styles/redesign'
import { Colors, Spacing, Typography } from '../../styles/redesign'
const Segment = ({ children, icon, last, title }) => {
const Segment = ({ children, last, title }) => {
const containerStyle = last ? styles.containerLast : styles.container
return (
<View style={containerStyle}>
{title &&
<View style={styles.line}>
{icon && <AppIcon name={icon} color={Colors.purple} />}
<AppText style={styles.title}>{title}</AppText>
</View>
}
{title && <AppText style={styles.title}>{title}</AppText>}
{children}
</View>
)
@@ -25,7 +19,6 @@ const Segment = ({ children, icon, last, title }) => {
Segment.propTypes = {
children: PropTypes.node,
icon: PropTypes.string,
last: PropTypes.bool,
title: PropTypes.string
}
@@ -46,13 +39,9 @@ const styles = StyleSheet.create({
containerLast: {
...segmentContainer
},
line: {
alignItems: 'center',
flexDirection: 'row'
},
title: {
...Typography.subtitle
}
})
export default Segment
export default Segment