Moves unique styles of Segment component from common files to local one

This commit is contained in:
mashazyu
2020-03-23 15:32:53 +01:00
committed by Sofiya Tepikin
parent 78d4077fb4
commit fb519c4380
4 changed files with 32 additions and 36 deletions
+18 -6
View File
@@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native'
import AppText from './app-text' import AppText from './app-text'
import { Containers, Typography } from '../../styles/redesign' import { Colors, Spacing, Sizes, Typography } from '../../styles/redesign'
const Segment = ({ children, last, title }) => { const Segment = ({ children, last, title }) => {
const containerStyle = last ? styles.containerLast : styles.container const containerStyle = last ? styles.containerLast : styles.container
@@ -23,17 +23,29 @@ Segment.propTypes = {
title: PropTypes.string title: PropTypes.string
} }
const bottomBorder = {
borderStyle: 'solid',
borderBottomWidth: 2,
borderBottomColor: Colors.grey,
paddingBottom: Spacing.base
}
const segmentContainer = {
marginHorizontal: Spacing.base,
marginBottom: Spacing.base,
}
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
...Containers.segmentContainer, ...segmentContainer,
...Containers.bottomBorder ...bottomBorder
}, },
containerLast: { containerLast: {
...Containers.segmentContainer, ...segmentContainer
...Containers.marginBottom
}, },
title: { title: {
...Typography.titleSmall fontSize: Sizes.subtitle,
...Typography.title
} }
}) })
+1 -10
View File
@@ -1,13 +1,6 @@
import Colors from './colors' import Colors from './colors'
import Spacing from './spacing'
export default { export default {
bottomBorder: {
borderStyle: 'solid',
borderBottomWidth: 2,
borderBottomColor: Colors.grey,
paddingBottom: Spacing.base
},
centerItems: { centerItems: {
alignItems: 'center', alignItems: 'center',
flex: 1, flex: 1,
@@ -19,7 +12,6 @@ export default {
borderStyle: 'solid', borderStyle: 'solid',
borderWidth: 1, borderWidth: 1,
}, },
marginBottom: { marginBottom: Spacing.base },
orangeButton: { orangeButton: {
backgroundColor: Colors.orange, backgroundColor: Colors.orange,
borderRadius: 25 borderRadius: 25
@@ -27,6 +19,5 @@ export default {
page: { page: {
backgroundColor: Colors.tourquiseLight, backgroundColor: Colors.tourquiseLight,
flex: 1 flex: 1
}, }
segmentContainer: { marginHorizontal: Spacing.base }
} }
+3 -2
View File
@@ -1,5 +1,6 @@
import Colors from './colors' import Colors from './colors'
import Containers from './containers' import Containers from './containers'
import Typography from './typography' import Spacing from './spacing'
import Typography, { sizes as Sizes } from './typography'
export { Colors, Containers, Typography } export { Colors, Containers, Spacing, Sizes, Typography }
+10 -18
View File
@@ -6,12 +6,10 @@ const fonts = {
bold : 'Jost-700-Bold', bold : 'Jost-700-Bold',
} }
const sizes = { export const sizes = {
mainMedium: 18, base: 18,
mainLarge: 20, subtitle: 22,
titleSmall: 22, title: 24
titleMedium: 24,
titleLarge: 28
} }
const button = { const button = {
@@ -20,12 +18,6 @@ const button = {
textTransform: 'uppercase' textTransform: 'uppercase'
} }
const title = {
color: Colors.purple,
marginHorizontal: Spacing.base,
marginVertical: Spacing.large
}
export default { export default {
buttonTextBold: { buttonTextBold: {
fontFamily: fonts.bold, fontFamily: fonts.bold,
@@ -37,18 +29,18 @@ export default {
}, },
mainText: { mainText: {
fontFamily: fonts.main, fontFamily: fonts.main,
fontSize: sizes.mainMedium fontSize: sizes.base
}, },
pageTitle: { pageTitle: {
alignSelf: 'center', alignSelf: 'center',
fontFamily: fonts.bold, fontFamily: fonts.bold,
fontWeight: '700', fontWeight: '700',
fontSize: sizes.titleMedium, fontSize: sizes.title,
...title marginHorizontal: Spacing.base,
}, },
titleSmall: { title: {
fontSize: sizes.titleSmall, color: Colors.purple,
...title marginVertical: Spacing.large
}, },
underline: { textDecorationLine: 'underline' } underline: { textDecorationLine: 'underline' }
} }