Skip to content
Snippets Groups Projects
Commit fb519c43 authored by mashazyu's avatar mashazyu Committed by Sofiya Tepikin
Browse files

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

parent 78d4077f
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native' ...@@ -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 = { ...@@ -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
} }
}) })
......
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 { ...@@ -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 { ...@@ -27,6 +19,5 @@ export default {
page: { page: {
backgroundColor: Colors.tourquiseLight, backgroundColor: Colors.tourquiseLight,
flex: 1 flex: 1
}, }
segmentContainer: { marginHorizontal: Spacing.base }
} }
\ No newline at end of file
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 }
...@@ -6,12 +6,10 @@ const fonts = { ...@@ -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 = { ...@@ -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 { ...@@ -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' }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment