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

41 lines
1 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 tabHeadingTheme = {
2020-01-28 20:07:21 +01:00
flexDirection: 'row',
2019-06-25 22:20:24 +02:00
backgroundColor: variables.tabDefaultBg,
flex: 1,
2020-01-28 20:07:21 +01:00
alignItems: 'center',
justifyContent: 'center',
'.scrollable': {
2019-06-25 22:20:24 +02:00
paddingHorizontal: 20,
2020-01-28 20:07:21 +01:00
flex: platform === PLATFORM.ANDROID ? 0 : 1,
minWidth: platform === PLATFORM.ANDROID ? undefined : 60
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.topTabBarTextColor,
marginHorizontal: 7
},
2020-01-28 20:07:21 +01:00
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
color: variables.topTabBarTextColor,
2020-01-28 20:07:21 +01:00
fontSize: platform === PLATFORM.IOS ? 26 : undefined
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'.active': {
'NativeBase.Text': {
2019-06-25 22:20:24 +02:00
color: variables.topTabBarActiveTextColor,
2020-01-28 20:07:21 +01:00
fontWeight: '600'
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
color: variables.topTabBarActiveTextColor
}
}
};
return tabHeadingTheme;
};