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

120 lines
2.9 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 platformStyle = variables.platformStyle;
const platform = variables.platform;
const iconCommon = {
2020-01-28 20:07:21 +01:00
'NativeBase.Icon': {
2019-06-25 22:20:24 +02:00
color: variables.tabBarActiveTextColor
}
};
const iconNBCommon = {
2020-01-28 20:07:21 +01:00
'NativeBase.IconNB': {
2019-06-25 22:20:24 +02:00
color: variables.tabBarActiveTextColor
}
};
const textCommon = {
2020-01-28 20:07:21 +01:00
'NativeBase.Text': {
2019-06-25 22:20:24 +02:00
color: variables.tabBarActiveTextColor
}
};
const footerTheme = {
2020-01-28 20:07:21 +01:00
'NativeBase.Left': {
'NativeBase.Button': {
'.transparent': {
backgroundColor: 'transparent',
2019-06-25 22:20:24 +02:00
borderColor: null,
elevation: 0,
shadowColor: null,
shadowOffset: null,
shadowRadius: null,
shadowOpacity: null,
...iconCommon,
...iconNBCommon,
...textCommon
},
alignSelf: null,
...iconCommon,
2020-01-28 20:07:21 +01:00
...iconNBCommon
2019-06-25 22:20:24 +02:00
// ...textCommon
},
flex: 1,
2020-01-28 20:07:21 +01:00
alignSelf: 'center',
alignItems: 'flex-start'
2019-06-25 22:20:24 +02:00
},
2020-01-28 20:07:21 +01:00
'NativeBase.Body': {
2019-06-25 22:20:24 +02:00
flex: 1,
2020-01-28 20:07:21 +01:00
alignItems: 'center',
alignSelf: 'center',
flexDirection: 'row',
'NativeBase.Button': {
alignSelf: 'center',
'.transparent': {
backgroundColor: 'transparent',
2019-06-25 22:20:24 +02:00
borderColor: null,
elevation: 0,
shadowColor: null,
shadowOffset: null,
shadowRadius: null,
shadowOpacity: null,
...iconCommon,
...iconNBCommon,
...textCommon
},
2020-01-28 20:07:21 +01:00
'.full': {
2019-06-25 22:20:24 +02:00
height: variables.footerHeight,
paddingBottom: variables.footerPaddingBottom,
flex: 1
},
...iconCommon,
2020-01-28 20:07:21 +01:00
...iconNBCommon
2019-06-25 22:20:24 +02:00
// ...textCommon
}
},
2020-01-28 20:07:21 +01:00
'NativeBase.Right': {
'NativeBase.Button': {
'.transparent': {
backgroundColor: 'transparent',
2019-06-25 22:20:24 +02:00
borderColor: null,
elevation: 0,
shadowColor: null,
shadowOffset: null,
shadowRadius: null,
shadowOpacity: null,
...iconCommon,
...iconNBCommon,
...textCommon
},
alignSelf: null,
...iconCommon,
2020-01-28 20:07:21 +01:00
...iconNBCommon
2019-06-25 22:20:24 +02:00
// ...textCommon
},
flex: 1,
2020-01-28 20:07:21 +01:00
alignSelf: 'center',
alignItems: 'flex-end'
2019-06-25 22:20:24 +02:00
},
backgroundColor: variables.footerDefaultBg,
2020-01-28 20:07:21 +01:00
flexDirection: 'row',
justifyContent: 'center',
2019-06-25 22:20:24 +02:00
borderTopWidth:
2020-01-28 20:07:21 +01:00
platform === PLATFORM.IOS && platformStyle !== PLATFORM.MATERIAL
2019-06-25 22:20:24 +02:00
? variables.borderWidth
: undefined,
borderColor:
2020-01-28 20:07:21 +01:00
platform === PLATFORM.IOS && platformStyle !== PLATFORM.MATERIAL
? '#cbcbcb'
2019-06-25 22:20:24 +02:00
: undefined,
height: variables.footerHeight,
paddingBottom: variables.footerPaddingBottom,
elevation: 3,
left: 0,
right: 0
};
return footerTheme;
};