Renames FramedSegment to Segment
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { StyleSheet, View } from 'react-native'
|
||||
|
||||
import AppText from './app-text'
|
||||
|
||||
import { Containers, Typography } from '../../styles/redesign'
|
||||
|
||||
const Segment = ({ children, last, title }) => {
|
||||
const containerStyle = last ? styles.containerLast : styles.container
|
||||
|
||||
return (
|
||||
<View style={containerStyle}>
|
||||
{title && <AppText style={styles.title}>{title}</AppText>}
|
||||
{children}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Segment.propTypes = {
|
||||
children: PropTypes.node,
|
||||
last: PropTypes.bool,
|
||||
title: PropTypes.string
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
...Containers.segmentContainer,
|
||||
...Containers.bottomBorder
|
||||
},
|
||||
containerLast: {
|
||||
...Containers.segmentContainer,
|
||||
...Containers.marginBottom
|
||||
},
|
||||
title: {
|
||||
...Typography.titleSmall
|
||||
}
|
||||
})
|
||||
|
||||
export default Segment
|
||||
Reference in New Issue
Block a user