application-amicale/native-base-theme/components/Segment.js

58 lines
1.6 KiB
JavaScript
Raw Normal View History

2019-06-25 22:20:24 +02:00
// @flow
2020-01-28 20:07:21 +01:00
import variable from './../variables/platform';
import { PLATFORM } from './../variables/commonColor';
2019-06-25 22:20:24 +02:00
2020-01-28 20:07:21 +01:00
export default (variables /* : * */ = variable) => {
2019-06-25 22:20:24 +02:00
const platform = variables.platform;
const segmentTheme = {
height: 45,
borderColor: variables.segmentBorderColorMain,
2020-01-28 20:07:21 +01:00
flexDirection: 'row',
justifyContent: 'center',
2019-06-25 22:20:24 +02:00
backgroundColor: variables.segmentBackgroundColor,
2020-01-28 20:07:21 +01:00
'NativeBase.Button': {
alignSelf: 'center',
2019-06-25 22:20:24 +02:00
borderRadius: 0,
paddingTop: 3,
paddingBottom: 3,
height: 30,
2020-01-28 20:07:21 +01:00
backgroundColor: 'transparent',
2019-06-25 22:20:24 +02:00
borderWidth: 1,
borderLeftWidth: 0,
borderColor: variables.segmentBorderColor,
elevation: 0,
2020-01-28 20:07:21 +01:00
'.active': {
2019-06-25 22:20:24 +02:00
backgroundColor: variables.segmentActiveBackgroundColor,
2020-01-28 20:07:21 +01:00
'NativeBase.Text': {
2019-06-25 22:20:24 +02:00
color: variables.segmentActiveTextColor
},
2020-01-28 20:07:21 +01:00
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
color: variables.segmentActiveTextColor
}
},
2020-01-28 20:07:21 +01:00
'.first': {
borderTopLeftRadius: platform === PLATFORM.IOS ? 5 : undefined,
borderBottomLeftRadius: platform === PLATFORM.IOS ? 5 : undefined,
2019-06-25 22:20:24 +02:00
borderLeftWidth: 1
},
2020-01-28 20:07:21 +01:00
'.last': {
borderTopRightRadius: platform === PLATFORM.IOS ? 5 : undefined,
borderBottomRightRadius: platform === PLATFORM.IOS ? 5 : undefined
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'NativeBase.Text': {
2019-06-25 22:20:24 +02:00
color: variables.segmentTextColor,
fontSize: 14
},
2020-01-28 20:07:21 +01:00
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
fontSize: 22,
paddingTop: 0,
color: variables.segmentTextColor
}
}
};
return segmentTheme;
};